From 0148b98ec66b2d1eef56994f2150abfe8669b5ec Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Sat, 4 Dec 2010 15:25:45 +0000 Subject: [PATCH] Fix group header template click applications There was a problem with some frames (Pitbull party frames, for example) that was causing out of combat bindings to not properly apply. This was due to a weird behaviour of the secure environment system. --- Clique.lua | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Clique.lua b/Clique.lua index ec43d54..3599f67 100755 --- a/Clique.lua +++ b/Clique.lua @@ -75,8 +75,7 @@ function addon:Initialize() -- the unit frame itself. self.header:SetAttribute("clickcast_onenter", [===[ local header = self:GetParent():GetFrameRef("clickcast_header") - local inCombat = header:GetAttribute("inCombat") - header:RunFor(self, header:GetAttribute("setup_onenter"), inCombat) + header:RunFor(self, header:GetAttribute("setup_onenter")) ]===]) -- This snippet is executed from the SecureHandlerEnterLeaveTemplate @@ -84,8 +83,7 @@ function addon:Initialize() -- the unit frame itself. self.header:SetAttribute("clickcast_onleave", [===[ local header = self:GetParent():GetFrameRef("clickcast_header") - local inCombat = header:GetAttribute("inCombat") - header:RunFor(self, header:GetAttribute("setup_onleave"), inCombat) + header:RunFor(self, header:GetAttribute("setup_onleave")) ]===]) local setup, remove = self:GetClickAttributes() @@ -105,7 +103,6 @@ function addon:Initialize() button:SetAttribute("clickcast_onleave", self:GetAttribute("clickcast_onleave")) ccframes[button] = true - local inCombat = self:GetAttribute("inCombat") self:RunFor(button, self:GetAttribute("setup_clicks")) ]===]) @@ -335,14 +332,15 @@ end -- also rather well commented. function addon:GetClickAttributes(global) + -- In these scripts, 'self' should always be the header local bits = { - "local inCombat = self:GetAttribute('inCombat')", + "local inCombat = control:GetAttribute('inCombat')", "local setupbutton = self:GetFrameRef('cliquesetup_button')", "local button = setupbutton or self", } local rembits = { - "local inCombat = self:GetAttribute('inCombat')", + "local inCombat = control:GetAttribute('inCombat')", "local setupbutton = self:GetFrameRef('cliquesetup_button')", "local button = setupbutton or self", } -- 1.7.9.5