View Single Post
10-21-08, 07:21 AM   #141
Frayol
A Deviate Faerie Dragon
 
Frayol's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2008
Posts: 10
Originally Posted by Bruners View Post
im using this to set pvp icon, might be overkill or completly wrong way of doing it but it looks nice here
I orinally used this for the PvP icon:

Code:
self.PvP = self.Power:CreateTexture(nil, "OVERLAY")
self.PvP:SetPoint("CENTER", self.Health, "CENTER", 0, 10)
self.PvP:SetHeight(33)
self.PvP:SetWidth(33)
What I have now is the text [PvP] appearing instead of the icon. If you are interested I used:

Code:
local updatePvpPlayer = function(self, unit)
	if (UnitIsPVP("player")) then
		self.PVP:SetText("[PvP]")
	else
		self.PVP:SetText("")
	end
end
Code:
self.PVP = self.Health:CreateFontString(nil, "OVERLAY")
self.PVP:SetPoint("CENTER", self.Health, "TOP", 0, 20)
self.PVP:SetFont(font, 18, "OUTLINE")
self.PVP:SetText("[PvP]")
self.PVP:SetTextColor(1, 0, 0)
self.PVP:SetShadowOffset(1,-1)
self.PVP:SetShadowColor(0, 0, 0, .7)
self.UNIT_FACTION = updatePvpPlayer
For the target I used exactly the same bit of code, but as local called "updatePvpTarget". Not sure if there is a better way or not, but this works for me.