Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RightClickOverlay: check focus before clearing selection_pos #1367

Merged
merged 2 commits into from
Jan 10, 2025
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 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
Loading