overlays: don't steal keys while renaming a building - #1624
Alistair-Afton wants to merge 2 commits into
Conversation
The pressure plate, gear assembly, track stop, and roller overlays consumed their hotkeys even while the building nickname field was open, so typing characters like x, r, or v changed settings instead of entering text. Skip input handling while view_sheets.building_entering_nickname is set, matching the guard already used by the orders skill restriction overlay. Fixes DFHack/dfhack#5764
|
I'd probably do something like Then it's easy enough to do |
Suggested by Bumber64: bind df.global.game.main_interface.view_sheets once and check building_entering_nickname directly instead of a wrapper function.
|
Done. |
|
Superseded by DFHack/dfhack#5951, which fixes this at the framework level: overlay input dispatch is skipped entirely while a native text-entry flag is set, covering these overlays plus all others (e.g. the lever mechanism overlay's g/m keys, zone cage/chain overlays) without per-overlay guards. |
Summary
Fixes DFHack/dfhack#5764
The
machine-togglepressure plate / gear assembly overlays and thetrackstoptrack stop / roller overlays consumed their hotkeys (x, shift+x, shift+r, shift+v, shift+t, shift+b) even while the building nickname field was open, so typing those characters changed settings instead of entering text.Each overlay's
onInputnow skips event handling whileview_sheets.building_entering_nicknameis set, matching the guard already used by the orders skill restriction overlay.Testing
In a live fort, instantiated
PlateOverlayand fed it aCUSTOM_Xkeypress with a stubbed super:building_entering_nickname = true: key not consumed by the overlay (falls through to the rename field).building_entering_nickname = false: normal handling resumes.