Mercurial > wow > skeletonkey
comparison SkeletonKey/Events.lua @ 15:32d64e42ec9b
- resolve pet bar actions for binding slots
- detect type of petaction (can be spell, stance, or 'PETACTION')
- keep track of displayed pet ability slots and update them alongside pet cache refreshes
| author | Nenue |
|---|---|
| date | Fri, 29 Jul 2016 03:27:15 -0400 |
| parents | 8f8917d111c9 |
| children | 500f9b2bd9ac |
comparison
equal
deleted
inserted
replaced
| 14:82170735e67c | 15:32d64e42ec9b |
|---|---|
| 2 -- Events.lua | 2 -- Events.lua |
| 3 -- Created: 7/24/2016 11:10 PM | 3 -- Created: 7/24/2016 11:10 PM |
| 4 -- %file-revision% | 4 -- %file-revision% |
| 5 -- Event handlers, and the init block that sets them up; nothing else should be here | 5 -- Event handlers, and the init block that sets them up; nothing else should be here |
| 6 | 6 |
| 7 local kb = LibStub("LibKraken").register(KeyBinder) | 7 local kb, print = LibStub("LibKraken").register(KeyBinder) |
| 8 | 8 |
| 9 kb.init = function() | 9 kb.init = function() |
| 10 kb:RegisterEvent('PLAYER_ENTERING_WORLD') | 10 kb:RegisterEvent('PLAYER_ENTERING_WORLD') |
| 11 kb:RegisterEvent('UPDATE_MACROS') | 11 kb:RegisterEvent('UPDATE_MACROS') |
| 12 kb:RegisterUnitEvent('PLAYER_SPECIALIZATION_CHANGED', 'player', 'pet') | 12 kb:RegisterUnitEvent('PLAYER_SPECIALIZATION_CHANGED', 'player', 'pet') |
| 13 kb:RegisterUnitEvent('UNIT_PORTRAIT_UPDATE', 'player', 'pet') | 13 kb:RegisterUnitEvent('UNIT_PORTRAIT_UPDATE', 'player', 'pet') |
| 14 kb:RegisterUnitEvent('SPELLS_CHANGED') | |
| 14 kb:RegisterUnitEvent('TALENT_UPDATE', 'player', 'pet') | 15 kb:RegisterUnitEvent('TALENT_UPDATE', 'player', 'pet') |
| 16 | |
| 15 kb:RegisterEvent('PLAYER_REGEN_DISABLED') | 17 kb:RegisterEvent('PLAYER_REGEN_DISABLED') |
| 16 kb:RegisterEvent('PLAYER_REGEN_ENABLED') | 18 kb:RegisterEvent('PLAYER_REGEN_ENABLED') |
| 17 end | 19 end |
| 18 | 20 |
| 19 kb.event = function(event, ...) | 21 kb.event = function(event, ...) |
| 50 kb.ACTIONBAR_SLOT_CHANGED = function(self, event, slot) | 52 kb.ACTIONBAR_SLOT_CHANGED = function(self, event, slot) |
| 51 kb.HotKeyText(slot) | 53 kb.HotKeyText(slot) |
| 52 return true | 54 return true |
| 53 end | 55 end |
| 54 | 56 |
| 55 kb.UNIT_PET = function(self, event, unit) | 57 -- only need to respond to this for pet actions |
| 56 if unit ~= 'player' then | 58 kb.SPELLS_CHANGED = function(self, event, unit) |
| 57 return | 59 print('|cFFFF0088'.. event..'|r', unit) |
| 58 end | |
| 59 | |
| 60 kb.UpdatePetInfo() | 60 kb.UpdatePetInfo() |
| 61 end | 61 end |
