From 4dbc7afcc5d4ba8a0223315429d3b7ec75c4753d Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Thu, 6 Sep 2012 09:32:54 +0200 Subject: [PATCH] Don't apply wrong-spec bindings Previously, if you were in your primary spec and you had a spell that was bound to secondary spec only, the binding would still be active (although it would not do anything). Simple test: 1. Bind 'moonfire' to 1 on hovercast,secspec 2. Verify it works 3. Change to primary spec 4. You will be unable to use your '1' normal binding --- Clique.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Clique.lua b/Clique.lua index 52d17c7..25fc798 100755 --- a/Clique.lua +++ b/Clique.lua @@ -354,6 +354,20 @@ local function correctSpec(entry, currentSpec) return true end +local function getEntryString(entry) + local bits = {} + bits[#bits+1] = "type" + bits[#bits+1] = tostring(entry.type) + + if entry.type == "spell" then + bits[#bits+1] = tostring(entry.spell) + elseif entry.type == "macro" and entry.macrotext then + bits[#bits+1] = tostring(entry.macrotext) + end + + return table.concat(bits, ":") +end + -- This function takes a single argument indicating if the attributes being -- computed are for the special 'global' button used by Clique. It then -- computes the set of attributes necessary for the player's bindings to be @@ -579,7 +593,7 @@ function addon:GetBindingAttributes(global) for idx, entry in ipairs(self.bindings) do if entry.key then - if shouldApply(global, entry) then + if shouldApply(global, entry) and correctSpec(entry, GetActiveSpecGroup()) then if global then -- Allow for the re-binding of clicks and keys, except for -- unmodified left/right-click -- 1.7.9.5