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

Method update_focus

library/modules/Screen.cpp:911–933  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

909}
910
911void dfhack_lua_viewscreen::update_focus(lua_State *L, int idx)
912{
913 lua_getfield(L, idx, "text_input_mode");
914 text_input_mode = lua_toboolean(L, -1);
915 lua_pop(L, 1);
916 lua_getfield(L, idx, "allow_options");
917 allow_options = lua_toboolean(L, -1);
918 lua_pop(L, 1);
919 lua_getfield(L, idx, "defocused");
920 defocused = lua_toboolean(L, -1);
921 lua_pop(L, 1);
922
923 lua_getfield(L, idx, "focus_path");
924 auto str = lua_tostring(L, -1);
925 if (!str) str = "";
926 focus = str;
927 lua_pop(L, 1);
928
929 if (focus.empty())
930 focus = "lua";
931 else if (string::npos == focus.find("lua/"))
932 focus = "lua/"+focus;
933}
934
935int dfhack_lua_viewscreen::do_render(lua_State *L)
936{

Callers 2

do_notifyMethod · 0.95
do_inputMethod · 0.95

Calls 4

lua_getfieldFunction · 0.85
lua_tobooleanFunction · 0.85
emptyMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected