Download
(1 Kb)
Download
Updated: 09-03-2010 02:37 PM
Updated:09-03-2010 02:37 PM
Created:09-02-2010 03:48 AM
Downloads:477
Favorites:2
MD5:
oUF HealPrediction
Version: b3
by: yj589794 [More]
** Cataclysm only! **

Haste has merged this addon into the oUF core, so once there is a published version of the new oUF core I will delete this addon entry.

oUF element to display incoming heal values using the new Blizzard API.

-----------

To display a bar for incoming heals your oUF layout needs to define a parameter self.HealPrediction:
Code:
	local mhpb = CreateFrame('StatusBar', nil, self.Health)
	mhpb:SetPoint('TOPLEFT', self.Health:GetStatusBarTexture(), 'TOPRIGHT', 0, 0)
	mhpb:SetPoint('BOTTOMLEFT', self.Health:GetStatusBarTexture(), 'BOTTOMRIGHT', 0, 0)
	mhpb:SetWidth(width)
	mhpb:SetStatusBarTexture(config.TEXTURE)
	mhpb:SetStatusBarColor(0, 1, 0.5, 0.25)

	local ohpb = CreateFrame('StatusBar', nil, self.Health)
	ohpb:SetPoint('TOPLEFT', mhpb:GetStatusBarTexture(), 'TOPRIGHT', 0, 0)
	ohpb:SetPoint('BOTTOMLEFT', mhpb:GetStatusBarTexture(), 'BOTTOMRIGHT', 0, 0)
	ohpb:SetWidth(width)
	ohpb:SetStatusBarTexture(config.TEXTURE)
	ohpb:SetStatusBarColor(0, 1, 0, 0.25)

	self.HealPrediction = {
		-- status bar to show my incoming heals
		myBar = mhpb,

		-- status bar to show other peoples incoming heals
		otherBar = ohpb,

		-- amount of overflow past the end of the health bar
		maxOverflow = 1.05,

		-- PreUpdate function (optional)
		PreUpdate = function(element, unit)
			...
		end,

		-- PostUpdate function (optional)
		PostUpdate = function(element, unit)
			...
		end,

		-- Override function (optional)
		Override = function(self, event, unit)
			...
		end,
	}
If you only want to display heals from others than you can omit the self.HealPrediction.myBar definition, and similarly if you only wish to see heals from yourself you can omit the self.HealPrediction.otherBar definition.

** ensure status bar width is set correctly or they will not be shown **

---------------------

ToDo:
- Support for vertical bars (maybe, might just need to set orientation in the layout)

---------------------

There is no support for displaying incoming heal values as a text string as this functionality should be added with your own custom oUF Tag, such as:
Code:
oUF.Tags['healpredictionself'] = function(unit)
	local myIncomingHeal = UnitGetIncomingHeals(unit, 'player') or 0

	if myIncomingHeal == 0 then
		return nil
	else
		return myIncomingHeal
	end
end
oUF.TagEvents['healpredictionself'] = 'UNIT_HEAL_PREDICTION'

oUF.Tags['healpredictionother'] = function(unit)
	local myIncomingHeal = UnitGetIncomingHeals(unit, 'player') or 0
	local allIncomingHeal = UnitGetIncomingHeals(unit) or 0

	if(allIncomingHeal < myIncomingHeal) then
		myIncomingHeal = allIncomingHeal
		allIncomingHeal = 0
	else
		allIncomingHeal = allIncomingHeal - myIncomingHeal
	end

	if allIncomingHeal == 0 then
		return nil
	else
		return allIncomingHeal
	end
end
oUF.TagEvents['healpredictionother'] = 'UNIT_HEAL_PREDICTION'

oUF.Tags['healpredictionall'] = function(unit)
	local allIncomingHeal = UnitGetIncomingHeals(unit) or 0

	if allIncomingHeal == 0 then
		return nil
	else
		return allIncomingHeal
	end
end
oUF.TagEvents['healpredictionall'] = 'UNIT_HEAL_PREDICTION'
b3:
- set the minmax statusbar values on all events to make this work for changing targets

b2:
- Set the minmax values on the incoming heal bars when enabling the element

b1:
- initial beta version
Archived Files (2)
File Name
Version
Size
Author
Date
b2
1kB
yj589794
09-02-2010 04:27 PM
b1
1kB
yj589794
09-02-2010 03:48 AM


Post A Reply Comment Options
Old 10-08-2010, 06:08 AM  
ForeverTheGM
A Black Drake
 
ForeverTheGM's Avatar
AddOn Author - Click to view AddOns

Forum posts: 86
File comments: 200
Uploads: 1
When I set maxOverflow to "1" it sometimes overflows anyway, but then snaps back after another update is fired. Is there anyway to prevent this?
ForeverTheGM is offline Report comment to moderator  
Reply With Quote
Old 09-06-2010, 10:24 AM  
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view AddOns

Forum posts: 302
File comments: 49
Uploads: 2
Haste has merged this addon into the oUF core, so once there is a published version of the new oUF core I will delete this addon entry.
yj589794 is offline Report comment to moderator  
Reply With Quote
Old 09-03-2010, 03:57 PM  
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view AddOns

Forum posts: 302
File comments: 49
Uploads: 2
Just done some testing and these are the current healing spells that report incoming heal values (i.e. this is what Blizzard tells us):

Druid
  • Efflorescence - No
  • Healing Touch - Yes
  • Lifebloom - No
  • Nourish - Yes
  • Regrowth - Yes
  • Rejuvenation - No
  • Swiftmend - No
  • Tranquility - No
  • Wild Growth - No

Paladin
  • Divine Light - Yes
  • Flash of Light - Yes
  • Holy Light - Yes
  • Holy Shock - No
  • Lay on Hands - No
  • Light of Dawn - No
  • Word of Glory - No

Priest
  • Binding Heal - Yes
  • Circle of Healing - No
  • Desperate Prayer - No
  • Divine Hymn - No
  • Flash Heal - Yes
  • Greater Heal - Yes
  • Heal - Yes
  • Holy Nova - No
  • Lightwell - No
  • Penance - No
  • Prayer of Healing - Yes
  • Prayer of Mending - No
  • Renew - No

Shaman
  • Chain Heal - Yes
  • Earth Living - No
  • Earth Shield - No
  • Greater Healing Wave - Yes
  • Healing Stream Totem - No
  • Healing Wave - Yes
  • Lesser Healing Wave - Yes
  • Riptide - Yes


Casted heals look fine, but channelled heals and HoTs need some work. Hopefully Blizz will update the heals that report values soon(TM).
yj589794 is offline Report comment to moderator  
Reply With Quote
Old 09-03-2010, 02:40 PM  
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view AddOns

Forum posts: 302
File comments: 49
Uploads: 2
Right, target unit stuff is fixed.

Hopefully that should be the last of the major issues sorted, well at least until I can test this on some party/raid frames (SecureGroupHeaderTemplate being MIA is stopping this testing).
yj589794 is offline Report comment to moderator  
Reply With Quote
Old 09-02-2010, 06:12 PM  
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view AddOns

Forum posts: 302
File comments: 49
Uploads: 2
I'm seeing some issues with incoming heal bars on target units at the moment.

Looks like there is lots of testing to do...
yj589794 is offline Report comment to moderator  
Reply With Quote
Old 09-02-2010, 04:35 PM  
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view AddOns

Forum posts: 302
File comments: 49
Uploads: 2
OK, I figured out why the incoming heal bars were not shown.

Calling self.Health:GetWidth() was giving me a result of 0, so make sure you set the width correctly in your layout.
yj589794 is offline Report comment to moderator  
Reply With Quote
Old 09-02-2010, 11:41 AM  
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view AddOns

Forum posts: 302
File comments: 49
Uploads: 2
Originally posted by Dawn
The new API makes healcomm libraries obsolete, right?
The authors of LibHealComm have stated that they are not going to continue the library when cataclysm launches due to Blizzard implementing this new API.

Hopefully the Blizzard implementation will be as good as LibHealComm was, but without the large number of addon messages.
yj589794 is offline Report comment to moderator  
Reply With Quote
Old 09-02-2010, 10:46 AM  
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view AddOns

Forum posts: 842
File comments: 909
Uploads: 22
The new API makes healcomm libraries obsolete, right?
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."

Dawn is offline Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: