Skip to content

Commit

Permalink
Merge pull request #1367 from ChrisJohnsen/cj/right-click-overlay-che…
Browse files Browse the repository at this point in the history
…ck-focus

RightClickOverlay: check focus before clearing selection_pos
  • Loading branch information
myk002 authored Jan 10, 2025
2 parents edd916d + 6dc147c commit f071f7a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions gui/design.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f071f7a

Please sign in to comment.