Skip to content

Commit 55c9515

Browse files
authored
Introduce a 1 frame "cooldown" between clicks (see #1)
1 parent ec72dad commit 55c9515

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

main.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,15 +362,18 @@ end
362362

363363
function DialogKey:SetClickbuttonBinding(frame, key)
364364
if InCombatLockdown() then return end
365+
self.globalCooldown = true
365366
self.frame:SetAttribute("clickbutton", frame)
366367
self:SetOverrideBindings(self.frame, self.frame:GetName(), {key})
368+
RunNextFrame(function() self.globalCooldown = false end)
367369

368370
-- just in case something goes horribly wrong, we do NOT want to get the user stuck in a situation where the keyboard stops working
369371
RunNextFrame(function() self:ClearOverrideBindings(self.frame) end)
370372
end
371373

372374
function DialogKey:HandleKey(key)
373375
if not InCombatLockdown() then self.frame:SetPropagateKeyboardInput(true) end
376+
if self.globalCooldown then return end
374377
local doAction = (key == self.db.keys[1] or key == self.db.keys[2])
375378
local keynum = doAction and 1 or tonumber(key)
376379
if key == "0" then

0 commit comments

Comments
 (0)