Thread Tools Display Modes
06-27-10, 11:59 AM   #1
Politig
A Chromatic Dragonspawn
AddOn Compiler - Click to view compilations
Join Date: May 2009
Posts: 176
oUF ALZA help

This is the health portion of oUF ALZA's code:
Code:
    local hp = CreateFrame("StatusBar", nil, self)
    hp:SetStatusBarTexture(settings.texture)
    hp.frequentUpdates = true
    hp:SetPoint("TOPRIGHT")
    hp:SetPoint("TOPLEFT")
    hp:SetHeight(s.ManaBarHeight==0 and s.Height or (s.Height - s.ManaBarHeight - 1))

    local hpbg = hp:CreateTexture(nil, "BACKGROUND")
    hpbg:SetTexture(settings.texture)
    hpbg:SetAllPoints(hp)

    local hpp = MakeFS(hp)
    if(unit=="player") then
        hpp:SetPoint("BOTTOMRIGHT", hp, "TOPRIGHT", 2, 3)
    elseif(unit=="target" or unit=="pet") then
        hpp:SetPoint("BOTTOMLEFT", hp, "TOPLEFT", -2, 3)
    end

    hp.bg = hpbg
    hp.value = hpp
    self.Health = hp
    self.OverrideUpdateHealth = OverrideUpdateHealth
In game, it ends up looking like what it does on the oUF ALZA download page. I don't understand what is making the current health green, and no matter what I try, I can't hide the maximum health text on the player frame (in white). Changing the settings for anything seems to alter them both. My goal is just to show current health. Any suggestions?
  Reply With Quote
06-27-10, 12:16 PM   #2
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
That's the code to create the healthbar and a fontstring (hpp). I suppose the fontstring contains what you are looking for. However, you have to look for hpp (or hp.value) in the rest of the code. I suppose it's an health function somewhere at the top of the file.
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."

  Reply With Quote
06-27-10, 04:06 PM   #3
Politig
A Chromatic Dragonspawn
AddOn Compiler - Click to view compilations
Join Date: May 2009
Posts: 176
Originally Posted by Dawn View Post
That's the code to create the healthbar and a fontstring (hpp). I suppose the fontstring contains what you are looking for. However, you have to look for hpp (or hp.value) in the rest of the code. I suppose it's an health function somewhere at the top of the file.
Code:
--[[ Font creation func ]]
MakeFS = function(parent, justify)
    local f = parent:CreateFontString(nil, "OVERLAY")
    f:SetFont(settings.font, settings.fsize, "OUTLINE")
    f:SetShadowColor(0, 0, 0, 0)
    if(justify) then f:SetJustifyH(justify) end
    return f
end
Only thing I could find. How would you unlink the two texts? Change the MakeFS thing? (lol I'm a noob)
  Reply With Quote
06-27-10, 11:40 PM   #4
Rostok
A Flamescale Wyrmkin
Join Date: Jul 2008
Posts: 127
That's just the function to create the FS, search for the OverrideUpdateHealth function in the layout.
  Reply With Quote
07-07-10, 06:01 PM   #5
Berb
A Deviate Faerie Dragon
 
Berb's Avatar
Join Date: Nov 2008
Posts: 15
Line 91 in style.lua.
Code:
if(unit=="player") then
     bar.value:SetFormattedText("|cff%02x%02x%02x%s|r %s", r*255, g*255, b*255, min, max)
I'm not exactly sure how to change it without being in game, but try:
Code:
if(unit=="player") then
     bar.value:SetFormattedText("|CFF99FF00%s|r", min)
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF ALZA help


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