diff HotKey.lua @ 72:c48913c5924c

- Dynamic bindings properly update between talent choices, and the hotkey text is also correctly reflected.
author Nenue
date Sat, 07 Jan 2017 12:47:41 -0500
parents 131d9190db6b
children
line wrap: on
line diff
--- a/HotKey.lua	Fri Jan 06 16:21:49 2017 -0500
+++ b/HotKey.lua	Sat Jan 07 12:47:41 2017 -0500
@@ -34,7 +34,6 @@
   ["PLAYER_ENTERING_WORLD"] = {"world","all"},
   ["PET_UI_UPDATE"] = {"pet"},
   ["PLAYER_SPECIALIZATION_CHANGED"] = {"player"},
-  ["PLAYER_TALENTS_UPDATED"] = {"player"},
 }
 
 
@@ -91,14 +90,15 @@
 
 end
 
+
 function hotkey:Update()
   print('--|cFF00FF00ui|r')
   self:player()
   hotkey:pet()
   hotkey:binding()
+  kb.UpdateHotKeys = function() self:Update() end
 end
 
-
 function hotkey:world()
   print('--|cFF00FF00world|r')
   -- needs to be delayed so it isn't fired 50 times at login
@@ -115,7 +115,7 @@
 -- requires all these arguments since non-actionbar buttons don't have all of said methods
 local kprint = (DEVIAN_WORKSPACE and function(...) _G.print('HotKeyUpdate', ...) end) or function() end
 function hotkey:UpdateHotKey(frame, actionType, actionID, hasAction)
-  bindings = kb.GetBindings()
+
 
   if hasAction then
     local indexKey = kb.FormatActionID(actionType, actionID)
@@ -134,7 +134,7 @@
     end
     kprint('  actionKey:', indexKey)
 
-    local binds = bindings[indexKey]
+    local binds = kb.bindings[indexKey]
     if binds and (not frame.HotKey:IsVisible()) then
       kprint(frame:GetName(), '|cFF88FF00'..indexKey..'|r',  hasAction, actionName)
       local bindingsText = kb.BindingString(unpack(binds))