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@6: local kb = 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@6: kb:RegisterUnitEvent('TALENT_UPDATE', 'player', 'pet') 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@6: SetPortraitTexture(KeyBinderCharacterTab.icon, 'player') 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@6: kb.ApplyAllBindings() Nenue@6: kb.ui(true) Nenue@6: end Nenue@6: kb.PLAYER_TALENT_UPDATE = function() Nenue@6: kb.UpdateTalentInfo() Nenue@6: kb.ApplyAllBindings() Nenue@6: kb.ui() Nenue@6: end Nenue@6: kb.ACTIONBAR_SLOT_CHANGED = function(self, event, slot) Nenue@6: kb.HotKeyText(slot) Nenue@6: return true Nenue@6: end Nenue@6: Nenue@6: kb.UNIT_PET = function(self, event, unit) Nenue@6: if unit ~= 'player' then Nenue@6: return Nenue@6: end Nenue@6: Nenue@6: kb.UpdatePetInfo() Nenue@6: end