changeset 61:b7be92f62b05

unbreak hotkey startup sequence
author Nenue
date Sun, 28 Aug 2016 10:06:59 -0400
parents 256585077cdd
children 04c23ceaf9e0
files SkeletonKey/HotKey.lua
diffstat 1 files changed, 16 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/SkeletonKey/HotKey.lua	Sat Aug 27 11:01:25 2016 -0400
+++ b/SkeletonKey/HotKey.lua	Sun Aug 28 10:06:59 2016 -0400
@@ -5,11 +5,12 @@
 -- Module for fixing actionbar hotkey text
 
 local _G, wipe, tContains, tinsert = _G, table.wipe, tContains, tinsert
-local kb, print, wrap = LibStub("LibKraken").register(KeyBinder, "HotKey")
+
+local hotkey = CreateFrame('Frame', 'SkeletonHotKeys', UIParent)
+local kb, print, wrap = LibStub("LibKraken").register(KeyBinder, hotkey)
 local hotkeyText = {}
 local blizHotKey = {}
 local bindings
-local hotkey = {}
 
 -- frames obtained via post-load hooks, created by addons like Dominos or BarTender4
 local loadedFrames = {}
@@ -20,7 +21,6 @@
 local actionFrames = {}
 local actionIndex = {}
 
-kb:wrap(hotkey)
 
 --- Used to determine which groups of action buttons need updating
 local hotkeyEvents = {
@@ -51,7 +51,7 @@
 
 hotkey.RegisterFrame = function(frame)
   --wrap(function()
-  --print('ActionBarButtonEventsFrame_RegisterFrame(', frame:GetName(), frame.action, frame:IsVisible(), frame:IsShown())
+  print('ActionBarButtonEventsFrame_RegisterFrame(', frame:GetName(), frame.action, frame:IsVisible(), frame:IsShown())
   --end)
   blizHotKey[frame] = frame.HotKey
   loadedFrames[frame] = true
@@ -72,28 +72,35 @@
 end
 
 hotkey.variables = function()
+  print('variables')
   bindings = kb.GetBindings()
   for event, manifest in pairs(hotkeyEvents) do
     kb:RegisterEvent(event)
     hotkey[event] = hotkey.UpdateFromEvent
   end
   hotkey.wrapEvent('UNIT_PET', 'pet')
+  hotkey.player()
 end
 
 
 hotkey.init = function()
+
   hooksecurefunc("ActionBarButtonEventsFrame_RegisterFrame", hotkey.RegisterFrame)
+
 end
 
 hotkey.ui = function()
+  print('ui')
   --hotkey.player()
   --hotkey.pet()
 end
 
+
 hotkey.world = function()
+  print('world')
   hotkeyEvents["UPDATE_BINDINGS"] = {"binding"}
   hotkey.UPDATE_BINDINGS = hotkey.UpdateFromEvent
-  kb:RegisterEvent("UPDATE_BINDINGS")
+  hotkey:RegisterEvent("UPDATE_BINDINGS")
 
   hotkey.player()
   hotkey.pet()
@@ -109,7 +116,7 @@
 
 
   if bindings[indexKey] then
-    --print('|cFFFFFF00'..frame:GetName(), actionType, actionID, hasAction)
+    print('|cFFFFFF00'..frame:GetName(), actionType, actionID, hasAction)
     local binds = bindings[indexKey]
     if binds and (not frame.HotKey:IsVisible()) then
       if hasAction then
@@ -145,9 +152,10 @@
 hotkey.actionbar = function()
   wipe(actionFrames)
   -- reset frames list
-
+  print('actionbar')
   if ActionBarButtonEventsFrame.frames then
     for index, frame in ipairs(ActionBarButtonEventsFrame.frames) do
+
       local slot = frame.action
       local actionType, actionID = GetActionInfo(slot)
       local hasAction = HasAction(slot)
@@ -177,6 +185,7 @@
 end
 
 hotkey.player = function()
+  print('player')
   hotkey.actionbar()
 end