Thread Tools Display Modes
09-27-10, 06:34 PM   #1
JStrese
A Murloc Raider
Join Date: Aug 2009
Posts: 8
HealPrediction issue..

I'm really new to oUF, so any criticism is very welcome.

I'm modifying oUF_Simple by Zork (it's a great layout to start with ), but I can't seem to get HealPrediction to not overflow.

Yes - I've set maxOverFlow to 1.
Yes - maxOverFlow works.
.. wait what?

The overflow setting works like it's supposed to when I heal myself slowly, however when I spam myself with, lets say, healing surge.. the heal prediction statusbar goes way out, then corrects itself. It's kind of annoying.. though I have a feeling that there's a way to fix it.

I'm using the heal prediction code almost exactly from the example on the oUF_HealPrediction page on WoWInterface:

Code:
  --gen healthbar func
  lib.gen_hpbar = function(f)
	if f.mystyle == "party" or f.mystyle =="raid" then
		--statusbar
		local s = CreateFrame("StatusBar", nil, f)
		s:SetStatusBarTexture(cfg.statusbar_texture)
		s:SetHeight(f.height)
		s:SetWidth(f.width)
		s:SetPoint("CENTER",0,0)
		--helper
		local h = CreateFrame("Frame", nil, s)
		h:SetFrameLevel(0)
		h:SetPoint("TOPLEFT",-5,5)
		h:SetPoint("BOTTOMRIGHT",5,-5)
		lib.gen_backdrop(h)
		--bg
		local b = s:CreateTexture(nil, "BACKGROUND")
		b:SetTexture(cfg.statusbar_texture)
		b:SetAllPoints(s)
		f.Health = s
		f.Health.bg = b
	else
		--statusbar
		local s = CreateFrame("StatusBar", nil, f)
		s:SetStatusBarTexture(cfg.statusbar_texture)
		s:SetHeight(f.height)
		s:SetWidth(f.width)
		s:SetPoint("CENTER",0,0)
		--helper
		local h = CreateFrame("Frame", nil, s)
		h:SetFrameLevel(0)
		h:SetPoint("TOPLEFT",-5,5)
		h:SetPoint("BOTTOMRIGHT",5,-5)
		lib.gen_backdrop(h)
		--bg
		local b = s:CreateTexture(nil, "BACKGROUND")
		b:SetTexture(cfg.statusbar_texture)
		b:SetAllPoints(s)
		f.Health = s
		f.Health.bg = b

		if cfg.healprediction then
			local mhpb = CreateFrame('StatusBar', nil, f)
			mhpb:SetPoint('TOPLEFT', s:GetStatusBarTexture(), 'TOPRIGHT', 0, 0)
			mhpb:SetPoint('BOTTOMLEFT', s:GetStatusBarTexture(), 'BOTTOMRIGHT', 0, 0)
			mhpb:SetWidth(f.width)
			mhpb:SetStatusBarTexture(cfg.statusbar_texture)
			mhpb:SetStatusBarColor(0, 1, 0.5, 0.25)

			local ohpb = CreateFrame('StatusBar', nil, f)
			ohpb:SetPoint('TOPLEFT', s:GetStatusBarTexture(), 'TOPRIGHT', 0, 0)
			ohpb:SetPoint('BOTTOMLEFT', s:GetStatusBarTexture(), 'BOTTOMRIGHT', 0, 0)
			ohpb:SetWidth(f.width)
			ohpb:SetStatusBarTexture(cfg.statusbar_texture)
			ohpb:SetStatusBarColor(0, 1, 0, 0.25)

			f.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,
			}
		end
	end
  end
Any help would be appreciated. I also noticed this bug using the oUF_Nivaya (Cataclysm) layout.

-J
  Reply With Quote
09-27-10, 07:05 PM   #2
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
Hi,

I've not got time to test the problem at the moment, but something to note is that the "otherBar" should be anchored to the right-hand side of "myBar". In your code incoming heals from yourself and from others would overlap as both statusbars are anchored to the end of the statusbar "s".

Changing this will not affect any overflow, but it should help to show incoming heals as intended.


I'll try and get some testing done on beta servers, but it might be a while before I can get any meaningful results.
  Reply With Quote
09-27-10, 09:29 PM   #3
JStrese
A Murloc Raider
Join Date: Aug 2009
Posts: 8
Originally Posted by yj589794 View Post
Hi,

I've not got time to test the problem at the moment, but something to note is that the "otherBar" should be anchored to the right-hand side of "myBar". In your code incoming heals from yourself and from others would overlap as both statusbars are anchored to the end of the statusbar "s".

Changing this will not affect any overflow, but it should help to show incoming heals as intended.


I'll try and get some testing done on beta servers, but it might be a while before I can get any meaningful results.
Thanks, I should have seen that
  Reply With Quote
09-28-10, 03:48 PM   #4
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
I've had a quick play on the beta and when standing around just healing myself there doesn't seem to be an issue.

I suspect there might be a slight issue when you've got changes in health values and incoming heals at the same time, due to a minor delay between updates of the health and healprediction elements.

Can you give some more details on the situation where you are seeing unexpected overflow?
  Reply With Quote
09-28-10, 04:34 PM   #5
JStrese
A Murloc Raider
Join Date: Aug 2009
Posts: 8
Here's a visual aid:
http://www.youtube.com/watch?v=ovnMbCw182Y

I noticed a new bug when doing this.. the texture keeps disappearing for some reason while spamming my heal. Maybe this is all on my end of things

Here's all my heal prediction code:
Code:
  --gen healthbar func
  lib.gen_hpbar = function(f)
	local s = CreateFrame("StatusBar", nil, f)

	if f.mystyle == "party" or f.mystyle =="raid" then
		--statusbar
		s:SetStatusBarTexture(cfg.statusbar_texture)
		s:SetHeight(f.height)
		s:SetWidth(f.width)
		s:SetPoint("CENTER",0,0)
		--helper
		local h = CreateFrame("Frame", nil, s)
		h:SetFrameLevel(0)
		h:SetPoint("TOPLEFT",-5,5)
		h:SetPoint("BOTTOMRIGHT",5,-5)
		lib.gen_backdrop(h)
		--bg
		local b = s:CreateTexture(nil, "BACKGROUND")
		b:SetTexture(cfg.statusbar_texture)
		b:SetAllPoints(s)
		f.Health = s
		f.Health.bg = b
	else
		--statusbar
		s:SetStatusBarTexture(cfg.statusbar_texture)
		s:SetHeight(f.height)
		s:SetWidth(f.width)
		s:SetPoint("CENTER",0,0)
		--helper
		local h = CreateFrame("Frame", nil, s)
		h:SetFrameLevel(0)
		h:SetPoint("TOPLEFT",-5,5)
		h:SetPoint("BOTTOMRIGHT",5,-5)
		lib.gen_backdrop(h)
		--bg
		local b = s:CreateTexture(nil, "BACKGROUND")
		b:SetTexture(cfg.statusbar_texture)
		b:SetAllPoints(s)
		f.Health = s
		f.Health.bg = b
	end

	if cfg.healprediction then
			local mhpb = CreateFrame('StatusBar', nil, f)
			mhpb:SetPoint('TOPLEFT', s:GetStatusBarTexture(), 'TOPRIGHT', 0, 0)
			mhpb:SetPoint('BOTTOMLEFT', s:GetStatusBarTexture(), 'BOTTOMRIGHT', 0, 0)
			mhpb:SetWidth(f.width)
			mhpb:SetStatusBarTexture(cfg.statusbar_texture)
			mhpb:SetStatusBarColor(0, 1, 0.5, 0.25)

			local ohpb = CreateFrame('StatusBar', nil, mhpb)
			ohpb:SetPoint('TOPLEFT', s:GetStatusBarTexture(), 'TOPRIGHT', 0, 0)
			ohpb:SetPoint('BOTTOMLEFT', s:GetStatusBarTexture(), 'BOTTOMRIGHT', 0, 0)
			ohpb:SetWidth(f.width)
			ohpb:SetStatusBarTexture(cfg.statusbar_texture)
			ohpb:SetStatusBarColor(0, 1, 0, 0.25)

			f.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,
			}
	end
  end
If you want anymore code just ask for it.. though most of it is still oUF_Simple
  Reply With Quote
09-28-10, 05:01 PM   #6
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
Originally Posted by JStrese View Post
I noticed a new bug when doing this.. the texture keeps disappearing for some reason while spamming my heal. Maybe this is all on my end of things
I've seen this one as well, and it looks like a bug on Blizzards side. Cast a heal and you will see the incoming heal amount, then before the cast finishes, cast again. This second cast will not work (action already in progress) but it will cause your incoming heal value to reset to 0 (value retrieved from Blizzard API).
I need to get on the official forums to report it.


For the overflow issue I'll try some more stuff tomorrow.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » HealPrediction issue..


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off