Mercurial > wow > skeletonkey
comparison SkeletonKey/ActionTypes.lua @ 26:c081f117c19d
- postpone secure frame attributes triggered during combat
| author | Nenue |
|---|---|
| date | Sun, 31 Jul 2016 16:45:02 -0400 |
| parents | 4804892802fe |
| children |
comparison
equal
deleted
inserted
replaced
| 25:74a70720f622 | 26:c081f117c19d |
|---|---|
| 282 profOffset = i, | 282 profOffset = i, |
| 283 profIndex = index, | 283 profIndex = index, |
| 284 spellOffset = (spellOffset+j), | 284 spellOffset = (spellOffset+j), |
| 285 spellNum = j | 285 spellNum = j |
| 286 } | 286 } |
| 287 KeyBinderKey:SetAttribute("*type-profession_"..i .. '_' ..j, "spell") | 287 |
| 288 KeyBinderKey:SetAttribute("*spell-profession_"..i .. '_' ..j, spellName) | 288 kb.SecureAttribute(KeyBinderKey, "*type-profession_"..i .. '_' ..j, "spell") |
| 289 kb.SecureAttribute(KeyBinderKey, "*spell-profession_"..i .. '_' ..j, spellName) | |
| 289 | 290 |
| 290 kb.ProfessionCache[i .. '_' .. j] = profInfo | 291 kb.ProfessionCache[i .. '_' .. j] = profInfo |
| 291 kb.ProfessionCache[spellName] = profInfo | 292 kb.ProfessionCache[spellName] = profInfo |
| 292 kb.ProfessionCache[spellID] = profInfo | 293 kb.ProfessionCache[spellID] = profInfo |
| 293 print(' |cFF0088FF['..i..']|r|cFFFF44BB['..spellOffset+i..']|r', spellName, "profession_"..i .. '_' ..j) | 294 print(' |cFF0088FF['..i..']|r|cFFFF44BB['..spellOffset+i..']|r', spellName, "profession_"..i .. '_' ..j) |
| 323 | 324 |
| 324 local entry = {i, spellName, subText, spellID, texture, specialNum[subText]} | 325 local entry = {i, spellName, subText, spellID, texture, specialNum[subText]} |
| 325 | 326 |
| 326 kb.PetCache.special[spellName] = entry | 327 kb.PetCache.special[spellName] = entry |
| 327 kb.PetCache.subtext[subText][specialNum[subText]] = entry | 328 kb.PetCache.subtext[subText][specialNum[subText]] = entry |
| 328 KeyBinderMacro:SetAttribute("*macrotext-petaction_"..subText.."_"..specialNum[subText], "/cast "..spellName) | 329 kb.SecureAttribute(KeyBinderMacro, "*macrotext-petaction_"..subText.."_"..specialNum[subText], "/cast "..spellName) |
| 329 | 330 |
| 330 print('|cFF00FFFFspecial['..spellName..']|r', '\n','|cFF00FFFFsubtext['..subText..']['..specialNum[subText]..']|r', '=>', i, spellName, subText, spellID, texture, specialNum[subText]) | 331 print('|cFF00FFFFspecial['..spellName..']|r', '\n','|cFF00FFFFsubtext['..subText..']['..specialNum[subText]..']|r', '=>', i, spellName, subText, spellID, texture, specialNum[subText]) |
| 331 end | 332 end |
| 332 | 333 |
| 333 if spellID then | 334 if spellID then |
| 388 if button.isDynamic == dynamicType then | 389 if button.isDynamic == dynamicType then |
| 389 kb.UpdateSlot(button, true) | 390 kb.UpdateSlot(button, true) |
| 390 end | 391 end |
| 391 end | 392 end |
| 392 end | 393 end |
| 394 | |
| 395 kb.pendingAttributes = {} | |
| 396 kb.SecureAttribute = function(target, name, value) | |
| 397 if InCombatLockdown() then | |
| 398 tinsert(kb.pendingAttributes, {target, name, value}) | |
| 399 kb:RegisterEvent('PLAYER_REGEN_ENABLED') | |
| 400 else | |
| 401 | |
| 402 print(target:GetName(), 'attribute', '"'.. tostring(name)..'" = "'..tostring(value)..'"') | |
| 403 target:SetAttribute(name, value) | |
| 404 end | |
| 405 end | |
| 406 | |
| 407 kb.PLAYER_REGEN_ENABLED = function() | |
| 408 if #kb.pendingAttributes >= 1 then | |
| 409 local args = tremove(kb.pendingAttributes) | |
| 410 while args do | |
| 411 local target, name, value = unpack(args) | |
| 412 print(target:GetName(), 'attribute', '"'.. tostring(name)..'" = "'..tostring(value)..'"') | |
| 413 target:SetAttribute(name, value) | |
| 414 args = tremove(kb.pendingAttributes) | |
| 415 end | |
| 416 end | |
| 417 end |
