annotate SkeletonKey/Events.lua @ 62:04c23ceaf9e0

- fix taint caused by loading in combat
author Nenue
date Mon, 05 Sep 2016 14:56:38 -0400
parents 9eebce04e69b
children 178d489f387c
rev   line source
Nenue@6 1 -- KrakTool
Nenue@6 2 -- Events.lua
Nenue@6 3 -- Created: 7/24/2016 11:10 PM
Nenue@6 4 -- %file-revision%
Nenue@6 5 -- Event handlers, and the init block that sets them up; nothing else should be here
Nenue@6 6
Nenue@15 7 local kb, print = LibStub("LibKraken").register(KeyBinder)
Nenue@6 8
Nenue@6 9 kb.init = function()
Nenue@6 10 kb:RegisterEvent('PLAYER_ENTERING_WORLD')
Nenue@6 11 kb:RegisterEvent('UPDATE_MACROS')
Nenue@6 12 kb:RegisterUnitEvent('PLAYER_SPECIALIZATION_CHANGED', 'player', 'pet')
Nenue@6 13 kb:RegisterUnitEvent('UNIT_PORTRAIT_UPDATE', 'player', 'pet')
Nenue@15 14 kb:RegisterUnitEvent('SPELLS_CHANGED')
Nenue@6 15 kb:RegisterUnitEvent('TALENT_UPDATE', 'player', 'pet')
Nenue@15 16
Nenue@6 17 kb:RegisterEvent('PLAYER_REGEN_DISABLED')
Nenue@6 18 kb:RegisterEvent('PLAYER_REGEN_ENABLED')
Nenue@6 19 end
Nenue@6 20
Nenue@6 21 kb.PLAYER_REGEN_DISABLED = function()
Nenue@57 22 kb:Hide()
Nenue@6 23 end
Nenue@6 24
Nenue@6 25 kb.UNIT_PORTRAIT_UPDATE = function()
Nenue@12 26 if KeyBinderCharacterTab then
Nenue@12 27 SetPortraitTexture(KeyBinderCharacterTab.icon, 'player')
Nenue@12 28 end
Nenue@6 29 end
Nenue@6 30
Nenue@6 31 kb.PLAYER_REGEN_ENABLED = function()
Nenue@6 32 kb.ui()
Nenue@6 33 end
Nenue@6 34
Nenue@62 35 kb.PLAYER_SPECIALIZATION_CHANGED = function(...)
Nenue@6 36 kb.UpdateSpecInfo()
Nenue@6 37 kb.UpdateTalentInfo()
Nenue@17 38 kb.SelectProfileSet(kb.profileName)
Nenue@6 39 kb.ApplyAllBindings()
Nenue@6 40 kb.ui(true)
Nenue@6 41 end
Nenue@6 42 kb.PLAYER_TALENT_UPDATE = function()
Nenue@6 43 kb.UpdateTalentInfo()
Nenue@17 44 kb.SelectProfileSet(kb.profileName)
Nenue@6 45 kb.ApplyAllBindings()
Nenue@6 46 kb.ui()
Nenue@6 47 end
Nenue@6 48 kb.ACTIONBAR_SLOT_CHANGED = function(self, event, slot)
Nenue@27 49 --kb.HotKeyText(slot)
Nenue@6 50 return true
Nenue@6 51 end
Nenue@6 52
Nenue@15 53 -- only need to respond to this for pet actions
Nenue@15 54 kb.SPELLS_CHANGED = function(self, event, unit)
Nenue@15 55 print('|cFFFF0088'.. event..'|r', unit)
Nenue@6 56 kb.UpdatePetInfo()
Nenue@34 57 end
Nenue@34 58
Nenue@34 59 kb.BINDINGS_UPDATE = function()
Nenue@34 60 kb.UpdateSystemBinds()
Nenue@6 61 end