Thread Tools Display Modes
12-21-10, 06:24 PM   #1
PunkLV
A Defias Bandit
Join Date: Jun 2008
Posts: 2
Healthbar in raid frames is out of borders after widening

Hello, so, I've managed to get raid frames wider by changing default \AddOns\oUF_Diablo\units\raid.lua
Code:
    self.cfg.width = 64
    self.cfg.height = 64
to 192x64. This worked out great, except for alive raid members.

To extent of my coding skills, I assume the folowing part has the math done not in the way I'd expect:
Code:
--update health func
  local updateHealth = function(bar, unit, min, max)
    local d = floor(min/max*100)    
    --apply bar width
    if d == 100 then
      bar.back:SetWidth(0.01) --fix (0) makes the bar go anywhere
    elseif d < 100 then
      local w = bar.w
      bar.back:SetWidth(w-(w*d/100)) --calc new width of bar based on size of healthbar
    end    
    local color
    local dead
    if UnitIsDeadOrGhost(unit) or not UnitIsConnected(unit) then
      color = {r = 0.4, g = 0.4, b = 0.4}
      dead = 1
and this one:
Code:
    --new fake statusbar
    local n = h:CreateTexture(nil,"BACKGROUND",nil,-6)
    n:SetPoint("TOPLEFT",h,"TOPLEFT",0,0)
    n:SetPoint("BOTTOMLEFT",h,"BOTTOMLEFT",0,0)
    n:SetPoint("RIGHT", t, "LEFT", 0, 0 ) --right point of n will anchor left point of t
    n:SetTexture(self.cfg.health.texture)
    h.new = n
    --h.new:SetVertexColor(0.15,0.15,0.15,1)
as I see it, the math is attached abstractly to a value I am remotely messing with, however, I just can't figure which one.

Searched the forum - found nothing in regard of this. Can anyone help me with this please?
  Reply With Quote
12-24-10, 12:41 PM   #2
PunkLV
A Defias Bandit
Join Date: Jun 2008
Posts: 2
So, thats it, I guess. Too bad.
  Reply With Quote
12-27-10, 11:52 AM   #3
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Things tend to get rather busy for everyone around Christmas you know...

Anyway, I don't see any relation between the code and the screenshot you posted. I'd suggest you to split the texture into three pieces and only stretch the center part. This would allow you to anchor the border to the left and right of the frame, and without any extra math have it grow based on the size of the frame.
__________________
「貴方は1人じゃないよ」
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Healthbar in raid frames is out of borders after widening


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