Mercurial > wow > skeletonkey
comparison ActionTemplates.lua @ 80:b9a53385462c
- Fixed Demon Hunter Vengeance bindings, along with other spells that are replaced by specialization variants.
- Spells replaced by a specialization now display the replacing name along with the original name in their binding slot.
author | Nick@Zahhak |
---|---|
date | Tue, 21 Mar 2017 02:23:23 -0400 |
parents | d4c100b0fd01 |
children | 9a206b105ea5 |
comparison
equal
deleted
inserted
replaced
79:ac9e48125660 | 80:b9a53385462c |
---|---|
123 spells[spellID].dynamicType = nil | 123 spells[spellID].dynamicType = nil |
124 end | 124 end |
125 return spells[spellID] | 125 return spells[spellID] |
126 end | 126 end |
127 | 127 |
128 -- tries to resolve spells from talent overrides/profession book/etc | 128 -- verifies binding slot data |
129 local dynamicTypes = {['profession'] = 'ProfessionCache', ['talent'] = 'TalentCache', ['petaction'] = 'PetInfoCache'} | 129 local dynamicTypes = {['profession'] = 'ProfessionCache', ['talent'] = 'TalentCache', ['petaction'] = 'PetInfoCache'} |
130 kb.ResolveSpellSlot = function(self) | 130 kb.ResolveSpellSlot = function(self) |
131 local spellName, spellID, command, icon = self.actionName, self.actionID, self.command, self.iconPath | 131 local spellName, spellID, command, icon = self.actionName, self.actionID, self.command, self.iconPath |
132 --print(' In:', spellName, spellID, command) | 132 |
133 --print(GetSpellInfo(spellName or spellID)) | 133 --print(GetSpellInfo(spellName or spellID)) |
134 local internalName, _, internalIcon, _, _, _, _ = GetSpellInfo(spellName or spellID) | 134 local internalName, _, internalIcon, _, _, _, _ = GetSpellInfo(spellID) |
135 local replacerName, _, _, _, _, _, replacerID = GetSpellInfo(internalName) | |
136 print('Resolve Slot: id =', spellID, 'nameFromID =', internalName, 'nameFromName =', replacerName) | |
135 local isAvailable = internalName and true | 137 local isAvailable = internalName and true |
136 | 138 |
137 if internalName and (internalName ~= spellName) then | 139 -- keep current slotInfo if it's a spell that has been replaced by spec/talent |
138 -- it's a binding for the originating spell, leave it as is | 140 if internalName and (internalName ~= replacerName) then |
139 print(' |cFFFF4400spell is an override(', internalName, '~=', spellName,') leave the name info alone') | 141 print(' |cFFFF4400spell name is overridden by', replacerName, '(was', internalName,')') |
140 self.statusText = '|cFFFFFF00Spell|r' | 142 self.statusText = '|cFFFFFF00Spell|r' |
141 self.isAvailable = true | 143 self.isAvailable = true |
142 return | 144 return |
143 end | 145 end |
144 | 146 |
145 -- let's us match spells replaced by talents | 147 -- resolve spell name |
146 local info = kb.DynamicSpells[internalName or spellName] | 148 local info = kb.DynamicSpells[spellName] |
147 if not info then | 149 if not info then |
148 local dynamicType, dynamicIndex, dynamicSubIndex = command:match("(%a+)_(%S+)_(%S+)") | 150 local dynamicType, dynamicIndex, dynamicSubIndex = command:match("(%a+)_(%S+)_(%S+)") |
149 if kb.DynamicSpells[dynamicType] then | 151 if kb.DynamicSpells[dynamicType] then |
150 print('|cFFFF4400resolving dynamic type index:', internalName, spellName, command) | 152 print('|cFFFF4400resolving dynamic type index:', internalName, spellName, command) |
151 dynamicIndex = tonumber(dynamicIndex) | 153 dynamicIndex = tonumber(dynamicIndex) |
196 local actionPrefix = "*"..actionType.."-" | 198 local actionPrefix = "*"..actionType.."-" |
197 local button = SkeletonKeyKey | 199 local button = SkeletonKeyKey |
198 local isAvailable | 200 local isAvailable |
199 local specialButtonType | 201 local specialButtonType |
200 if actionType == 'spell' then | 202 if actionType == 'spell' then |
201 cprint(GetSpellInfo(actionID)) | 203 local realName, _, _, _, _, _, realID = GetSpellInfo(name) |
202 local dynamicInfo = kb.DynamicSpells[name] | 204 if realName and (realName ~= name) then |
205 print(' *** "', name, '" resolves to something else...', realName, realID) | |
206 --name, actionID = realName, realID | |
207 indexKey = actionType .. '_'.. realID | |
208 end | |
209 | |
210 | |
211 | |
212 local dynamicInfo = kb.DynamicSpells[spellName] | |
203 if dynamicInfo then | 213 if dynamicInfo then |
204 configTable.assignedKeys = configTable.assignedKeys or {GetBindingKey(configTable.command) } | 214 configTable.assignedKeys = configTable.assignedKeys or {GetBindingKey(configTable.command) } |
205 | 215 |
206 cprint('|cFF00FFFFDynamicInfo:|r', dynamicInfo.dynamicType, table.concat(configTable.assignedKeys, ',')) | 216 cprint('|cFF00FFFFDynamicInfo:|r', dynamicInfo.dynamicType, table.concat(configTable.assignedKeys, ',')) |
207 for k, v in pairs(dynamicInfo) do | 217 for k, v in pairs(dynamicInfo) do |