Thread Tools Display Modes
02-16-12, 12:20 PM   #1
laukond
A Black Drake
Join Date: Dec 2011
Posts: 87
Fill a table

I'm trying to fill an empty table to hide my macro names on my bars.
When it's like this is works, but if I remove the "--" from those four lines it does not work.
How do I get it to work on all my bars?

LUA Code:
  1. local actionButtonHotkey = {}
  2. for i=1,12 do
  3. actionButtonHotkey[i] = _G[format("ActionButton%dName",i)]
  4. --actionButtonHotkey[i] = _G[format("MultiBarBottomLeftButton%dName",i)]
  5. --actionButtonHotkey[i] = _G[format("MultiBarBottomRightButton%dName",i)]
  6. --actionButtonHotkey[i] = _G[format("MultiBarRightButton%dName",i)]
  7. --actionButtonHotkey[i] = _G[format("MultiBarLeftButton%dName",i)]]
  8. end
  9.  
  10. for k,v in pairs(actionButtonHotkey) do
  11.     v:SetAlpha(0);
  12. end

Have a good day.

Last edited by laukond : 02-16-12 at 12:26 PM.
  Reply With Quote
02-16-12, 12:52 PM   #2
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
Don't have access to the source atm, but I don't think the extra buttons have different button templates.

There's 12 buttons in each for a total of 120 buttons(?)

So basically you would need your loop to go 1-120 instead of 1-12.
  Reply With Quote
02-16-12, 01:07 PM   #3
laukond
A Black Drake
Join Date: Dec 2011
Posts: 87
they are 1-12 as well.
  Reply With Quote
02-16-12, 01:16 PM   #4
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
Ah sorry, the problem was so obvious it sailed over my head

You're overwriting your keys with subsequent lines.
This should work
LUA Code:
  1. local actionButtonHotkey = {}
  2. for i=1,12 do
  3. actionButtonHotkey[i] = _G[format("ActionButton%dName",i)]
  4. actionButtonHotkey[i+12] = _G[format("MultiBarBottomLeftButton%dName",i)]
  5. actionButtonHotkey[i+24] = _G[format("MultiBarBottomRightButton%dName",i)]
  6. actionButtonHotkey[i+36] = _G[format("MultiBarRightButton%dName",i)]
  7. actionButtonHotkey[i+48] = _G[format("MultiBarLeftButton%dName",i)]]
  8. end
  9.  
  10. for k,v in pairs(actionButtonHotkey) do
  11.     v:SetAlpha(0);
  12. end

Last edited by Dridzt : 02-16-12 at 06:42 PM.
  Reply With Quote
02-16-12, 01:37 PM   #5
laukond
A Black Drake
Join Date: Dec 2011
Posts: 87
works ty :-)
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Fill a table


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