Download
(2Kb)
Download
Updated: 06-25-09 01:14 AM
Pictures
File Info
Updated:06-25-09 01:14 AM
Created:06-25-09 01:14 AM
Downloads:2,581
Favorites:7
MD5:

oUF Aura Tracker

Version: 1.0
by: Thizzelle [More]

Adds auras to oUF frames.

(ported from Shadowed Unit Frames AuraTracker by Proditor)

example

Code:
-- update

local function updateAuraTrackerTime(self, elapsed)
	if (self.active) then
		self.timeleft = self.timeleft - elapsed

		if (self.timeleft <= 5) then
			self.text:SetTextColor(1, 0, 0) -- red
		else
			self.text:SetTextColor(1, 1, 1) -- white
		end
		
		if (self.timeleft <= 0) then
			self.icon:SetTexture("")
			self.text:SetText("")
		end	
		self.text:SetFormattedText("%.1f", self.timeleft)
	end
end

-- layout

self.Portrait = CreateFrame("PlayerModel", nil, self)

self.Portrait:SetWidth(32)
self.Portrait:SetHeight(32)
self.Portrait:SetPoint("BOTTOMRIGHT", self, "BOTTOMLEFT", -3, 0)
self.Portrait.type = "3D"

self.Portrait.bg = CreateFrame("Frame", nil, self)
self.Portrait.bg:SetFrameStrata('BACKGROUND')
self.Portrait.bg:SetWidth(self.Portrait:GetWidth())
self.Portrait.bg:SetHeight(self.Portrait:GetHeight())
self.Portrait.bg:SetPoint("CENTER", self.Portrait)
self.Portrait.bg:SetBackdrop(backdrop)
self.Portrait.bg:SetBackdropColor(0,0,0,.6)

-- Aura Tracker
	
self.AuraTracker = CreateFrame("Frame", nil, self)
self.AuraTracker:SetWidth(self.Portrait:GetWidth())
self.AuraTracker:SetHeight(self.Portrait:GetHeight())
self.AuraTracker:SetPoint("CENTER", self.Portrait, "CENTER")
self.AuraTracker:SetFrameStrata("HIGH")
	
self.AuraTracker.icon = self.AuraTracker:CreateTexture(nil, "ARTWORK")
self.AuraTracker.icon:SetWidth(self.Portrait:GetWidth()+1)
self.AuraTracker.icon:SetHeight(self.Portrait:GetHeight()+1)
self.AuraTracker.icon:SetPoint("CENTER", self.Portrait, "CENTER")
self.AuraTracker.icon:SetTexCoord(0.07,0.93,0.07,0.93)

self.AuraTracker.text = self.AuraTracker:CreateFontString(nil, 'OVERLAY', 'NumberFontNormal')
self.AuraTracker.text:SetPoint('CENTER', self.AuraTracker, 0, 0)
	
self.AuraTracker:SetScript("OnUpdate", updateAuraTrackerTime)

Optional Files (0)


Post A Reply Comment Options
Unread 06-25-09, 02:57 PM  
Thizzelle
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 29
Uploads: 1
Originally posted by Taroven
Seems like it can be used standalone from the portrait, according to the example code.

I'll have to try it out, looks nifty.
you basically could place it anywhere; a standalone frame or the health bar frame, etc.
Last edited by Thizzelle : 06-25-09 at 03:00 PM.
Report comment to moderator  
Reply With Quote
Unread 06-25-09, 05:58 AM  
Taroven
A Cyclonian
AddOn Author - Click to view AddOns

Forum posts: 49
File comments: 837
Uploads: 11
Originally posted by mrruben5
I was wondering, can this be used without a portrait? Just putting the texture over the unitframe in the center seems enough for me.
Seems like it can be used standalone from the portrait, according to the example code.

I'll have to try it out, looks nifty.
Report comment to moderator  
Reply With Quote
Unread 06-25-09, 04:43 AM  
mrruben5
Guest

Join Date: Not Yet
Forum posts: 0
File comments: 0
Uploads: 0
I was wondering, can this be used without a portrait? Just putting the texture over the unitframe in the center seems enough for me.
Report comment to moderator  
Edit/Delete Message Reply With Quote
Post A Reply



Category Jump: