* Updated to remove some stray globals from Copy/Paste of Blizzard code.
James Whitehead II [01-02-07 - 20:34]
* Updated to remove some stray globals from Copy/Paste of Blizzard code.
diff --git a/CliqueOptions.lua b/CliqueOptions.lua
index 4c20492..f720e7c 100644
--- a/CliqueOptions.lua
+++ b/CliqueOptions.lua
@@ -570,7 +570,7 @@ function Clique:CreateOptionsFrame()
font:SetPoint("TOPRIGHT", -10, -25)
font:SetText(L.CUSTOM_HELP)
- local checkFunc = function() Clique:CustomRadio() end
+ local checkFunc = function(self) Clique:CustomRadio(self) end
self.radio = {}
local buttons = {
@@ -1380,7 +1380,7 @@ local buttonSetup = {
}
function Clique:CustomRadio(button)
- this = button or this
+ local this = button
local anySelected
for k,v in pairs(self.radio) do
@@ -1389,16 +1389,7 @@ function Clique:CustomRadio(button)
end
end
- local entry = buttonSetup[this.type]
- self.customEntry.type = this.type
-
- if this and this.type then
- if not this:GetChecked() then
- self.customEntry.type = nil
- end
- end
-
- if not entry then
+ if not this or not buttonSetup[this.type] then
CliqueCustomHelpText:SetText(L.CUSTOM_HELP)
CliqueCustomArg1:Hide()
CliqueCustomArg2:Hide()
@@ -1408,6 +1399,15 @@ function Clique:CustomRadio(button)
CliqueCustomButtonBinding:SetText("Set Click Binding")
return
end
+
+ local entry = buttonSetup[this.type]
+ self.customEntry.type = this.type
+
+ if this and this.type then
+ if not this:GetChecked() then
+ self.customEntry.type = nil
+ end
+ end
-- Clear any open arguments
CliqueCustomArg1:SetText("")
@@ -1447,6 +1447,7 @@ function Clique:UpdateIconFrame()
local MACRO_ICON_ROW_HEIGHT = 36;
local macroPopupOffset = FauxScrollFrame_GetOffset(CliqueIconScrollFrame);
local numMacroIcons = GetNumMacroIcons();
+ local macroPopupIcon,macroPopupButton
-- Icon list
for i=1, NUM_MACRO_ICONS_SHOWN do
@@ -1457,7 +1458,7 @@ function Clique:UpdateIconFrame()
macroPopupButton.icon = macroPopupIcon
end
- index = (macroPopupOffset * NUM_ICONS_PER_ROW) + i;
+ local index = (macroPopupOffset * NUM_ICONS_PER_ROW) + i;
if ( index <= numMacroIcons ) then
macroPopupIcon:SetTexture(GetMacroIconInfo(index));
macroPopupButton:Show();