diff SkeletonKey/KeySlot.lua @ 21:564015ef0317

- use pet spellbook subtext to categorize dynamic buttons
author Nenue
date Sat, 30 Jul 2016 20:28:15 -0400
parents 67db6b712bf3
children f6dd297cb812
line wrap: on
line diff
--- a/SkeletonKey/KeySlot.lua	Sat Jul 30 19:09:36 2016 -0400
+++ b/SkeletonKey/KeySlot.lua	Sat Jul 30 20:28:15 2016 -0400
@@ -374,9 +374,10 @@
 
       end
     elseif self.isDynamic == 'petaction' then
-      local specialNum =  self.command:match("special(%d)")
-      if specialNum then
-        self.statusText = L('Pet Special %%d'):format(specialNum)
+      local specialType, specialNum =  self.command:match("petaction_([%a%s]+)_(%d)")
+      if specialType and specialNum then
+        print('pet skill|cFF00FF00', specialType..'|r', specialNum)
+        self.statusText = L(specialType..' %%d'):format(specialNum)
       else
         self.statusText = L('Pet Action')
       end
@@ -397,6 +398,8 @@
     if self.actionType == 'spell' then
       self.icon:SetTexture(GetSpellTexture(self.actionID))
     end
+  else
+    self.ignoreTexture:Hide()
   end
 
   if not self.isAvailable then
@@ -503,7 +506,17 @@
       end
     elseif actionType == 'petaction' then
       isDynamic = 'petaction'
-      isAvailable = (kb.PetCache.spellslot and kb.PetCache.spellslot[name])
+      local specialType, specialNum = command:match(actionType..'_([%a%s]+)_(%d)')
+
+      if kb.PetCache.subtext[specialType] and kb.PetCache.subtext[specialType][tonumber(specialNum)] then
+        print('***dynamic pet thign', specialType, specialNum)
+        isAvailable = true
+        --[[ i, spellName, subText, spellID,  texture, specialNum[subText ]]
+        pickupSlot, name, specialType, actionID, icon, specialNum = unpack(kb.PetCache.subtext[specialType][tonumber(specialNum)])
+        pickupBook = BOOKTYPE_PET
+      end
+
+
     elseif actionType == 'macro' then
       if not actionID then
         actionID = GetMacroIndexByName(name)