Skip to content

Commit

Permalink
Room:GetWallColor (closes #440)
Browse files Browse the repository at this point in the history
  • Loading branch information
namishere committed Nov 16, 2024
1 parent bd7f98a commit 68701af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions libzhl/functions/Room.zhl
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ struct Room depends (EntityList, RoomDescriptor, TemporaryEffects, RailManager)
int _greedWaveTimer : 0x7130;
float _waterAmount : 0x7134;
bool _pacifist : 0x7185;
ColorMod _wallColor : 0x71b4;
TemporaryEffects _temporaryEffects : 0x71f4;
int _numRainSpawners : 0x7338;
float _rainIntensity : 0x733c;
Expand Down
7 changes: 7 additions & 0 deletions repentogon/LuaInterfaces/Room/LuaRoom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,12 @@ HOOK_METHOD(Room, GetSeededCollectible, (uint32_t seed, bool noDecrease) -> int)
return super(seed, noDecrease);
}

LUA_FUNCTION(Lua_RoomGetWallColor) {
Room* room = lua::GetUserdata<Room*>(L, 1, lua::Metatables::ROOM, lua::metatables::RoomMT);
lua::luabridge::UserdataPtr::push(L, &room->_wallColor, lua::Metatables::COLOR);
return 1;
}

HOOK_METHOD(LuaEngine, RegisterClasses, () -> void) {
super();

Expand All @@ -510,6 +516,7 @@ HOOK_METHOD(LuaEngine, RegisterClasses, () -> void) {
{ "GetWaterAmount", Lua_RoomGetWaterAmount},
{ "SetWaterAmount", Lua_RoomSetWaterAmount},
{ "GetFloorColor", Lua_RoomGetFloorColor},
{ "GetWallColor", Lua_RoomGetWallColor},
{ "GetWaterColor", Lua_RoomGetWaterColor},
{ "SetWaterColor", Lua_RoomSetWaterColor},
{ "SetWaterCurrent", Lua_RoomSetWaterCurrent},
Expand Down

0 comments on commit 68701af

Please sign in to comment.