Skip to content

Commit e385288

Browse files
committed
Merge branch 'development' into exposeeffectstrength
2 parents e583d99 + 0c5d32b commit e385288

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1414

1515
- Added `HDFirearm` lua bindings `EjectionOffset` (R/W) and `EjectionPos` (R). Work similarly to their Muzzle variants.
1616

17+
- New `MovableObject` Lua functions `GetScreenEffectPath()` and `SetScreenEffectPath(string pathToFile)`, which get and set the file path to the object's screen effect.
18+
1719
- Exposed `MovableObject` INI properties `EffectStartStrength` and `EffectStopStrength` to Lua (R/W). Default range in Lua is a float from 0-1 (0%-100%), but going outside of this range is possible.
1820

1921
- New `MovableObject` Lua function `SetEffectStrength(float strength)`, which sets both `EffectStartStrength` and `EffectStopStrength` to the given value in order to simplify setting glow strength to a specific value.
@@ -2504,4 +2506,4 @@ Note: For a log of changes made prior to the commencement of the open source com
25042506
[Release v5.0.0]: https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source/releases/tag/v0.1.0-pre5.2
25052507
[Release v6.0.0]: https://github.com/cortex-command-community/Cortex-Command-Community-Project/releases/tag/v6.0.0
25062508
[Release v6.1.0]: https://github.com/cortex-command-community/Cortex-Command-Community-Project/releases/tag/v6.1.0
2507-
[Unreleased]: https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source/compare/master...cortex-command-community:development
2509+
[Unreleased]: https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source/compare/master...cortex-command-community:development

Source/Entities/MovableObject.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,18 @@ namespace RTE {
385385
/// @param newAngle The new absolute angle in radians.
386386
void SetEffectRotAngle(float newAngle) { m_EffectRotAngle = newAngle; }
387387

388+
/// Gets the file path of this MovableObject's current screen effect.
389+
/// @return A string containing the file path of the screen effect.
390+
std::string GetScreenEffectPath() const { return m_ScreenEffectFile.GetDataPath(); }
391+
392+
/// Gets the file path of this MovableObject's current screen effect.
393+
/// @param pathToFile A string containing the file path of the new screen effect.
394+
void SetScreenEffectPath(std::string pathToFile) {
395+
m_ScreenEffectFile.SetDataPath(pathToFile);
396+
m_pScreenEffect = m_ScreenEffectFile.GetAsBitmap();
397+
m_ScreenEffectHash = m_ScreenEffectFile.GetHash();
398+
}
399+
388400
/// Gets the current absolute angle of rotation of this MovableObject's effect.
389401
/// @return The absolute angle in radians.
390402
float GetEffectRotAngle() const { return m_EffectRotAngle; }

Source/Lua/LuaBindingsEntities.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,9 @@ LuaBindingRegisterFunctionDefinitionForType(EntityLuaBindings, MovableObject) {
991991
.def("SendMessage", &LuaAdaptersMovableObject::SendMessage1)
992992
.def("SendMessage", &LuaAdaptersMovableObject::SendMessage2)
993993
.def("RequestSyncedUpdate", &MovableObject::RequestSyncedUpdate)
994-
.def("SetEffectStrength", &MovableObject::SetEffectStrength);
994+
.def("SetEffectStrength", &MovableObject::SetEffectStrength)
995+
.def("GetScreenEffectPath", &MovableObject::GetScreenEffectPath)
996+
.def("SetScreenEffectPath", &MovableObject::SetScreenEffectPath);
995997
}
996998

997999
LuaBindingRegisterFunctionDefinitionForType(EntityLuaBindings, PEmitter) {

0 commit comments

Comments
 (0)