From 5e745df3f9263f55f4ae54b66936124e46190917 Mon Sep 17 00:00:00 2001 From: Chris Johnsen Date: Wed, 8 Jan 2025 21:51:45 -0600 Subject: [PATCH 1/2] RightClickOverlay: check focus before clearing selection_pos Check for the relevant focus before clearing .selection_pos. Otherwise, the overlay will erroneously consume a LEAVESCREEN or right-click input in the other modes when .selection_pos.x >= 0. Note: .selection_pos is (0,0,0) after DF starts from scratch. --- gui/design.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gui/design.lua b/gui/design.lua index 22666d83f..2279ec005 100644 --- a/gui/design.lua +++ b/gui/design.lua @@ -143,9 +143,13 @@ RightClickOverlay.ATTRS{ function RightClickOverlay:onInput(keys) if keys._MOUSE_R or keys.LEAVESCREEN then -- building mode - if uibs.selection_pos.x >= 0 then - uibs.selection_pos:clear() - return true + if dfhack.gui.matchFocusString('dwarfmode/Building/Placement', + dfhack.gui.getDFViewscreen(true)) + then + if uibs.selection_pos.x >= 0 then + uibs.selection_pos:clear() + return true + end -- all other modes elseif selection_rect.start_x >= 0 then selection_rect.start_x = -30000 From 6dc147ce70c24da2d7fe05c77b3fdaa90fa5257d Mon Sep 17 00:00:00 2001 From: Chris Johnsen Date: Thu, 9 Jan 2025 18:44:35 -0600 Subject: [PATCH 2/2] changelog for RightClickOverlay focus check --- changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.txt b/changelog.txt index 7d91af061..1ab83703d 100644 --- a/changelog.txt +++ b/changelog.txt @@ -39,6 +39,7 @@ Template for new versions: - `fix/dry-buckets`: don't empty buckets for wells that are actively in use - `gui/unit-info-viewer`: skill progress bars now show correct XP thresholds for skills past Legendary+5 - `caravan`: no longer incorrectly identify wood-based plant items and plant-based soaps as being ethically unsuitable for trading with the elves +- `gui/design`: don't require an extra cancel input to exit or cancel designations ## Misc Improvements - `immortal-cravings`: goblins and other naturally non-eating/non-drinking races will now also satisfy their needs for eating and drinking