Skip to content

Commit 9c9bf0c

Browse files
committed
Split Color up into Get/SetColorIndex
1 parent 1e061ca commit 9c9bf0c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
134134

135135
- New `SceneMan` Lua function `CastTerrainPenetrationRay(Vector start, Vector ray, Vector endPos, int strengthLimit, int skip)`, which adds up the material strength of the terrain pixels encountered along the way, and stops when the accumulated value meets or exceeds `strengthLimit`. `endPos` is filled out with the ending position of the ray, returns `true` or `false` depending on whether the ray was stopped early or not.
136136

137-
- Exposed `MOPixel` property `Color` to Lua (R/W). It gets and sets the index of the MOPixel's color.
137+
- New `MOPixel` Lua functions `GetColorIndex()` and `SetColorIndex(int newColorIndex)`, which allow you to get and set the index of the pixel's color.
138138

139139
</details>
140140

Source/Lua/LuaBindingsEntities.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,9 @@ LuaBindingRegisterFunctionDefinitionForType(EntityLuaBindings, MOPixel) {
764764

765765
.property("TrailLength", &MOPixel::GetTrailLength, &MOPixel::SetTrailLength)
766766
.property("Staininess", &MOPixel::GetStaininess, &MOPixel::SetStaininess)
767-
.property("Color", &MOPixel::GetColorIndex, &MOPixel::SetColorIndex);
767+
768+
.def("GetColorIndex", &MOPixel::GetColorIndex)
769+
.def("SetColorIndex", &MOPixel::SetColorIndex);
768770
}
769771

770772
LuaBindingRegisterFunctionDefinitionForType(EntityLuaBindings, MOSParticle) {

0 commit comments

Comments
 (0)