MCPcopy Create free account
hub / github.com/DFHack/dfhack / autobutcher_getSettings

Function autobutcher_getSettings

plugins/autobutcher.cpp:909–919  ·  view source on GitHub ↗

push autobutcher settings on lua stack

Source from the content-addressed store, hash-verified

907
908// push autobutcher settings on lua stack
909static int autobutcher_getSettings(lua_State *L) {
910 lua_newtable(L);
911 int ctable = lua_gettop(L);
912 Lua::SetField(L, config.get_bool(CONFIG_IS_ENABLED), ctable, "enable_autobutcher");
913 Lua::SetField(L, config.get_bool(CONFIG_AUTOWATCH), ctable, "enable_autowatch");
914 Lua::SetField(L, config.get_int(CONFIG_DEFAULT_FK), ctable, "fk");
915 Lua::SetField(L, config.get_int(CONFIG_DEFAULT_MK), ctable, "mk");
916 Lua::SetField(L, config.get_int(CONFIG_DEFAULT_FA), ctable, "fa");
917 Lua::SetField(L, config.get_int(CONFIG_DEFAULT_MA), ctable, "ma");
918 return 1;
919}
920
921// push the watchlist vector as nested table on the lua stack
922static int autobutcher_getWatchList(lua_State *L) {

Callers

nothing calls this directly

Calls 2

lua_gettopFunction · 0.85
SetFieldFunction · 0.85

Tested by

no test coverage detected