|
|
|
@ -78,7 +78,6 @@ namespace DFHack {
|
|
|
|
|
DBG_DECLARE(core, screen, DebugCategory::LINFO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Screen painting API.
|
|
|
|
|
*/
|
|
|
|
@ -586,6 +585,17 @@ void Hide::merge() {
|
|
|
|
|
}
|
|
|
|
|
} }
|
|
|
|
|
|
|
|
|
|
std::set<df::interface_key> Screen::add_text_keys(const std::set<df::interface_key>& keys) {
|
|
|
|
|
std::set<df::interface_key> combined_keys(keys);
|
|
|
|
|
if (df::global::enabler->last_text_input[0]) {
|
|
|
|
|
char c = df::global::enabler->last_text_input[0];
|
|
|
|
|
df::interface_key key = charToKey(c);
|
|
|
|
|
DEBUG(screen).print("adding character %c as interface key %ld\n", c, key);
|
|
|
|
|
combined_keys.emplace(key);
|
|
|
|
|
}
|
|
|
|
|
return combined_keys;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string Screen::getKeyDisplay(df::interface_key key)
|
|
|
|
|
{
|
|
|
|
|
if (enabler)
|
|
|
|
@ -940,7 +950,7 @@ int dfhack_lua_viewscreen::do_input(lua_State *L)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lua_pushvalue(L, -2);
|
|
|
|
|
Lua::PushInterfaceKeys(L, *keys);
|
|
|
|
|
Lua::PushInterfaceKeys(L, Screen::add_text_keys(*keys));
|
|
|
|
|
|
|
|
|
|
lua_call(L, 2, 0);
|
|
|
|
|
self->update_focus(L, -1);
|
|
|
|
@ -1023,6 +1033,7 @@ void dfhack_lua_viewscreen::feed(std::set<df::interface_key> *keys)
|
|
|
|
|
|
|
|
|
|
lua_pushlightuserdata(Lua::Core::State, keys);
|
|
|
|
|
safe_call_lua(do_input, 1, 0);
|
|
|
|
|
df::global::enabler->last_text_input[0] = '\0';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void dfhack_lua_viewscreen::onShow()
|
|
|
|
|