inhibit _MOUSE_L globally once _MOUSE_L_DOWN is handled

so the _MOUSE_L doesn't bleed through to the underlying viewscreen
develop
Myk Taylor 2023-01-27 13:36:01 -08:00
parent 5b83f30706
commit c6f4a7ee42
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
1 changed files with 5 additions and 3 deletions

@ -693,6 +693,8 @@ end
-- Z-order swapping screen --
-----------------------------
local zscreen_inhibit_mouse_l = false
ZScreen = defclass(ZScreen, Screen)
ZScreen.ATTRS{
initial_pause=true,
@ -754,7 +756,7 @@ function ZScreen:onInput(keys)
if keys._MOUSE_L_DOWN then
-- note we can't clear mouse_lbut here. otherwise we break dragging,
df.global.enabler.mouse_lbut_down = 0
self.inhibit_mouse_l = true
zscreen_inhibit_mouse_l = true
end
if keys._MOUSE_R_DOWN then
df.global.enabler.mouse_rbut_down = 0
@ -773,11 +775,11 @@ function ZScreen:onInput(keys)
df.global.enabler.mouse_rbut = 0
return
else
if self.inhibit_mouse_l then
if zscreen_inhibit_mouse_l then
if keys._MOUSE_L then
return
else
self.inhibit_mouse_l = nil
zscreen_inhibit_mouse_l = false
end
end
local passit = self.pass_pause and keys.D_PAUSE