Thread Tools Display Modes
Prev Previous Post   Next Post Next
01-14-09, 12:09 PM   #11
Bruners
A Flamescale Wyrmkin
 
Bruners's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 125
you also need to register an event for the tag like this
Code:
oUF.Tags["[customtag]"] = function(unit)
  local m, n = UnitHealthMax(unit), UnitHealth(unit)
  return m == 0 and 0 or n ~= m and string.format("-%s|r", (m - n)) or m == n and m
end

oUF.TagEvents["[customtag]"] = "UNIT_HEALTH UNIT_MAXHEALTH"
and to use it something like this
Code:
	local hp = CreateFrame"StatusBar"
	hp:SetHeight(20)
	hp:SetStatusBarTexture(texture)
	hp:SetPoint(top)

	local hpp = hp:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmallRight')
	hpp:SetPoint("RIGHT", -2, 0)
	hpp:SetTextColor(1, 1, 1)
	self:Tag(hpp, "[customtag]")
	
	hp.bg = hpbg
	self.Health = hp
 
 

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF - Layout discussion


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