Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ Template for new versions:
- `timestream`: deal properly with units who have breathing difficulties
- `stocks`: overlay now resets scroll position when collapsing categories so the item list is no longer left blank and unscrollable
- Fixed persistent site data API (``dfhack.persistent.saveSiteData``/``getSiteData``) failing on newly reclaimed fortresses until the first save
- `overlay`: overlay hotkeys no longer steal typed characters while the game is capturing text input, e.g. when renaming a building

## Misc Improvements
- Added ``Coord2d`` and ``Coord3d`` C++ templates, providing a standard set operations for 2-tuples and 3-tuples of any numeric type
Expand Down
18 changes: 18 additions & 0 deletions plugins/lua/overlay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,25 @@ local function _feed_viewscreen_widgets(vs_name, vs, keys)
return false
end

-- when the native UI is capturing text input (renaming a building, editing a
-- workshop job filter, etc.), overlay widgets must not consume keys, since
-- their bound hotkeys would otherwise steal typed characters (#5764)
local function is_native_text_entry_active()
local mi = df.global.game.main_interface
local vs = mi.view_sheets
return mi.entering_building_name or
vs.building_entering_nickname or
vs.unit_overview_entering_nickname or
vs.unit_overview_entering_profession_nickname or
vs.entering_building_job_filter or
vs.entering_gen_work_order_num or
vs.entering_wq_number
end

function feed_viewscreen_widgets(vs_name, vs, keys)
if is_native_text_entry_active() then
return false
end
if not _feed_viewscreen_widgets(vs_name, vs, keys) and
not _feed_viewscreen_widgets('all', nil, keys) then
return false
Expand Down
Loading