Skip to content

Commit 6629bdc

Browse files
authored
Merge pull request #114 from cortex-command-community/effectalwaysshows
Exposed EffectAlwaysShows to Lua
2 parents 8b25566 + 81ae873 commit 6629bdc

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
<details><summary><b>Added</b></summary>
10+
11+
- Exposed `MovableObject` INI property `EffectAlwaysShows` to Lua (R/W), boolean.
12+
913
<details><summary><b>Changed</b></summary>
1014

1115
- Brain vs Brain now uses the Infantry Brain preset if available, and picks a random brain if not.

Source/Entities/MovableObject.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,17 @@ namespace RTE {
434434
bool GetPostEffectEnabled() const { return m_PostEffectEnabled; }
435435

436436
/// Sets whether or not to draw this MovableObject's effect every frame.
437-
/// @param Boolean indicating whether or not to draw the effect.
437+
/// @param newValue Boolean indicating whether or not to draw the effect.
438438
void SetPostEffectEnabled(bool newValue) { m_PostEffectEnabled = newValue; }
439439

440+
/// Gets whether or not this MovableObject's effect can be obscured.
441+
/// @return Boolean indicating whether or not the effect can be obscured.
442+
bool GetEffectAlwaysShows() const { return m_EffectAlwaysShows; }
443+
444+
/// Sets whether or not this MovableObject's effect can be obscured.
445+
/// @param newValue Boolean indicating whether or not the effect can be obscured.
446+
void SetEffectAlwaysShows(bool newValue) { m_EffectAlwaysShows = newValue; }
447+
440448
/// Sets the current angular velocity of this MovableObject. Positive is
441449
/// a counter clockwise rotation.
442450
/// @param newRotVel The new angular velocity in radians per second.

Source/Lua/LuaBindingsEntities.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,7 @@ LuaBindingRegisterFunctionDefinitionForType(EntityLuaBindings, MovableObject) {
890890
.property("Diameter", &MovableObject::GetDiameter)
891891
.property("Scale", &MovableObject::GetScale, &MovableObject::SetScale)
892892
.property("EffectRotAngle", &MovableObject::GetEffectRotAngle, &MovableObject::SetEffectRotAngle)
893+
.property("EffectAlwaysShows", &MovableObject::GetEffectAlwaysShows, &MovableObject::SetEffectAlwaysShows)
893894
.property("EffectStartStrength", &MovableObject::GetEffectStartStrengthFloat, &MovableObject::SetEffectStartStrengthFloat)
894895
.property("EffectStopStrength", &MovableObject::GetEffectStopStrengthFloat, &MovableObject::SetEffectStopStrengthFloat)
895896
.property("GlobalAccScalar", &MovableObject::GetGlobalAccScalar, &MovableObject::SetGlobalAccScalar)

0 commit comments

Comments
 (0)