Skip to content
Merged
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 @@ -74,6 +74,7 @@ Template for new versions:
- `autodump`: ``destroy`` no longer leaves the contents of destroyed containers in limbo or crashes when destroying unit-held items
- `buildingplan`: fix roller material estimate asking for one chain per tile instead of one chain total
- `buildingplan`: fix "Unlink all" only unlinking some mechanisms (or crashing) when freeing mechanisms from the building
- `overlay`: overlay hotkeys no longer steal typed characters while the game is capturing text input, e.g. when renaming a building
- `sort`: fix the Places/Workshops and task searches missing workshops by their current display names (e.g. "Stoneworker's Workshop", "Screw Press")
- `stocks`: overlay now resets scroll position when collapsing categories so the item list is no longer left blank and unscrollable
- `strangemood`: updated to match behavior of current DF version
Expand Down
18 changes: 18 additions & 0 deletions plugins/lua/overlay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,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