fix mouse clicks bleeding through overlay panel

develop
Myk Taylor 2023-12-31 01:59:49 -08:00
parent a970161585
commit 2ff6676122
No known key found for this signature in database
2 changed files with 8 additions and 1 deletions

@ -57,6 +57,7 @@ Template for new versions:
- `sort`: search and sort for the "choose unit to elevate to the barony" screen. units are sorted by the number of item preferences they have and the units are annotated with the items that they have preferences for - `sort`: search and sort for the "choose unit to elevate to the barony" screen. units are sorted by the number of item preferences they have and the units are annotated with the items that they have preferences for
## Fixes ## Fixes
- `sort`: fix mouse clicks falling through the squad assignment overlay panel when clicking on the panel but not on a clickable widget
- `sort`: fix potential crash when removing jobs directly from the Tasks info screen - `sort`: fix potential crash when removing jobs directly from the Tasks info screen
## Misc Improvements ## Misc Improvements

@ -1179,7 +1179,8 @@ function SquadAssignmentOverlay:onInput(keys)
-- if any click is made outside of our window, we may need to refresh our list -- if any click is made outside of our window, we may need to refresh our list
self.dirty = true self.dirty = true
end end
return SquadAssignmentOverlay.super.onInput(self, keys) return SquadAssignmentOverlay.super.onInput(self, keys) or
(keys._MOUSE_L and self:getMouseFramePos())
end end
function SquadAssignmentOverlay:onRenderFrame(dc, frame_rect) function SquadAssignmentOverlay:onRenderFrame(dc, frame_rect)
@ -1287,6 +1288,11 @@ function SquadAnnotationOverlay:init()
end end
end end
function SquadAnnotationOverlay:onInput(keys)
return SquadAnnotationOverlay.super.onInput(self, keys) or
(keys._MOUSE_L and self:getMouseFramePos())
end
OVERLAY_WIDGETS = { OVERLAY_WIDGETS = {
squad_assignment=SquadAssignmentOverlay, squad_assignment=SquadAssignmentOverlay,
squad_annotation=SquadAnnotationOverlay, squad_annotation=SquadAnnotationOverlay,