overlays: don't steal keys while renaming a building - #1624
Open
Alistair-Afton wants to merge 2 commits into
Open
Alistair-Afton wants to merge 2 commits into
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
Member
|
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.
Author
|
Done. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.