add "anywhere" keybinding guard

develop
myk002 2022-11-09 14:32:09 -08:00
parent ccd43f1710
commit 0344595e4e
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
3 changed files with 6 additions and 0 deletions

@ -70,6 +70,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
- `spectate`: improved documentation of features and functionality - `spectate`: improved documentation of features and functionality
## API ## API
- ``Gui::anywhere_hotkey``: for plugin commands bound to keybindings that can be invoked on any screen
- ``Lua::PushInterfaceKeys()``: transforms viewscreen ``feed()`` keys into something that can be interpreted by lua-based widgets - ``Lua::PushInterfaceKeys()``: transforms viewscreen ``feed()`` keys into something that can be interpreted by lua-based widgets
- ``Lua::Push()``: now handles maps with otherwise supported keys and values - ``Lua::Push()``: now handles maps with otherwise supported keys and values
- Constructions module: added ``insert()`` to insert constructions into the game's sorted list. - Constructions module: added ``insert()`` to insert constructions into the game's sorted list.

@ -301,6 +301,7 @@ namespace DFHack
{ {
// Predefined hotkey guards // Predefined hotkey guards
DFHACK_EXPORT bool default_hotkey(df::viewscreen *); DFHACK_EXPORT bool default_hotkey(df::viewscreen *);
DFHACK_EXPORT bool anywhere_hotkey(df::viewscreen *);
DFHACK_EXPORT bool dwarfmode_hotkey(df::viewscreen *); DFHACK_EXPORT bool dwarfmode_hotkey(df::viewscreen *);
DFHACK_EXPORT bool cursor_hotkey(df::viewscreen *); DFHACK_EXPORT bool cursor_hotkey(df::viewscreen *);
} }

@ -630,6 +630,10 @@ bool Gui::default_hotkey(df::viewscreen *top)
return false; return false;
} }
bool Gui::anywhere_hotkey(df::viewscreen *) {
return true;
}
bool Gui::dwarfmode_hotkey(df::viewscreen *top) bool Gui::dwarfmode_hotkey(df::viewscreen *top)
{ {
// Require the main dwarf mode screen // Require the main dwarf mode screen