Skip to content

Commit

Permalink
align gui/sandbox with mouse button changes
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Oct 1, 2023
1 parent 43a22b3 commit 8259d95
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions gui/sandbox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ function Sandbox:init()
key='CUSTOM_SHIFT_U',
label="Spawn unit",
on_activate=function()
df.global.enabler.mouse_lbut_down = 0
clear_arena_action()
gui.markMouseClicksHandled{_MOUSE_L=true}
view:sendInputToParent{ARENA_CREATE_CREATURE=true}
df.global.game.main_interface.arena_unit.editing_filter = true
end,
Expand Down Expand Up @@ -162,8 +162,8 @@ function Sandbox:init()
key='CUSTOM_SHIFT_T',
label="Spawn tree",
on_activate=function()
df.global.enabler.mouse_lbut_down = 0
clear_arena_action()
gui.markMouseClicksHandled{_MOUSE_L=true}
view:sendInputToParent{ARENA_CREATE_TREE=true}
df.global.game.main_interface.arena_tree.editing_filter = true
end,
Expand Down Expand Up @@ -204,7 +204,7 @@ function Sandbox:onInput(keys)
if Sandbox.super.onInput(self, keys) then
return true
end
if keys._MOUSE_L_DOWN then
if keys._MOUSE_L then
if self:getMouseFramePos() then return true end
for _,mask_panel in ipairs(self.interface_masks) do
if mask_panel:getMousePos() then return true end
Expand Down Expand Up @@ -251,10 +251,6 @@ InterfaceMask.ATTRS{
frame_background=gui.TRANSPARENT_PEN,
}

function InterfaceMask:onInput(keys)
return keys._MOUSE_L_DOWN and self:getMousePos()
end

---------------------
-- SandboxScreen
--
Expand Down

0 comments on commit 8259d95

Please sign in to comment.