fix hidden buttons register clicks
This commit is contained in:
parent
187b8b3c74
commit
aecc9acde0
@ -11,8 +11,6 @@ function uiElement:update(dt) end
|
||||
function uiElement:draw() end
|
||||
|
||||
function uiElement:hitTest(screenX, screenY)
|
||||
local r, g, b, a = love.graphics.getColor()
|
||||
if a == 0 then return false end
|
||||
local lx, ly = self.transform:inverseTransformPoint(screenX, screenY)
|
||||
return self.bounds:hasPoint(lx, ly)
|
||||
end
|
||||
|
||||
@ -71,6 +71,7 @@ function skillRow.new(characterId)
|
||||
for i, spell in ipairs(behavior.spellbook) do
|
||||
local skb = skillButton:new { icon = spell.tag }
|
||||
skb.onClick = function()
|
||||
if t.state ~= "idle" then return end
|
||||
skb.selected = not skb.selected
|
||||
if t.selected then t.selected.selected = false end
|
||||
t.selected = skb
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user