diff SkeletonKey.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
line wrap: on
line diff
--- a/SkeletonKey.lua	Fri Jan 06 16:21:49 2017 -0500
+++ b/SkeletonKey.lua	Sat Jan 07 12:47:41 2017 -0500
@@ -8,7 +8,8 @@
 -- Header script
 
 local addonName, kb = ...
-local print = DEVIAN_WORKSPACE and function(...) print('SK',...) end or nop
+local print = DEVIAN_WORKSPACE and function(...) _G.print('SK',...) end or nop
+local cprint = DEVIAN_WORKSPACE and function(...) _G.print('Cfg',...) end or nop
 SkeletonKeyMixin = {
   scrollCache = {},
   tabButtons = {},
@@ -69,7 +70,7 @@
 kb.orderedProfiles = {}
 kb.buttons = {}
 kb.macros = {}
-kb.bindings = {}
+kb.bindings = setmetatable({}, {__newindex = function(t,k,v) rawset(t,k,v) cprint('adding', k, v) end})
 kb.petFrames = {} -- pet data is slightly delayed, their buttons are indexed here so they can be refreshed
 kb.talentFrames = {}
 kb.professionFrames = {}
@@ -316,6 +317,7 @@
   print('|cFF0088FF'..self:GetName()..':OnLoad()')
 
   self.CloseButton:SetScript('OnClick', CloseButton_OnClick)
+  self:RegisterEvent('PLAYER_LOGIN')
   self:RegisterEvent('PLAYER_ENTERING_WORLD')
   self:RegisterEvent('ADDON_LOADED')
   self:EnableKeyboard(false)