View Single Post
04-15-24, 12:16 PM   #3
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,950
That is a good point. I totally forgot it didn't have a height either.

But, I somehow managed to get things to work again as a status bar.

Can't think what is different outside of using a different texture. Instead of setting BarTexture in the xml to an atlas ( example from one of the blizzard files) , I used SetStatusBarTexture with the texture used in the example here ( https://warcraft.wiki.gg/wiki/UIOBJECT_StatusBar ).

I changed the following in ApplyLayout after changing the Frame to StatusBar in the xml and removing the alternative bar texture section.
Lua Code:
  1. -- Set up the BarTexture Position
  2.     --newFrame.Bar:ClearAllPoints()
  3.     --newFrame.Bar:SetPoint("LEFT",newFrame,"LEFT",0,0)
  4.     --newFrame.Bar:SetWidth(50)
  5.    
  6.     newFrame:SetStatusBarTexture("Interface/TargetingFrame/UI-StatusBar")
  7.     newFrame:SetStatusBarColor(0, 1, 0)
  8.     newFrame:SetMinMaxValues(0, 1)
  9.     newFrame:SetValue(0)

And the following in UpdateBarTexture
Lua Code:
  1. --unitFrame.HealthBar.Bar:SetWidth(offset * activeLayout.width)
  2.     --unitFrame.HealthBar.Bar:SetColorTexture(r,g,b,1)    
  3.    
  4.     unitFrame.HealthBar:SetStatusBarColor(r,g,b)
  5.     unitFrame.HealthBar:SetMinMaxValues(0, maxHealth)
  6.     unitFrame.HealthBar:SetValue(health)

The bar is shrinking and the color is changing as expected. Thanks for the reminder though.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote