From b75911e6cfa79adceca0e2d93537a0c584041b0b Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Thu, 14 Apr 2011 10:32:49 +0100 Subject: [PATCH] Use 'secure' registration for RegisterFrame --- Clique.lua | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Clique.lua b/Clique.lua index babd9c1..2b858bb 100755 --- a/Clique.lua +++ b/Clique.lua @@ -105,6 +105,9 @@ function addon:Initialize() -- attribute, which can only be accomplished in a restricted environment. self.header:SetAttribute("clickcast_register", [===[ local button = self:GetAttribute("clickcast_button") + if not button then + button = self:GetFrameRef("clickcast_button") + end -- Export this frame so we can display it in the insecure environment self:SetAttribute("export_register", button) @@ -217,14 +220,20 @@ function addon:RegisterFrame(button) return end - self.ccframes[button] = true - - self:UpdateRegisteredClicks(button) - -- Wrap the OnEnter/OnLeave scripts in order to handle keybindings addon.header:WrapScript(button, "OnEnter", addon.header:GetAttribute("setup_onenter")) addon.header:WrapScript(button, "OnLeave", addon.header:GetAttribute("setup_onleave")) + self.header:SetFrameRef("clickcast_button", button) + self.header:Execute(self.header:GetAttribute("clickcast_register"), button) + do + return + end + + self.ccframes[button] = true + + self:UpdateRegisteredClicks(button) + -- Set the attributes on the frame self.header:SetFrameRef("cliquesetup_button", button) self.header:Execute(self.header:GetAttribute("setup_clicks"), button) -- 1.7.9.5