Download
(1 Kb)
Download
Updated: 12-11-09 03:37 PM
Pictures
File Info
Updated:12-11-09 03:37 PM
Created:09-02-09 05:03 AM
Downloads:3,171
Favorites:8
MD5:
oUF ThreatBar
Version: 1.0.5
by: wurmfood [More]
A simple threat bar that can be added to an oUF layout. Instructions are in the lua.

Though my programming sucks, I think I have most of the bugs worked out. I'm happy to take suggestions or smacks upside the head, though.

Example:

Code:
if( unit == 'player') then
	self.ThreatBar = CreateFrame("StatusBar", self:GetName()..'_ThreatBar', UIParent)
	self.ThreatBar:SetPoint('CENTER', UIParent, 'CENTER', 0, 0)
	self.ThreatBar:SetHeight(10)
	self.ThreatBar:SetWidth(150)
	
	self.ThreatBar:SetStatusBarTexture(texture)
	self.ThreatBar:SetBackdrop(backdrop)
	self.ThreatBar:SetBackdropColor(0, 0, 0, 0)
	
	self.ThreatBar.Text = self.ThreatBar:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmall')
	self.ThreatBar.Text:SetPoint('CENTER', self.ThreatBar)
	
	self.ThreatBar.bg = self.ThreatBar:CreateTexture(nil, 'BORDER')
	self.ThreatBar.bg:SetAllPoints(self.ThreatBar)
	self.ThreatBar.bg:SetTexture(0,0,0)
	
	self.ThreatBar.useRawThreat = false
end
1.0.5
- updated embed support for 3.3
- Fixed stupid error where threat at exactly 30% was showing red

1.0.4
- TOC update for 3.3

1.0.3
- Fixed a stupid mistake. Should be the last update for a while.

1.0.2
- Fixed a bug with useRawThreat
- Added options: usePlayerTarget and maxThreatVal
- Cleaned up some code.

1.0.1
- Fixed problem with the UI loading while in combat causing oUF_Threat to freak and stop working.
Optional Files (0)


Archived Files (6)
File Name
Version
Size
Author
Date
1.0.5
1kB
wurmfood
12-11-09 03:11 PM
1.0.4
1kB
wurmfood
12-08-09 04:42 PM
1.0.3
1kB
wurmfood
09-08-09 04:42 PM
1.0.2
1kB
wurmfood
09-06-09 01:51 PM
1.0.1
1kB
wurmfood
09-03-09 01:44 PM
1.0
1kB
wurmfood
09-02-09 05:03 AM


Post A Reply Comment Options
Unread 09-03-09, 08:13 AM  
Monolit
A Black Drake
AddOn Author - Click to view AddOns

Forum posts: 81
File comments: 430
Uploads: 8
good idea

I've been looking for something like this for a while, but there is currently a problem when you load UI during combat:
Interface\AddOns\oUF_ThreatBar\oUF_ThreatBar.lua:36: attempt to call method 'SetValue' (a nil value)
Count: 1

Call Stack:
[C]: in function `SetValue'
Interface\AddOns\oUF_ThreatBar\oUF_ThreatBar.lua:36: in function `func'
Interface\AddOns\oUF\ouf.lua:506: in function <Interface\AddOns\oUF\ouf.lua:501>
(tail call): ?
Monolit is offline Report comment to moderator  
Reply With Quote
Unread 09-03-09, 01:46 PM  
wurmfood
A Flamescale Wyrmkin
AddOn Author - Click to view AddOns

Forum posts: 122
File comments: 33
Uploads: 5
Should be fixed now. The bar was trying to update before the bar existed, but I found a way around it.
wurmfood is offline Report comment to moderator  
Reply With Quote
Unread 11-22-09, 05:20 AM  
jasje
A Chromatic Dragonspawn
 
jasje's Avatar
AddOn Author - Click to view AddOns

Forum posts: 150
File comments: 282
Uploads: 8
I've added this to my layout, but it doesnt show up what so ever
what i did was dl your file added the lines in my lay-out and added oUF_Threatmeter to my toc

help
__________________

Tukui | Github
Last edited by jasje : 11-22-09 at 07:09 AM.
jasje is offline Report comment to moderator  
Reply With Quote
Unread 12-15-09, 12:00 PM  
Kudane
Co-Founder
 
Kudane's Avatar
AddOn Author - Click to view AddOns

Forum posts: 214
File comments: 79
Uploads: 3
the code most likely goes in a .LUA file not the .TOC file.
Kudane is offline Report comment to moderator  
Reply With Quote
Unread 02-14-10, 08:17 AM  
Involar
A Kobold Labourer

Forum posts: 0
File comments: 5
Uploads: 0
Could anyone give me a tip on what to write in my layout lua to implement this? Or maybe how to implement it as a separate addon/frame. I just cant find any guides on what those define local ... mean and how to register them in the lua. Thank you in advance.
Involar is offline Report comment to moderator  
Reply With Quote
Unread 02-16-10, 09:27 AM  
wurmfood
A Flamescale Wyrmkin
AddOn Author - Click to view AddOns

Forum posts: 122
File comments: 33
Uploads: 5
The example code provided should be able to be copied straight into the layout function in your layout. The only things that have to be defined are the texture and backdrop variables. If you need additional help, I'd suggest downloading oUF_Banthis and look at how it's set up in there.

There are other addons independent of oUF that will do the same thing.
wurmfood is offline Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: