From d9c49b0c778cc2d522c4a13ffd37d881b92b2e83 Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Mon, 2 Nov 2009 15:01:09 +0000 Subject: [PATCH] Added support for extra mouse buttons --- Clique.lua | 14 -------------- CliqueUtils.lua | 20 ++++++++------------ 2 files changed, 8 insertions(+), 26 deletions(-) diff --git a/Clique.lua b/Clique.lua index cd01189..0b758d4 100644 --- a/Clique.lua +++ b/Clique.lua @@ -527,20 +527,6 @@ function Clique:DeleteAction(entry) end end -local mods = {"Shift", "Ctrl", "Alt"} -local buttonsraw = {1,2,3,4,5} -local buttonmods = {"-help", "-harm"} - -local buttons = {} -for idx,button in pairs(buttonsraw) do - for k,v in pairs(buttonmods) do - table.insert(buttons, v..button) - end -end -for k,v in pairs(buttonsraw) do - table.insert(buttons, v) -end - function Clique:ShowAttributes() self:Print("Enabled enhanced debugging.") PlayerFrame:SetScript("OnAttributeChanged", function(...) self:Print(...) end) diff --git a/CliqueUtils.lua b/CliqueUtils.lua index e508152..a2f49a7 100644 --- a/CliqueUtils.lua +++ b/CliqueUtils.lua @@ -1,15 +1,12 @@ -local buttonMap = { +local buttonMap = setmetatable({ [1] = "LeftButton", [2] = "RightButton", [3] = "MiddleButton", - [4] = "Button4", - [5] = "Button5", - LeftButton = 1, - RightButton = 2, - MiddleButton = 3, - Button4 = 4, - Button5 = 5, -} +}, { + __index = function(t, k) + return "Button" .. k + end +}) function Clique:GetModifierText() local modifier = "" @@ -28,8 +25,7 @@ function Clique:GetModifierText() end function Clique:GetButtonNumber(button) - if not button then return "" end - return buttonMap[arg1] or "" + return SecureButton_GetButtonSuffix(button) end function Clique:GetButtonText(num) @@ -48,4 +44,4 @@ function Clique:CheckBinding(key) return v end end -end \ No newline at end of file +end -- 1.7.9.5