# HG changeset patch # User Nenue # Date 1485215942 18000 # Node ID e75a2fd448c0e85b99e9d7dd14af95f48aff6ba5 # Parent 9824d524a661e42ff5992c9d6586fb54e020b658 - 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 - hard refresh after PLAYER_SPECIALIZATION_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 diff -r 9824d524a661 -r e75a2fd448c0 ActionTemplates.lua --- a/ActionTemplates.lua Sat Jan 14 02:29:33 2017 -0500 +++ b/ActionTemplates.lua Mon Jan 23 18:59:02 2017 -0500 @@ -99,7 +99,7 @@ end atype['item'] = function(id, name) - return CLICK_KEYBINDER_KEY, tostring(name), id, SkeletonKeyKey + return CLICK_KEYBINDER_KEY, tostring(name), tostring(name), SkeletonKeyKey end @@ -218,8 +218,7 @@ local specialButtonType if actionType == 'spell' then cprint(GetSpellInfo(actionID)) - cprint(GetSpellInfo(name)) - if GetSpellInfo(name) then + if GetSpellInfo(actionID) then isAvailable = true end local dynamicInfo = kb.DynamicSpells[name] @@ -231,8 +230,11 @@ configTable[k] = v end end + elseif actionType == 'item' then + actionID = configTable.actionName + isAvailable = true + else - else if actionType ~= 'macro' then actionPrefix = '*macrotext-' end @@ -374,11 +376,11 @@ configTable.assignedKeys = talent.assignedKeys end if not configTable.assignedKeys then - configTable.assignedKeys = {GetBindingKey(configTable.command) } + configTable.assignedKeys = {GetBindingKey(configTable.command)} end - if configTable.dynamicType == 'talent' then - --kb:print(table.concat(configTable.assignedKeys, ', ') .. ' bound to '.. configTable.actionName) - end + --if configTable.dynamicType == 'talent' then + -- kb:print(table.concat(configTable.assignedKeys, ', ') .. ' bound to '.. configTable.actionName) + --end for _, key in pairs(configTable.assignedKeys) do SetBinding(key, configTable.command) @@ -411,6 +413,7 @@ SaveBindings(GetCurrentBindingSet()) + end end diff -r 9824d524a661 -r e75a2fd448c0 Events.lua --- a/Events.lua Sat Jan 14 02:29:33 2017 -0500 +++ b/Events.lua Mon Jan 23 18:59:02 2017 -0500 @@ -39,6 +39,7 @@ kb.UpdatePetInfo() kb.SelectProfileSet(kb.profileName) kb.ApplyAllBindings() + SkeletonKey:Update(true) end kb.SPELLS_CHANGED = function()