annotate Events.lua @ 72:c48913c5924c

- Dynamic bindings properly update between talent choices, and the hotkey text is also correctly reflected.
author Nenue
date Sat, 07 Jan 2017 12:47:41 -0500
parents 131d9190db6b
children 9824d524a661
rev   line source
Nenue@70 1 -- KrakTool
Nenue@70 2 -- Events.lua
Nenue@70 3 -- Created: 7/24/2016 11:10 PM
Nenue@70 4 -- %file-revision%
Nenue@70 5 -- Event handlers, and the init block that sets them up; nothing else should be here
Nenue@70 6
Nenue@70 7 local _, kb = ...
Nenue@70 8 local print = (DEVIAN_PNAME == 'SkeletonKey') and function(...) _G.print('SkeletonKey', ...) end or function() end
Nenue@70 9
Nenue@70 10
Nenue@72 11 kb.PLAYER_LOGIN = function(_, _, addon)
Nenue@70 12
Nenue@70 13 end
Nenue@70 14
Nenue@70 15 kb.PLAYER_REGEN_DISABLED = function()
Nenue@70 16 SkeletonKey:SetShown(false)
Nenue@70 17 end
Nenue@70 18
Nenue@70 19 kb.UNIT_PORTRAIT_UPDATE = function()
Nenue@70 20 SkeletonKey:Update()
Nenue@70 21 end
Nenue@70 22
Nenue@70 23 kb.PLAYER_REGEN_ENABLED = function()
Nenue@70 24 SkeletonKey:Update()
Nenue@70 25 end
Nenue@70 26
Nenue@70 27 kb.PLAYER_SPECIALIZATION_CHANGED = function(...)
Nenue@72 28
Nenue@70 29 kb.UpdateSpecInfo()
Nenue@70 30 kb.UpdateTalentInfo()
Nenue@72 31
Nenue@70 32 kb.SelectProfileSet(kb.profileName)
Nenue@70 33 kb.ApplyAllBindings()
Nenue@70 34 SkeletonKey:Update(true)
Nenue@70 35 end
Nenue@70 36 kb.PLAYER_TALENT_UPDATE = function()
Nenue@72 37 --kb.UpdateTalentInfo()
Nenue@72 38 --kb.SelectProfileSet(kb.profileName)
Nenue@72 39 --kb.ApplyAllBindings()
Nenue@72 40 --SkeletonKey:Update()
Nenue@70 41 end
Nenue@70 42 kb.ACTIONBAR_SLOT_CHANGED = function(self, event, slot)
Nenue@70 43 --kb.HotKeyText(slot)
Nenue@70 44 return true
Nenue@70 45 end
Nenue@70 46
Nenue@70 47 -- only need to respond to this for pet actions
Nenue@70 48 kb.SPELLS_CHANGED = function(self, event, unit)
Nenue@70 49 print('|cFFFF0088'.. event..'|r', unit)
Nenue@70 50 kb.UpdatePetInfo()
Nenue@70 51 end
Nenue@70 52
Nenue@70 53 kb.UPDATE_MACROS = function()
Nenue@70 54 kb.UpdateMacroInfo()
Nenue@70 55 end
Nenue@70 56
Nenue@70 57 kb.UPDATE_BINDINGS = function()
Nenue@70 58 kb.UpdateSystemBinds()
Nenue@70 59 end