Nenue@6: -- KrakTool Nenue@6: -- Events.lua Nenue@6: -- Created: 7/24/2016 11:10 PM Nenue@6: -- %file-revision% Nenue@6: -- Event handlers, and the init block that sets them up; nothing else should be here Nenue@6: Nenue@15: local kb, print = LibStub("LibKraken").register(KeyBinder) Nenue@6: Nenue@6: kb.init = function() Nenue@6: kb:RegisterEvent('PLAYER_ENTERING_WORLD') Nenue@6: kb:RegisterEvent('UPDATE_MACROS') Nenue@6: kb:RegisterUnitEvent('PLAYER_SPECIALIZATION_CHANGED', 'player', 'pet') Nenue@6: kb:RegisterUnitEvent('UNIT_PORTRAIT_UPDATE', 'player', 'pet') Nenue@15: kb:RegisterUnitEvent('SPELLS_CHANGED') Nenue@6: kb:RegisterUnitEvent('TALENT_UPDATE', 'player', 'pet') Nenue@15: Nenue@6: kb:RegisterEvent('PLAYER_REGEN_DISABLED') Nenue@6: kb:RegisterEvent('PLAYER_REGEN_ENABLED') Nenue@6: end Nenue@6: Nenue@6: kb.event = function(event, ...) Nenue@6: if kb[event] then Nenue@6: kb[event](kb, event, ...) Nenue@6: end Nenue@6: end Nenue@6: Nenue@6: kb.PLAYER_REGEN_DISABLED = function() Nenue@6: kb.ui() Nenue@6: end Nenue@6: Nenue@6: kb.UNIT_PORTRAIT_UPDATE = function() Nenue@12: if KeyBinderCharacterTab then Nenue@12: SetPortraitTexture(KeyBinderCharacterTab.icon, 'player') Nenue@12: end Nenue@6: end Nenue@6: Nenue@6: kb.PLAYER_REGEN_ENABLED = function() Nenue@6: kb.ui() Nenue@6: end Nenue@6: Nenue@6: kb.PLAYER_SPECIALIZATION_CHANGED = function() Nenue@6: kb.UpdateSpecInfo() Nenue@6: kb.UpdateTalentInfo() Nenue@17: kb.SelectProfileSet(kb.profileName) Nenue@6: kb.ApplyAllBindings() Nenue@6: kb.ui(true) Nenue@6: end Nenue@6: kb.PLAYER_TALENT_UPDATE = function() Nenue@6: kb.UpdateTalentInfo() Nenue@17: kb.SelectProfileSet(kb.profileName) Nenue@6: kb.ApplyAllBindings() Nenue@6: kb.ui() Nenue@6: end Nenue@6: kb.ACTIONBAR_SLOT_CHANGED = function(self, event, slot) Nenue@27: --kb.HotKeyText(slot) Nenue@6: return true Nenue@6: end Nenue@6: Nenue@15: -- only need to respond to this for pet actions Nenue@15: kb.SPELLS_CHANGED = function(self, event, unit) Nenue@15: print('|cFFFF0088'.. event..'|r', unit) Nenue@6: kb.UpdatePetInfo() Nenue@6: end