Download
(3Kb)
Download
Updated: 11-29-12 06:34 PM
Updated:11-29-12 06:34 PM
Created:11-13-11 12:28 PM
Downloads:2,804
Favorites:4
MD5:

oUF SVengeance

Version: r2.1
by: Acca85 [More]

oUF_SVengeance for MoP!
This is my implementation of an oUF element that shows Vengeance for tanks.

Since in MoP we can't calculate a max vengeance anymore but I miss this element on my ui I decided to bring it back; here's how it works now:
- It does NOT calculate a max vengeance value, at the first run the venge.max will be 1
- Every time your vengeance buff updates the current value is confronted against the old one, if it's bigger it becomes the new max.
- The vengeance max is saved per character, meaning that your raiding toon will have a saved max of ex: 100k while the BM monk (or whatever) you are leveling will have it's max set to ex: 200.

Example of usage:
Add oUF_SVengeance to your layout's optdeps:

Code:
## OptionalDeps: oUF_SVengeance
Add the bar to your player frame in your layout, ex:
lua Code:
  1. if IsAddOnLoaded("oUF_SVengeance") then
  2.  local v = CreateFrame("statusbar", nil, self)
  3.  v:SetHeight(myheight)
  4.  v:SetWidth(mywidth)
  5.  v:SetPoint(fx, p, fz, xo, yo)
  6.  v.Usetext = true
  7.  self.Vengeance = v
  8. end
Using this code above you'll create a simple status bar, that fills from left to right.
On this element will be automatically placed a fontstring in its middle to show the vengeance value as ex: 4.5k / 16.80k

Options list (you can find this on top in the main lua file.)
Code:
Options:
Vengeange:SetStatusBarTexture
	Set a Statusbar texture, default will be used if none specified

Vengeance.Value
	Fontstring, default will be created if none specified. Requires Usetext to not be false.

Vengeance.Usetext = [true | "perc" | false]
	true = shows the amount of vengeance on the bar as ex: 850 / 16.20k if <1000 otherwise will show ex: 1.3k / 16.20k
	"perc" = shows the value as a % of the max venge, implies true. Ex: 8%
	"buff" = shows the amount of bonus AP from vengeance, implies true. Ex: 1300
	"ap" = shows the current amount of ap you have (the same number displayed in the character info pane), implies true.	Ex: 6800
	false = doesn't show any text

Vengeance.Orientation = ["VERTICAL" | "HORIZONTAL"]
	by default is HORIZONTAL, meaning left to right.
	Set to "VERTICAL" to have a bar that fills from bottom to top

Vengeance.TextOverride = function(element, curvengeance)
	Can be used to override the default text, requires Vengeance.Usetext to not be false
	curvengeance is the venge you have, ex: 1200
	element.max can be used to retrieve the max venge you can obtain
	Use element.Value:SetText() to set the text.

Vengeance.PostUpdate = function(element,curvengeance, vengepercent, attackpower)
	element.max can be used to retrieve the max venge you can obtain
	Can be used for further customization, if no function is provided the bar will be colored red if at low venge value, green at high vengeance value
I did NOT fully test this version, however it should work just like in Cata.
If you find any bug or have suggestions, please send a comment.

R2.1
ToC Update
Fix for 5.1 UnitBuff
New Feature: Vegneance is now saved per boss.

--
R1.2
Added option Vengeance.InverseOrientation = [true | false]
Inverts the fill method:
left to right becomes right to left
bottom to top becomes top to bottom

Previous Versions:
R1.1
-TOC Update to 4.3
-Fixed chek for tank spec on change spec
-Added options to display 2 new value:
"buff" to show how much vengeance you have, it is like the default text minus the /maxvenge
"ap" to show your total Attack Power, as shown in the character pane
-Minor Code Tweaks and improvements. (check override functions parameters)

--
Fixed Typo in the Disable function.
Post A Reply Comment Options
Unread 11-28-12, 12:46 PM  
Acca85
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 33
Uploads: 6
Re: A Fix for Patch 5.1

Yes that fixes it, my local copy is already working. I'll upload a 5.1 compatible version as soon I've added a new feature.
Originally Posted by Screamie
Hi,

what i wrote here http://www.wowinterface.com/forums/s...ad.php?t=45267 about the UnitAura/UnitBuff calls helps on your Addon too. Fix the Line 75 to:

Lua Code:
  1. _, _, _, _, _, _, _, _, _, _, _, _, _, _, value1 = UnitBuff(unit, spell, nil)
and bit works again

Greetings Screamie
Report comment to moderator  
Reply With Quote
Unread 11-28-12, 11:31 AM  
Screamie
A Defias Bandit
AddOn Author - Click to view AddOns

Forum posts: 2
File comments: 12
Uploads: 1
A Fix for Patch 5.1

Hi,

what i wrote here http://www.wowinterface.com/forums/s...ad.php?t=45267 about the UnitAura/UnitBuff calls helps on your Addon too. Fix the Line 75 to:

Lua Code:
  1. _, _, _, _, _, _, _, _, _, _, _, _, _, _, value1 = UnitBuff(unit, spell, nil)
and bit works again

Greetings Screamie
Last edited by Screamie : 11-28-12 at 11:32 AM.
Report comment to moderator  
Reply With Quote
Unread 11-12-12, 06:34 AM  
Acca85
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 33
Uploads: 6
It is not per fight, I'm doing this
since UNIT_AURA fires too often, I'm registering for UNIT_ATTACK_POWER, 'cause if my attack power changes means my vengeance value changed, so when UNIT_ATTACK_POWER fires
_, _, _, _, _, _, _, _, _, _, _, _, _, value1 = UnitBuff(unit, spell, nil)
where unit is player, spell is vengeance spell id; value1 is the first value displayed in the aura tooltip, so for the vengeance buff it's the venge value.
And then:
Venge is the vengeance element, SVengeanceBarMax is the saved variable (per character)
Code:
if value1 == nil then
		Venge:Hide()
		return 
	else
		if value1 > Venge.max then
			Venge.max = value1
			oUF_SVengeanceBarMax = value1
		end
		Venge:Show()
	end
Originally Posted by zork
The idea with new and old max Vengeance per fight is actually quite good.

I got rid of the bar and use an aura tracker now instead. UnitAura now delivers the tooltip values. Thus it is possible to track the Vengeance buff and get the current Vengeance value directly from checking UnitAura.
Report comment to moderator  
Reply With Quote
Unread 11-12-12, 04:26 AM  
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1740
File comments: 3728
Uploads: 77
The idea with new and old max Vengeance per fight is actually quite good.

I got rid of the bar and use an aura tracker now instead. UnitAura now delivers the tooltip values. Thus it is possible to track the Vengeance buff and get the current Vengeance value directly from checking UnitAura.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
Last edited by zork : 11-12-12 at 04:28 AM.
Report comment to moderator  
Reply With Quote
Unread 03-19-12, 07:13 PM  
Goldpaw
A Wyrmkin Dreamwalker
AddOn Author - Click to view AddOns

Forum posts: 56
File comments: 17
Uploads: 21
SetMinMaxValues bug in line 81 (at least for me)

Message: ...unitframes\plugins\oUF_SVengeance\oUF_SVengeance.lua:81: Usage: <unnamed>:SetMinMaxValues(min, max)
Appears as though the 'max' value isn't set by default, and thus it tries to set it as a nil value which again of course causes the error.

I solved it easily by adding Vengeance.max = 1 (any values but 0 and nil will do) to my Vengeance object, but thought I'd let you know anyway.
Last edited by Goldpaw : 03-19-12 at 07:17 PM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump:

Support AddOn Development!

You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.