comparison SkeletonKey/KeySlot.lua @ 21:564015ef0317

- use pet spellbook subtext to categorize dynamic buttons
author Nenue
date Sat, 30 Jul 2016 20:28:15 -0400
parents 67db6b712bf3
children f6dd297cb812
comparison
equal deleted inserted replaced
20:5250877895ae 21:564015ef0317
372 self.bindingText= kb.BindingString(unpack(kb.TalentBindings[self.actionID])) 372 self.bindingText= kb.BindingString(unpack(kb.TalentBindings[self.actionID]))
373 end 373 end
374 374
375 end 375 end
376 elseif self.isDynamic == 'petaction' then 376 elseif self.isDynamic == 'petaction' then
377 local specialNum = self.command:match("special(%d)") 377 local specialType, specialNum = self.command:match("petaction_([%a%s]+)_(%d)")
378 if specialNum then 378 if specialType and specialNum then
379 self.statusText = L('Pet Special %%d'):format(specialNum) 379 print('pet skill|cFF00FF00', specialType..'|r', specialNum)
380 self.statusText = L(specialType..' %%d'):format(specialNum)
380 else 381 else
381 self.statusText = L('Pet Action') 382 self.statusText = L('Pet Action')
382 end 383 end
383 self.bindingText = kb.BindingString(GetBindingKey(self.command)) 384 self.bindingText = kb.BindingString(GetBindingKey(self.command))
384 else 385 else
395 396
396 397
397 if self.actionType == 'spell' then 398 if self.actionType == 'spell' then
398 self.icon:SetTexture(GetSpellTexture(self.actionID)) 399 self.icon:SetTexture(GetSpellTexture(self.actionID))
399 end 400 end
401 else
402 self.ignoreTexture:Hide()
400 end 403 end
401 404
402 if not self.isAvailable then 405 if not self.isAvailable then
403 self.bind:SetTextColor(0.7,0.7,0.7,1) 406 self.bind:SetTextColor(0.7,0.7,0.7,1)
404 else 407 else
501 504
502 isAvailable = GetSpellInfo(name) 505 isAvailable = GetSpellInfo(name)
503 end 506 end
504 elseif actionType == 'petaction' then 507 elseif actionType == 'petaction' then
505 isDynamic = 'petaction' 508 isDynamic = 'petaction'
506 isAvailable = (kb.PetCache.spellslot and kb.PetCache.spellslot[name]) 509 local specialType, specialNum = command:match(actionType..'_([%a%s]+)_(%d)')
510
511 if kb.PetCache.subtext[specialType] and kb.PetCache.subtext[specialType][tonumber(specialNum)] then
512 print('***dynamic pet thign', specialType, specialNum)
513 isAvailable = true
514 --[[ i, spellName, subText, spellID, texture, specialNum[subText ]]
515 pickupSlot, name, specialType, actionID, icon, specialNum = unpack(kb.PetCache.subtext[specialType][tonumber(specialNum)])
516 pickupBook = BOOKTYPE_PET
517 end
518
519
507 elseif actionType == 'macro' then 520 elseif actionType == 'macro' then
508 if not actionID then 521 if not actionID then
509 actionID = GetMacroIndexByName(name) 522 actionID = GetMacroIndexByName(name)
510 end 523 end
511 isAvailable = true 524 isAvailable = true