diff SkeletonKey/Events.lua @ 15:32d64e42ec9b

- resolve pet bar actions for binding slots - detect type of petaction (can be spell, stance, or 'PETACTION') - keep track of displayed pet ability slots and update them alongside pet cache refreshes
author Nenue
date Fri, 29 Jul 2016 03:27:15 -0400
parents 8f8917d111c9
children 500f9b2bd9ac
line wrap: on
line diff
--- a/SkeletonKey/Events.lua	Thu Jul 28 23:58:53 2016 -0400
+++ b/SkeletonKey/Events.lua	Fri Jul 29 03:27:15 2016 -0400
@@ -4,14 +4,16 @@
 -- %file-revision%
 -- Event handlers, and the init block that sets them up; nothing else should be here
 
-local kb = LibStub("LibKraken").register(KeyBinder)
+local kb, print = LibStub("LibKraken").register(KeyBinder)
 
 kb.init = function()
   kb:RegisterEvent('PLAYER_ENTERING_WORLD')
   kb:RegisterEvent('UPDATE_MACROS')
   kb:RegisterUnitEvent('PLAYER_SPECIALIZATION_CHANGED', 'player', 'pet')
   kb:RegisterUnitEvent('UNIT_PORTRAIT_UPDATE', 'player', 'pet')
+  kb:RegisterUnitEvent('SPELLS_CHANGED')
   kb:RegisterUnitEvent('TALENT_UPDATE', 'player', 'pet')
+
   kb:RegisterEvent('PLAYER_REGEN_DISABLED')
   kb:RegisterEvent('PLAYER_REGEN_ENABLED')
 end
@@ -52,10 +54,8 @@
   return true
 end
 
-kb.UNIT_PET = function(self, event, unit)
-  if unit ~= 'player' then
-    return
-  end
-
+-- only need to respond to this for pet actions
+kb.SPELLS_CHANGED = function(self, event, unit)
+  print('|cFFFF0088'.. event..'|r', unit)
   kb.UpdatePetInfo()
 end
\ No newline at end of file