From 1168e266d02f17102ec412861e475d45515fba0f Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Tue, 12 Oct 2010 14:13:10 +0100 Subject: [PATCH] Fix a number of stray globals --- BindConfig.lua | 4 ---- Clique.lua | 4 ++-- Utils.lua | 14 +++++++------- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/BindConfig.lua b/BindConfig.lua index 7a4d8fd..91a90ab 100755 --- a/BindConfig.lua +++ b/BindConfig.lua @@ -108,10 +108,6 @@ function CliqueConfig:EnableSpellbookButtons() if self.page1:IsVisible() and SpellBookFrame:IsVisible() then enabled = true - self:SetNotification("Your spellbook is open. You can mouse over a spell in your spellbook and click or press a key conbination to add it to your bindings configuration") - else - method = false - self:ClearNotification() end if self.spellbookButtons then diff --git a/Clique.lua b/Clique.lua index fc989a8..e4775e3 100755 --- a/Clique.lua +++ b/Clique.lua @@ -210,12 +210,12 @@ function addon:InitializeBindingProfile() self.bindings = db.bindings[addon.settings.profileKey] end -function ATTR(prefix, attr, suffix, value) +local function ATTR(prefix, attr, suffix, value) local fmt = [[button:SetAttribute("%s%s%s%s%s", %q)]] return fmt:format(prefix, #prefix > 0 and "-" or "", attr, tonumber(suffix) and "" or "-", suffix, value) end -function REMATTR(prefix, attr, suffix, value) +local function REMATTR(prefix, attr, suffix, value) local fmt = [[button:SetAttribute("%s%s%s%s%s", nil)]] return fmt:format(prefix, #prefix > 0 and "-" or "", attr, tonumber(suffix) and "" or "-", suffix) end diff --git a/Utils.lua b/Utils.lua index 1465f8a..6178f28 100644 --- a/Utils.lua +++ b/Utils.lua @@ -7,9 +7,9 @@ local L = addon.L -- split - Whether or not to split the modifier keys into left and right components function addon:GetPrefixString(split) - shift, lshift, rshift = IsShiftKeyDown(), IsLeftShiftKeyDown(), IsRightShiftKeyDown() - ctrl, lctrl, rctrl = IsControlKeyDown(), IsLeftControlKeyDown(), IsRightControlKeyDown() - alt, lalt, ralt = IsAltKeyDown(), IsLeftAltKeyDown() IsRightAltKeyDown() + local shift, lshift, rshift = IsShiftKeyDown(), IsLeftShiftKeyDown(), IsRightShiftKeyDown() + local ctrl, lctrl, rctrl = IsControlKeyDown(), IsLeftControlKeyDown(), IsRightControlKeyDown() + local alt, lalt, ralt = IsAltKeyDown(), IsLeftAltKeyDown() IsRightAltKeyDown() if not extended then shift = shift or lshift or rshift @@ -130,8 +130,8 @@ local binMap = { } function addon:GetBinaryBindingKey(binding) - ret = {"0", "0", "0", "0", "0", "0", "0", "0", "0"} - splits = {strsplit("-", binding.key)} + local ret = {"0", "0", "0", "0", "0", "0", "0", "0", "0"} + local splits = {strsplit("-", binding.key)} for idx, modifier in ipairs(splits) do local bit = binMap[modifier] if bit then @@ -143,7 +143,7 @@ function addon:GetBinaryBindingKey(binding) return table.concat(ret) end -invalidKeys = { +local invalidKeys = { ["UNKNOWN"] = true, ["LSHIFT"] = true, ["RSHIFT"] = true, @@ -168,7 +168,7 @@ function addon:GetCapturedKey(key) elseif key == "MiddleButton" then key = "BUTTON3" else - buttonNum = key:match("Button(%d+)") + local buttonNum = key:match("Button(%d+)") if buttonNum and tonumber(buttonNum) <= 31 then key = "BUTTON" .. buttonNum end -- 1.7.9.5