Mercurial > wow > skeletonkey
comparison SkeletonKey/HotKey.lua @ 13:eeec4a600064
- kb.bindings carries the exact values needed for matching GetActionInfo() outputs
| author | Nenue |
|---|---|
| date | Thu, 28 Jul 2016 18:20:32 -0400 |
| parents | f6d1c192afc6 |
| children | 82170735e67c |
comparison
equal
deleted
inserted
replaced
| 12:8f8917d111c9 | 13:eeec4a600064 |
|---|---|
| 115 | 115 |
| 116 hotkey.init = function() | 116 hotkey.init = function() |
| 117 hooksecurefunc("ActionBarButtonEventsFrame_RegisterFrame", hotkey.RegisterFrame) | 117 hooksecurefunc("ActionBarButtonEventsFrame_RegisterFrame", hotkey.RegisterFrame) |
| 118 end | 118 end |
| 119 | 119 |
| 120 hotkey.ui = function() | |
| 121 hotkey.player() | |
| 122 hotkey.pet() | |
| 123 end | |
| 124 | |
| 120 hotkey.world = function() | 125 hotkey.world = function() |
| 121 hotkeyEvents["UPDATE_BINDINGS"] = {"actionbar"} | 126 hotkeyEvents["UPDATE_BINDINGS"] = {"actionbar"} |
| 122 hotkey.UPDATE_BINDINGS = hotkey.UpdateFromEvent | 127 hotkey.UPDATE_BINDINGS = hotkey.UpdateFromEvent |
| 123 kb:RegisterEvent("UPDATE_BINDINGS") | 128 kb:RegisterEvent("UPDATE_BINDINGS") |
| 124 | 129 |
| 129 hooksecurefunc("ActionButton_Update", hotkey.ActionButton_Update) | 134 hooksecurefunc("ActionButton_Update", hotkey.ActionButton_Update) |
| 130 end | 135 end |
| 131 | 136 |
| 132 -- requires all these arguments since non-actionbar buttons don't have all of said methods | 137 -- requires all these arguments since non-actionbar buttons don't have all of said methods |
| 133 hotkey.UpdateSkeletonKeyText = function(frame, actionType, actionID, hasAction) | 138 hotkey.UpdateSkeletonKeyText = function(frame, actionType, actionID, hasAction) |
| 139 bindings = kb.GetBindings() | |
| 140 print(frame, actionType, actionID, hasAction) | |
| 134 if bindings[actionType] then | 141 if bindings[actionType] then |
| 135 if actionType == 'macro' then | |
| 136 actionID = GetMacroInfo(actionID) | |
| 137 end | |
| 138 --print('|cFFFFFF00'..frame:GetName(), actionType, actionID, hasAction) | 142 --print('|cFFFFFF00'..frame:GetName(), actionType, actionID, hasAction) |
| 139 local binds = bindings[actionType][actionID] | 143 local binds = bindings[actionType][actionID] |
| 140 if binds then | 144 if binds then |
| 141 if hasAction and not frame.HotKey:IsVisible() then | 145 if hasAction and not frame.HotKey:IsVisible() then |
| 142 if not hotkeyText[frame] then | 146 if not hotkeyText[frame] then |
