annotate SkeletonKey/Events.lua @ 13:eeec4a600064

- kb.bindings carries the exact values needed for matching GetActionInfo() outputs
author Nenue
date Thu, 28 Jul 2016 18:20:32 -0400
parents 8f8917d111c9
children 32d64e42ec9b
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@6 7 local kb = 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@6 14 kb:RegisterUnitEvent('TALENT_UPDATE', 'player', 'pet')
Nenue@6 15 kb:RegisterEvent('PLAYER_REGEN_DISABLED')
Nenue@6 16 kb:RegisterEvent('PLAYER_REGEN_ENABLED')
Nenue@6 17 end
Nenue@6 18
Nenue@6 19 kb.event = function(event, ...)
Nenue@6 20 if kb[event] then
Nenue@6 21 kb[event](kb, event, ...)
Nenue@6 22 end
Nenue@6 23 end
Nenue@6 24
Nenue@6 25 kb.PLAYER_REGEN_DISABLED = function()
Nenue@6 26 kb.ui()
Nenue@6 27 end
Nenue@6 28
Nenue@6 29 kb.UNIT_PORTRAIT_UPDATE = function()
Nenue@12 30 if KeyBinderCharacterTab then
Nenue@12 31 SetPortraitTexture(KeyBinderCharacterTab.icon, 'player')
Nenue@12 32 end
Nenue@6 33 end
Nenue@6 34
Nenue@6 35 kb.PLAYER_REGEN_ENABLED = function()
Nenue@6 36 kb.ui()
Nenue@6 37 end
Nenue@6 38
Nenue@6 39 kb.PLAYER_SPECIALIZATION_CHANGED = function()
Nenue@6 40 kb.UpdateSpecInfo()
Nenue@6 41 kb.UpdateTalentInfo()
Nenue@6 42 kb.ApplyAllBindings()
Nenue@6 43 kb.ui(true)
Nenue@6 44 end
Nenue@6 45 kb.PLAYER_TALENT_UPDATE = function()
Nenue@6 46 kb.UpdateTalentInfo()
Nenue@6 47 kb.ApplyAllBindings()
Nenue@6 48 kb.ui()
Nenue@6 49 end
Nenue@6 50 kb.ACTIONBAR_SLOT_CHANGED = function(self, event, slot)
Nenue@6 51 kb.HotKeyText(slot)
Nenue@6 52 return true
Nenue@6 53 end
Nenue@6 54
Nenue@6 55 kb.UNIT_PET = function(self, event, unit)
Nenue@6 56 if unit ~= 'player' then
Nenue@6 57 return
Nenue@6 58 end
Nenue@6 59
Nenue@6 60 kb.UpdatePetInfo()
Nenue@6 61 end