changeset 29:bb160c04de88

- update matching patterns used for picking up profession keybinds
author Nenue
date Fri, 05 Aug 2016 12:25:18 -0400
parents 4d1c0a813411
children b0e4d04d428a
files SkeletonKey/HotKey.lua SkeletonKey/KeyButton.lua
diffstat 2 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/SkeletonKey/HotKey.lua	Tue Aug 02 12:33:57 2016 -0400
+++ b/SkeletonKey/HotKey.lua	Fri Aug 05 12:25:18 2016 -0400
@@ -152,7 +152,10 @@
   print(actionSlots[slot], event, slot, GetActionInfo(slot))
   --print(GetActionButtonForID(slot))
   local atype, aid = GetActionInfo(slot)
+  if actionSlots[slot] then
   hotkey.UpdateSkeletonKeyText(actionSlots[slot], atype, aid, HasAction(slot))
+  end
+
 end
 
 hotkey.player = function()
--- a/SkeletonKey/KeyButton.lua	Tue Aug 02 12:33:57 2016 -0400
+++ b/SkeletonKey/KeyButton.lua	Fri Aug 05 12:25:18 2016 -0400
@@ -387,15 +387,17 @@
     end
 
     if self.isDynamic == 'profession'  then
-      local profText = (self.spellNum == 1) and TRADE_SKILLS or (BUTTON_HEADERS[self.profIndex] or GetProfessionInfo(self.profIndex))
       if self.isAvailable then
+
+        local profText = (self.spellNum == 1) and TRADE_SKILLS or (BUTTON_HEADERS[self.profIndex] or GetProfessionInfo(self.profIndex))
         print(self.profIndex, 'spnum', type(self.spellNum), (self.spellNum == 1))
 
-        self.statusText = '|cFFFFFF00'..profText..'|r'
+        self.statusText = '|cFFFFFF00'..tostring(profText)..'|r'
         self.bindingText = kb.BindingString(GetBindingKey(self.command))
       else
-        self.statusText = '|cFFFF4400'..profText..'|r'
-        self.actionName = '(need to train profession #'..self.profNum..')'
+
+        self.statusText = '|cFFFF4400Profession|r'
+        self.actionName = '(#'..self.professionNum..')'
         self.bindingText ='?'
       end
     elseif self.isDynamic == 'talent' then