From cc587411a6ff5fa0910adba70797c87337115571 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 13 Aug 2009 18:00:10 +0200 Subject: [PATCH] Avoid even more taint in the actionbutton onevent to potentially stop breaking the totem bar. --- ActionButton.lua | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/ActionButton.lua b/ActionButton.lua index a4d6a80..b5582e0 100644 --- a/ActionButton.lua +++ b/ActionButton.lua @@ -351,17 +351,12 @@ function Button:ToggleButtonElements() end end -orig_ActionButton_UpdateHotkeys = ActionButton_UpdateHotkeys -ActionButton_UpdateHotkeys = function(self, ...) - local name = self:GetName() - if name and name:find("^BT4Button") then - if self.BT4init then - self:UpdateHotkeys() - end - else - orig_ActionButton_UpdateHotkeys(self, ...) - end -end +hooksecurefunc("ActionButton_UpdateHotkeys", function(self, ...) + local parent = self:GetParent() + if not self.BT4init or not parent.BT4BarType then return end + + self:UpdateHotkeys() +end) function Button:UpdateHotkeys() local key = self:GetHotkey() or ""