| 909 | } |
| 910 | |
| 911 | void 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 | |
| 935 | int dfhack_lua_viewscreen::do_render(lua_State *L) |
| 936 | { |
no test coverage detected