How to find out how many action bars a players is using? - WoWInterface
Thread Tools Display Modes
02-22-11, 06:12 AM   #1
A Cliff Giant
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 71
How to find out how many action bars a players is using?

Hi all,

I'm using rActionbarStyler for my action bars, and have the 3 main action bars stacked above each other. I am trying to create a frame that adds a background for these, but sometimes I have only 2 action bars shown and sometimes 3.

This is the code I'm using to frame 2 bars:
barbg:SetPoint("TOPLEFT", ActionButton1, "TOPLEFT", -4, 4)
barbg:SetPoint("BOTTOMRIGHT", MultiBarBottomLeftButton12, "BOTTOMRIGHT", 4, -4)
	bgFile =  "Interface\\ChatFrame\\ChatFrameBackground", 
	edgeFile =  "Interface\\ChatFrame\\ChatFrameBackground", 
	edgeSize = 1, 
	insets = 1
barbg:SetBackdropColor(0, 0, 0,.3)
barbg:SetBackdropBorderColor(0, 0, 0,1)
Now I need a way to find if 3 action bars are been used so I can add an 'if' statement to adjust the frame automagicaly.

So how do I find which action bars are been used?
  Reply With Quote
02-22-11, 06:21 AM   #2
A Pyroguard Emberseer
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,739
I use the global actionbar name and the IsShown() widget.

What I use for oUF_Diablo
lua Code:
  1. --code
  2.       if MultiBarBottomRight:IsShown() then
  3.         t:SetTexture("Interface\\AddOns\\rTextures\\bar3")
  4.       elseif MultiBarBottomLeft:IsShown() then
  5.         t:SetTexture("Interface\\AddOns\\rTextures\\bar2")
  6.       else
  7.         t:SetTexture("Interface\\AddOns\\rTextures\\bar1")
  8.       end
  9.       MultiBarBottomRight:HookScript("OnShow", function() t:SetTexture("Interface\\AddOns\\rTextures\\bar3") end)
  10.       MultiBarBottomRight:HookScript("OnHide", function() t:SetTexture("Interface\\AddOns\\rTextures\\bar2") end)
  11.       MultiBarBottomLeft:HookScript("OnShow", function() t:SetTexture("Interface\\AddOns\\rTextures\\bar2") end)
  12.       MultiBarBottomLeft:HookScript("OnHide", function() t:SetTexture("Interface\\AddOns\\rTextures\\bar1") end)
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 02-22-11 at 06:23 AM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » How to find out how many action bars a players is using?

Thread Tools
Display Modes

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