Mercurial > wow > skeletonkey
annotate Events.lua @ 74:9824d524a661
- binding slot mixin:
- store key binding definitions under their slot's data table
- apply action button attributes when a slot is assigned
- obtain correct macro body text when a macro is slotted
- fix algorithm for resolving renamed macro indices
- move spell detail lookup code out of mixin script
- event chains:
- initialize addon from PLAYER_LOGIN
- reload keybinds from PLAYER_SPECIALIZATION_CHANGED, after spec profile is resolved
- refresh interface content from SPELLS_CHANGED
- hotkey text:
- restore communication and detection of key binding updates and reflect them accordingly
- properly respond to dynamic bindings that result from talent updates
author | Nenue |
---|---|
date | Sat, 14 Jan 2017 02:29:33 -0500 |
parents | c48913c5924c |
children | e75a2fd448c0 |
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@74 | 24 SkeletonKey:SetShown(kb.db.showUI) |
Nenue@70 | 25 end |
Nenue@70 | 26 kb.ACTIONBAR_SLOT_CHANGED = function(self, event, slot) |
Nenue@70 | 27 --kb.HotKeyText(slot) |
Nenue@70 | 28 return true |
Nenue@70 | 29 end |
Nenue@70 | 30 |
Nenue@74 | 31 kb.PLAYER_TALENT_UPDATE = function() |
Nenue@74 | 32 kb.TalentsChanged = true |
Nenue@74 | 33 end |
Nenue@74 | 34 |
Nenue@70 | 35 -- only need to respond to this for pet actions |
Nenue@74 | 36 kb.PLAYER_SPECIALIZATION_CHANGED = function(self, event, unit) |
Nenue@74 | 37 kb.UpdateSpecInfo() |
Nenue@74 | 38 kb.UpdateTalentInfo() |
Nenue@70 | 39 kb.UpdatePetInfo() |
Nenue@74 | 40 kb.SelectProfileSet(kb.profileName) |
Nenue@74 | 41 kb.ApplyAllBindings() |
Nenue@74 | 42 end |
Nenue@74 | 43 |
Nenue@74 | 44 kb.SPELLS_CHANGED = function() |
Nenue@74 | 45 SkeletonKey:Update() |
Nenue@70 | 46 end |
Nenue@70 | 47 |
Nenue@70 | 48 kb.UPDATE_MACROS = function() |
Nenue@70 | 49 kb.UpdateMacroInfo() |
Nenue@70 | 50 end |
Nenue@70 | 51 |
Nenue@70 | 52 kb.UPDATE_BINDINGS = function() |
Nenue@70 | 53 kb.UpdateSystemBinds() |
Nenue@70 | 54 end |