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

Function gui_getWidget

library/LuaApi.cpp:1824–1841  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1822}
1823
1824static int gui_getWidget(lua_State *L) {
1825 df::widget_container *container = Lua::CheckDFObject<df::widget_container>(L, 1);
1826
1827 df::widget *w = NULL;
1828 int max_arg_idx = lua_gettop(L);
1829 for (int32_t idx = 2; idx <= max_arg_idx; ++idx) {
1830 if (!container)
1831 return 0;
1832 w = get_one_widget(L, idx, container);
1833 if (!w)
1834 return 0;
1835 if (idx < max_arg_idx)
1836 container = virtual_cast<df::widget_container>(w);
1837 }
1838
1839 Lua::PushDFObject(L, w);
1840 return 1;
1841}
1842
1843static int gui_getWidgetChildren(lua_State *L) {
1844 df::widget_container *container = Lua::CheckDFObject<df::widget_container>(L, 1);

Callers

nothing calls this directly

Calls 3

lua_gettopFunction · 0.85
get_one_widgetFunction · 0.85
PushDFObjectFunction · 0.85

Tested by

no test coverage detected