Quantcast

Bind spells by spell id, see if this resolves the Blizzard issues

James Whitehead II [10-22-10 - 09:11]
Bind spells by spell id, see if this resolves the Blizzard issues
Filename
BindConfig.lua
Clique.lua
Utils.lua
diff --git a/BindConfig.lua b/BindConfig.lua
index 227a3fb..2212f3f 100755
--- a/BindConfig.lua
+++ b/BindConfig.lua
@@ -173,6 +173,7 @@ function CliqueConfig:Spellbook_OnBinding(button, key)
     end

     local slot = SpellBook_GetSpellBookSlot(button:GetParent());
+    local stype, id = GetSpellBookItemInfo(slot, SpellBookFrame.bookType)
     local name, subtype = GetSpellBookItemName(slot, SpellBookFrame.bookType)
     local texture = GetSpellBookItemTexture(slot, SpellBookFrame.bookType)

@@ -184,7 +185,7 @@ function CliqueConfig:Spellbook_OnBinding(button, key)
     local succ, err = addon:AddBinding{
         key = key,
         type = "spell",
-        spell = name,
+        spell = id,
         icon = texture
     }

diff --git a/Clique.lua b/Clique.lua
index 4a8df6f..33faac4 100755
--- a/Clique.lua
+++ b/Clique.lua
@@ -476,6 +476,10 @@ function addon:AddBinding(entry)
         entry.sets = {default = true}
     end

+    if entry.type == "spell" and tonumber(entry.spell) then
+        entry.spellName = GetSpellInfo(entry.spell)
+    end
+
     table.insert(self.bindings, entry)
     self:UpdateAttributes()
     return true
diff --git a/Utils.lua b/Utils.lua
index 8d9dc96..e3ea6b4 100644
--- a/Utils.lua
+++ b/Utils.lua
@@ -154,7 +154,11 @@ function addon:GetBindingActionText(btype, binding)
     elseif btype == "target" then
         return L["Target clicked unit"]
     elseif btype == "spell" then
-        return L["Cast %s"]:format(tostring(binding.spell))
+        local name = binding.spell
+        if tonumber(binding.spell) then
+            name = GetSpellInfo(binding.spell) or "Unknown"
+        end
+        return L["Cast %s"]:format(tostring(name))
     elseif btype == "macro" and type(binding) == "table" then
         return L["Run macro '%s'"]:format(tostring(binding.macrotext))
     elseif btype == "macro" then