Skip to content

Commit

Permalink
Add Spring.SetAutoShowMetal to control GuiHandler::autoShowMetal.
Browse files Browse the repository at this point in the history
  • Loading branch information
saurtron committed Dec 24, 2024
1 parent 5f2e70a commit fd33b53
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rts/Game/UI/GuiHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ class CGuiHandler : public CInputReceiver {
int inCommand = -1;
int buildFacing = FACING_SOUTH;
int buildSpacing = 0;
bool autoShowMetal = false;

private:
int maxPage = 0;
Expand Down Expand Up @@ -218,7 +219,6 @@ class CGuiHandler : public CInputReceiver {

bool needShift = false;
bool showingMetal = false;
bool autoShowMetal = false;
bool invertQueueKey = false;
bool activeMousePress = false;
bool forceLayoutUpdate = false;
Expand Down
12 changes: 12 additions & 0 deletions rts/Lua/LuaUnsyncedCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ bool LuaUnsyncedCtrl::PushEntries(lua_State* L)

REGISTER_LUA_CFUNC(SetCustomCommandDrawData);

REGISTER_LUA_CFUNC(SetAutoShowMetal);
REGISTER_LUA_CFUNC(SetDrawSky);
REGISTER_LUA_CFUNC(SetDrawWater);
REGISTER_LUA_CFUNC(SetDrawGround);
Expand Down Expand Up @@ -4213,6 +4214,17 @@ int LuaUnsyncedCtrl::GarbageCollectCtrl(lua_State* L) {
}


/*** @function Spring.SetAutoShowMetal
* @bool autoShow
* @treturn nil
*/
int LuaUnsyncedCtrl::SetAutoShowMetal(lua_State* L)
{
guihandler->autoShowMetal = !!luaL_checkboolean(L, 1);
return 0;
}


/*** @function Spring.SetDrawSky
* @bool drawSky
* @treturn nil
Expand Down
1 change: 1 addition & 0 deletions rts/Lua/LuaUnsyncedCtrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class LuaUnsyncedCtrl {

static int SetCustomCommandDrawData(lua_State* L);

static int SetAutoShowMetal(lua_State* L);
static int SetDrawSky(lua_State* L);
static int SetDrawWater(lua_State* L);
static int SetDrawGround(lua_State* L);
Expand Down

0 comments on commit fd33b53

Please sign in to comment.