Thread Tools Display Modes
04-19-09, 01:40 PM   #1
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
self.Power.frequentUpdates = true for pets

When I try adding self.Power.frequentUpdates = true for unit == "pet" I get a Lua error.

Screenshot:
http://img2.abload.de/img/wowscrnsho...09_213av4p.jpg

Am I doing something wrong? Pets are allowed to use frequentupdates or not?
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
04-19-09, 02:05 PM   #2
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Its a bug haste forgot during the new event system.
  Reply With Quote
04-20-09, 05:27 AM   #3
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by zork View Post
When I try adding self.Power.frequentUpdates = true for unit == "pet" I get a Lua error.

Screenshot:
http://img2.abload.de/img/wowscrnsho...09_213av4p.jpg

Am I doing something wrong? Pets are allowed to use frequentupdates or not?
Is the power frame correctly parented? It seems to me that you have a power frame that isn't. Since your UNIT_MAXMANA is nil on the parent that is.

If it is: Could you do a dump on the parent of the power frame? or tell me what layout this is on so I can test myself.

Also it's really better to post possible bug issues on my portal. I always go through them before I start looking it posts. In this case there isn't enough information to do a fix, but if it had then I would have to do an extra minor version "just" for this.
Originally Posted by p3lim View Post
Its a bug haste forgot during the new event system.
Most likely not, but based on your comment you've already had this issue without reporting it.
  Reply With Quote
04-20-09, 06:23 AM   #4
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by haste View Post
Most likely not, but based on your comment you've already had this issue without reporting it.
I havent, but looking at the code it seems it still uses the old event system:
Code:
local OnPowerUpdate
do
	local UnitMana = UnitMana
	OnPowerUpdate = function(self)
		if(self.disconnected) then return end
		local power = UnitMana(self.unit)

		if(power ~= self.min) then
			self.min = power

			self:GetParent():UNIT_MAXMANA("OnPowerUpdate", self.unit)
		end
	end
end
  Reply With Quote
04-20-09, 07:17 AM   #5
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
That code is still valid for the new system.
  Reply With Quote
04-20-09, 07:35 AM   #6
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
I will post the code on the Bug Report Portal.

Edit haste's tip was correct. I was using self.Power = CreateFrame("StatusBar", nil, self.Health), after I changed that to self.Power = CreateFrame("StatusBar", nil, self) it worked.
__________________
| 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 : 04-20-09 at 07:47 AM.
  Reply With Quote
04-22-09, 06:19 AM   #7
Scound
A Murloc Raider
Join Date: Jan 2009
Posts: 5
I have experienced the exact same issue, but for all my powerframes - I already posted it in "oUF - Layout discussion": http://www.wowinterface.com/forums/s...=18363&page=50

I suppose referencing the powerbar to the frame itself insted of the healthbar might do the trick for me too - will check later today. Thanks.

However, why isn't it possible to parent the healthbar-frame to the powerbar one?
  Reply With Quote
04-22-09, 06:30 AM   #8
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by Scound View Post
However, why isn't it possible to parent the healthbar-frame to the powerbar one?
frequentUpdates makes oUF call the function which updates power/health on a poll basis instead of event. It does however still use events for some updates, so oUF needs to be able to call the event function.

It's possible to solve this in a different manner now, but I haven't seen a reason to change it. Except for the two cases you have here.
  Reply With Quote
04-23-09, 01:42 AM   #9
Scound
A Murloc Raider
Join Date: Jan 2009
Posts: 5
Well, tried it and everything is working perfectly now - Thanks...
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » self.Power.frequentUpdates = true for pets


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