Thread Tools Display Modes
Prev Previous Post   Next Post Next
04-24-16, 11:07 AM   #1
Sharji
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: May 2015
Posts: 14
Getting all button spells/states

Hello

It is about TDDps addon. I'm author of it.

I have a problem with multi state bars (for example when rogue gets in stealth, action bar changes to other one). How can I actually read all spells that are beneath all of the buttons? In multiple states? Here is the example code of scaning ElvUI (LibActionButton):

Lua Code:
  1. function TDButton_FetchElvUI()
  2.     local ret = false;
  3.     for x = 1, 10 do
  4.         for i = 1, 12 do
  5.             local button = _G['ElvUI_Bar' .. x .. 'Button' .. i];
  6.             if button then
  7.                 local spellId = button:GetSpellId();
  8.                 if spellId then
  9.                     local actionName, _ = GetSpellInfo(spellId);
  10.                     if actionName then
  11.                         if TDButton_Spells[actionName] == nil then
  12.                             TDButton_Spells[actionName] = {};
  13.                         end
  14.                         ret = true;
  15.                         tinsert(TDButton_Spells[actionName], button);
  16.                     end
  17.                 end
  18.             end
  19.         end
  20.     end
  21.     return ret;
  22. end

Is there a way to make it work? Scanning them each time bar changes does not seem like a good idea
  Reply With Quote
 

WoWInterface » Developer Discussions » General Authoring Discussion » Getting all button spells/states


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off