# HG changeset patch
# User Nenue
# Date 1531853203 14400
# Node ID d6831be74cf4e7b7ff0b650269ab40fee0a67a8b
# Parent 94a279e9c5a93ad923b0804a32bf0577c6a010f3
Partial functionality updates for 8.0
diff -r 94a279e9c5a9 -r d6831be74cf4 ActionTemplates.lua
--- a/ActionTemplates.lua Tue Jul 17 14:38:50 2018 -0400
+++ b/ActionTemplates.lua Tue Jul 17 14:46:43 2018 -0400
@@ -106,7 +106,10 @@
--- Resolves the SecureActionButton attribute names used for the given action
kb.RegisterAction = function(actionType, id, name)
- assert(atype[actionType], 'Missing actionType handler for `'..tostring(actionType)..'`')
+ if not atype[actionType]then
+ kb.print('Missing actionType handler for `'..tostring(actionType)..'`')
+ return
+ end
local prefix, attributeName, attributeValue, button = atype[actionType](id, name)
local command = prefix .. attributeName
return attributeName, attributeValue, command, prefix, button
@@ -194,42 +197,60 @@
configTable.command = configTable.command:gsub('KeyBinder', 'SkeletonKey')
end
+ cprint('|cFF0088FFLoadBinding()|r', configTable.actionName, configTable.dynamicType)
+ local isAvailable
+ local dynamicType = configTable.dynamicType
+ if dynamicType == 'profession' then
+ local dynamicIndex, dynamicSubIndex = tonumber(configTable.dynamicIndex), tonumber(configTable.dynamicSubIndex)
+ cprint(' |cFF00FFFFDynamicInfo:|r', dynamicType, dynamicIndex, dynamicSubIndex)
+
+ local extendedTable = kb.DynamicSpells[dynamicType][dynamicIndex]
+
+ if extendedTable then
+ cprint(extendedTable)
+ for k,v in pairs(extendedTable) do
+ cprint(type(k), k)
+ end
+ local subTable = extendedTable[dynamicSubIndex]
+
+ if subTable then
+ for k,v in pairs(subTable) do
+ cprint(' override', k, '=', v, '(was', configTable[k])
+ configTable[k] = subTable[k]
+ end
+ --isAvailable = configTable.isAvailabl
+ --name, actionID = configTable.actionName, configTable.actionID
+ cprint(subTable.actionName, subTable.actionID)
+ isAvailable = true
+ end
+ end
+ end
+
local command, name, icon, actionType, actionID, macroName, macroText =
configTable.command, configTable.actionName, configTable.iconPath, configTable.actionType,
configTable.actionID, configTable.macroName, configTable.macroText
-
- local indexKey = actionType..'_'..actionID
- local actionPrefix = "*"..actionType.."-"
+ local indexKey = tostring(actionType)..'_'..tostring(actionID)
+ local actionPrefix = "*"..tostring(actionType).."-"
local button = SkeletonKeyKey
- local isAvailable
local specialButtonType
if actionType == 'spell' then
local realName, _, _, _, _, _, realID = GetSpellInfo(name)
+
if realName then
if (realName ~= name) then
- print(' *** "', name, '" is replaced by...', realName, realID)
+ cprint(' *** "', name, '" is replaced by...', realName, realID)
--name, actionID = realName, realID
indexKey = actionType .. '_'.. realID
end
- elseif configTable.dynamicType == 'talent' then
- print(' *** "', name, '" is a non-selected talent.')
+ elseif dynamicType == 'talent' then
+ cprint(' |cFF00FFFFDynamicInfo:|r', dynamicType, table.concat(configTable.assignedKeys, ','))
+ cprint(' *** "', name, '" is a non-selected talent.')
return
end
+ if GetSpellInfo(realName or name) then
-
- local dynamicInfo = kb.DynamicSpells[name]
- if dynamicInfo then
- configTable.assignedKeys = configTable.assignedKeys or {GetBindingKey(configTable.command) }
-
- cprint('|cFF00FFFFDynamicInfo:|r', dynamicInfo.dynamicType, table.concat(configTable.assignedKeys, ','))
- for k, v in pairs(dynamicInfo) do
- --cprint(' --', k, v)
- configTable[k] = v
- end
- isAvailable = configTable.isAvailable
- elseif GetSpellInfo(actionID) then
isAvailable = true
end
@@ -247,22 +268,30 @@
end
if isAvailable then
+ cprint(' available', actionType, actionID, name)
local attributeSuffix, attributeValue, command, target, button = kb.RegisterAction(actionType, actionID, name)
- local actionKey = actionPrefix .. attributeSuffix
- cprint('|cFF00FF88LoadBinding()|r', button:GetName(), "*type-"..attributeSuffix, actionType, '|cFFFFFF00'..actionKey, attributeValue, isAvailable)
+ local actionKey = tostring(actionPrefix) .. tostring(attributeSuffix)
+
+ if not attributeSuffix then
+ cprint('failed to generate button attribute')
+ return
+ end
+
+
+ cprint('|cFF00FF88 result:|r', button and button:GetName(), "*type-"..tostring(attributeSuffix), actionType, '|cFFFFFF00'..actionKey, attributeValue, isAvailable)
kb.SecureAttribute(button, "*type-"..attributeSuffix, specialButtonType or actionType)
kb.SecureAttribute(button, actionKey, attributeValue)
- cprint('|cFFFF4400add', name, isAvailable, indexKey, unpack(configTable.assignedKeys))
+ cprint(' |cFFFF4400add', name, isAvailable, indexKey, unpack(configTable.assignedKeys))
kb.bindings[indexKey] = configTable.assignedKeys
commandActions[command] = kb.bindings[indexKey]
return command, kb.bindings[indexKey]
else
if kb.bindings[indexKey] then
- cprint('|cFFFF4400remove', name, isAvailable, indexKey, unpack(configTable.assignedKeys))
+ cprint(' |cFFFF4400remove', name, isAvailable, indexKey, unpack(configTable.assignedKeys))
kb.bindings[indexKey] = nil
end
@@ -472,6 +501,7 @@
end
end
+--[[
for row = 1, MAX_PVP_TALENT_TIERS do
for col = 1, MAX_PVP_TALENT_COLUMNS do
local talentID, talentName, icon, selected, available, spellID, unlocked = GetPvpTalentInfo(row, col, 1)
@@ -480,6 +510,7 @@
end
end
end
+ --]]
local numTabs = GetNumSpellTabs()
for i = 1, numTabs do
@@ -555,7 +586,7 @@
kb.DynamicSpells.profession[spellID] = profInfo
kb.DynamicSpells.profession[i] = kb.DynamicSpells.profession[i] or {}
kb.DynamicSpells.profession[i][j] = profInfo
- --print(' |cFF0088FF['..i..']|r|cFFFF44BB['..spellOffset+i..']|r', spellName, "profession_"..i .. '_' ..j)
+ cprint(' |cFF0088FF['..i..']|r|cFFFF44BB['..j..']|r', spellName, "profession_"..i .. '_' ..j)
end
end
diff -r 94a279e9c5a9 -r d6831be74cf4 SkeletonKey.lua
--- a/SkeletonKey.lua Tue Jul 17 14:38:50 2018 -0400
+++ b/SkeletonKey.lua Tue Jul 17 14:46:43 2018 -0400
@@ -320,7 +320,7 @@
print('|cFF0088FF'..self:GetName()..':OnLoad()')
self.CloseButton:SetScript('OnClick', CloseButton_OnClick)
- self:RegisterEvent('PLAYER_ENTERING_WORLD')
+ --self:RegisterEvent('PLAYER_ENTERING_WORLD')
self:RegisterEvent('ADDON_LOADED')
self:RegisterEvent('PLAYER_LOGIN')
self:RegisterUnitEvent('PLAYER_SPECIALIZATION_CHANGED', 'player')
@@ -375,6 +375,7 @@
kb.UpdateSpecInfo()
kb.UpdateTalentInfo()
+ kb.UpdateProfessionInfo()
kb.SelectProfileSet(kb.profileName)
self:SetShown(kb.db.showUI)
-- todo: redo import checking
diff -r 94a279e9c5a9 -r d6831be74cf4 SkeletonKey.xml
--- a/SkeletonKey.xml Tue Jul 17 14:38:50 2018 -0400
+++ b/SkeletonKey.xml Tue Jul 17 14:46:43 2018 -0400
@@ -24,11 +24,11 @@
-
+
-
-
+
@@ -142,7 +142,7 @@
-
+
+
+