comparison SkeletonKey/ActionTemplates.lua @ 66:41f367b832a2

SecureTemplate attribute names and values match up with reality
author Nenue
date Sat, 10 Sep 2016 20:39:53 -0400
parents 556e075983a6
children ecd6c6116b9c
comparison
equal deleted inserted replaced
65:556e075983a6 66:41f367b832a2
139 local indexKey = actionType..'_'..actionID 139 local indexKey = actionType..'_'..actionID
140 local buttonTypeKey, buttonTypeValue = "*type-"..name, actionType 140 local buttonTypeKey, buttonTypeValue = "*type-"..name, actionType
141 local buttonActionKey, buttonActionValue = "*"..actionType.."-"..name, actionID 141 local buttonActionKey, buttonActionValue = "*"..actionType.."-"..name, actionID
142 local button = key 142 local button = key
143 if actionType == 'spell' then 143 if actionType == 'spell' then
144 buttonTypeKey = "*type-"..name 144 buttonTypeKey = name
145 buttonTypeValue = actionType 145 buttonTypeValue = actionType
146 buttonActionKey = "*"..actionType.."-"..name 146 buttonActionKey = "*"..actionType.."-"..name
147 buttonActionValue = name 147 buttonActionValue = name
148 elseif actionType == 'item' then 148 elseif actionType == 'item' then
149 buttonTypeKey = "*type-"..name 149 buttonTypeKey = name
150 buttonTypeValue = actionType 150 buttonTypeValue = actionType
151 buttonActionKey = "*"..actionType.."-"..name 151 buttonActionKey = "*"..actionType.."-"..name
152 buttonActionValue = actionID 152 buttonActionValue = actionID
153 elseif actionType == 'macro' then 153 elseif actionType == 'macro' then
154 button = macro 154 button = macro
155 buttonTypeKey = "*macro-"..macroName 155 buttonTypeKey = macroName
156 buttonTypeValue = actionID 156 buttonTypeValue = "macro"
157 buttonActionKey = nil 157 buttonActionKey = "*macro-" .. macroName
158 buttonActionValue = name
158 else 159 else
159 button = macro 160 button = macro
160 buttonTypeKey = "*macrotext-"..macroName 161 buttonTypeKey = macroName
161 buttonTypeValue = macroText 162 buttonTypeValue = macroText
162 buttonActionKey = nil 163 buttonActionKey = nil
163 end 164 end
164 165
165 --cprint(actionType, actionID, name) 166 --cprint(actionType, actionID, name)
166 kb.SecureAttribute(button, buttonTypeKey, buttonTypeValue) 167 kb.SecureAttribute(button, "*type-"..buttonTypeKey, buttonTypeValue)
167 if buttonActionKey then 168 if buttonActionKey then
168 --cprint(button:GetName(), buttonActionKey,'=', buttonActionValue) 169 --cprint(button:GetName(), buttonActionKey,'=', buttonActionValue)
169 kb.SecureAttribute(button, buttonActionKey, buttonActionValue) 170 kb.SecureAttribute(button, buttonActionKey, buttonActionValue)
170 end 171 end
171 172
244 245
245 kb.UpdateMacroInfo = function() 246 kb.UpdateMacroInfo = function()
246 for index = 1, GetNumMacros() do 247 for index = 1, GetNumMacros() do
247 local name = GetMacroInfo(index) 248 local name = GetMacroInfo(index)
248 kb.SecureAttribute(KeyBinderMacro, "*type-macro_"..tostring(name), 'macro') 249 kb.SecureAttribute(KeyBinderMacro, "*type-macro_"..tostring(name), 'macro')
249 kb.SecureAttribute(KeyBinderMacro, "*macro-macro_"..tostring(name), i) 250 kb.SecureAttribute(KeyBinderMacro, "*macro-macro_"..tostring(name), index)
250 end 251 end
251 end 252 end
252 253
253 kb.UpdateTalentInfo = function() 254 kb.UpdateTalentInfo = function()
254 if kb.talentsPushed then 255 if kb.talentsPushed then