From 504e8c8c0962a169b51566ea32ee9456d8238664 Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Sun, 5 Sep 2010 09:56:39 +0000 Subject: [PATCH] Fix for 'this' and 'self', thanks to sylvanaar --- Clique.xml | 16 +++++++--------- CliqueOptions.lua | 10 ++++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Clique.xml b/Clique.xml index 92b29f6..fdc8115 100644 --- a/Clique.xml +++ b/Clique.xml @@ -73,18 +73,16 @@ - local scrollBar = getglobal(this:GetParent():GetName().."ScrollBar") - this:GetParent():UpdateScrollChildRect(); - local min; - local max; - min, max = scrollBar:GetMinMaxValues(); - if ( max > 0 and (this.max ~= max) ) then - this.max = max; - scrollBar:SetValue(max); + local scrollBar = _G[self:GetParent():GetName() .. "ScrollBar") + self:GetParent():UpdateScrollChildRect() + local min, max = scrollBar:GetMinMaxValues(); + if max > 0 and self.max ~= max then + this.max = max; + scrollBar:SetValue(max); end - this:ClearFocus(); + self:ClearFocus(); diff --git a/CliqueOptions.lua b/CliqueOptions.lua index 001f86a..aa3552b 100644 --- a/CliqueOptions.lua +++ b/CliqueOptions.lua @@ -719,7 +719,9 @@ function Clique:CreateOptionsFrame() button:SetWidth(175) button:SetText("Set Click Binding") button:SetPoint("TOP", CliqueCustomHelpText, "BOTTOM", 40, -10) - button:SetScript("OnClick", function(self) Clique:CustomBinding_OnClick(self) end ) + button:SetScript("OnClick", function(self, ...) + Clique:CustomBinding_OnClick(self, ...) + end) button:RegisterForClicks("AnyUp") -- Button for icon selection @@ -1403,10 +1405,10 @@ function Clique:DropDown_OnShow(frame) Clique:ListScrollUpdate() end -function Clique:CustomBinding_OnClick(frame) +function Clique:CustomBinding_OnClick(frame, ...) -- This handles the binding click local mod = self:GetModifierText() - local button = arg1 + local button = ... if self.editSet == self.clicksets[L.CLICKSET_HARMFUL] then button = string.format("%s%d", "harmbutton", self:GetButtonNumber(button)) @@ -1418,7 +1420,7 @@ function Clique:CustomBinding_OnClick(frame) self.customEntry.modifier = mod self.customEntry.button = button - frame:SetText(string.format("%s%s", mod, arg1)) + frame:SetText(string.format("%s%s", mod, button)) end local buttonSetup = { -- 1.7.9.5