Thread Tools Display Modes
08-08-10, 10:31 PM   #1
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Player's pet's partypet frame has wrong .unit set

I'm currently playing a warlock and a paladin. On the paladin's screen, the party pet frame for the warlock's pet shows up just fine. On the warlock's screen, however, the majority of the time the party pet frame for his pet appears with "Unknown" for the name, and the first time any element is updated, it changes to show the pet as offline.

Some basic checking reveals that the (frame).unit value isn't being set correctly on the frame for the warlock. Putting the mouse over the misbehaving frame:

/dump GetMouseFocus().unit
==> vehicle

/dump SecureButton_GetModifiedUnit(GetMouseFocus())
==> pet

However, if I manually set the .unit value:

/run GetMouseFocus().unit = SecureButton_GetModifiedUnit(GetMouseFocus())

The frame starts working correctly. It breaks again if I mount (pet disappears) and then dismount (pet reappears) though.

I'm spawning party pets using XML:
Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/../FrameXML/UI.xsd">
	<Button name="oUF_PhanxPartyTemplate" inherits="SecureUnitButtonTemplate" hidden="true" virtual="true">
		<Frames>
			<Button name="$parentPet" inherits="SecureUnitButtonTemplate">
				<Anchors>
					<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT" relativeTo="$parent">
						<Offset>
							<AbsDimension x="10" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Attributes>
					<Attribute name="unitsuffix" type="string" value="pet"/>
					<Attribute name="useparent-unit" type="boolean" value="true"/>
					<Attribute name="type1" type="string" value="target"/>
					<Attribute name="initial-unitWatch" type="boolean" value="true"/>
				</Attributes>
			</Button>
		</Frames>
	</Button>
</Ui>
and:
Code:
oUF:SpawnHeader(nil, nil, "party",
	"showParty", true,
	"showPlayer", true,
	"template", "oUF_PhanxPartyTemplate",
	"xOffset", 0,
	"yOffset", -25)
The party and party pet frames are generally working fine, other than the party pet frame for the warlock's pet on the warlock's screen. I'm guessing it has something to do with setting the "showPlayer" attribute on my party header, but I don't know what the solution (if there is one) is.

Any thoughts?
  Reply With Quote
08-08-10, 11:24 PM   #2
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Sounds like a oUF bug. I'll have a look after work.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
08-09-10, 01:01 AM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Thanks. My complete layout is here:
http://www.wowinterface.com/download...oUF_Phanx.html
  Reply With Quote
08-09-10, 10:28 AM   #4
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Issue should be solved with f8de36a107eca9a997d8. I'll look into posting 1.4.3 later today.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
08-09-10, 01:47 PM   #5
Toran
A Nerdscale Dorkin
 
Toran's Avatar
Premium Member
Join Date: May 2006
Posts: 143
Ha! And I always thought this was a problem with my layout. Good to see it's getting fixed.
  Reply With Quote
08-09-10, 04:43 PM   #6
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by Toran View Post
Ha! And I always thought this was a problem with my layout. Good to see it's getting fixed.
Reporting bugs is generally a good idea, even if you aren't certain regarding why they happen.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
08-15-10, 03:47 PM   #7
Toran
A Nerdscale Dorkin
 
Toran's Avatar
Premium Member
Join Date: May 2006
Posts: 143
Coming back to this, my pet frame has come up grey a few times in the past two days. It's always on login when pet is first spawned.

Edit: Not just on first login. Also happened when zoning into an instance. Seems kind of random.

Last edited by Toran : 08-15-10 at 05:09 PM.
  Reply With Quote
08-20-10, 07:48 AM   #8
Toran
A Nerdscale Dorkin
 
Toran's Avatar
Premium Member
Join Date: May 2006
Posts: 143
haste - any idea why this is still happening? Perhaps the bug isn't completely fixed?
  Reply With Quote
08-20-10, 09:59 AM   #9
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by Toran View Post
haste - any idea why this is still happening? Perhaps the bug isn't completely fixed?
This isn't the same bug as phanx reported. To me it sounds like some pet update event is missing.

Do you have a way to reproduce it?
__________________
「貴方は1人じゃないよ」
  Reply With Quote
08-20-10, 10:12 AM   #10
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
Is this related to unknown units?

I have seen times where a party or raid pet does not have the correct details for a while, but when in range all the details update correctly.
  Reply With Quote
08-20-10, 10:20 AM   #11
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by yj589794 View Post
Is this related to unknown units?

I have seen times where a party or raid pet does not have the correct details for a while, but when in range all the details update correctly.
Toran said "my pet frame", so I'm guessing it's related to the player pet. That being said: range + party = hell.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
08-20-10, 03:15 PM   #12
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Toran View Post
Coming back to this, my pet frame has come up grey a few times in the past two days. It's always on login when pet is first spawned.

Edit: Not just on first login. Also happened when zoning into an instance. Seems kind of random.
I havent had these issues since 1.2.
Could you post a screenshot comparisation of the normal frame and the "bugged" frame?
  Reply With Quote
08-22-10, 12:45 PM   #13
Toran
A Nerdscale Dorkin
 
Toran's Avatar
Premium Member
Join Date: May 2006
Posts: 143
Here's a pic. It's really random when it happens, but can happen on login, after dismounting, and after entering an instance. I did noticed though, that it recovered once when my pet was buffed.

Anyway, the problem frame is the far left with the yellow arrow above it. The color on the target frame (far right) is the color it should be.



If it helps, here is my updateHealth code:

Code:
local updateHealth = function(health, unit)
	local r, g, b, t
	local reaction = UnitReaction(unit, "player")
	if(UnitIsPlayer(unit)) then
		local _, class = UnitClass(unit)
		t = oUF.colors.class[class]
	elseif UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit) then
		t = oUF.colors.tapped
	elseif reaction then
		t = oUF.colors.reaction[reaction]
	else
		r, g, b = .1, .8, .3
	end

	if(t) then
		r, g, b = t[1], t[2], t[3]
	end
	
	-- set health background color
	local color = RAID_CLASS_COLORS[select(2, UnitClass(unit))]	
	if UnitIsPlayer(unit) and color then
		health.bg:SetVertexColor(color.r*.5, color.g*.5, color.b*.5, .7)
    else
		local r, g, b = UnitSelectionColor(unit)
		health.bg:SetVertexColor(r*.5, g*.5, b*.5, .7)	
    end
	
	health:SetStatusBarColor(r, g, b)

end

Last edited by Toran : 08-22-10 at 12:49 PM. Reason: grammar, code addition
  Reply With Quote
08-25-10, 04:02 PM   #14
Toran
A Nerdscale Dorkin
 
Toran's Avatar
Premium Member
Join Date: May 2006
Posts: 143
Originally Posted by haste View Post
Toran said "my pet frame", so I'm guessing it's related to the player pet. That being said: range + party = hell.
Yes this is about the *player* pet frame.
  Reply With Quote
09-03-10, 01:31 PM   #15
Toran
A Nerdscale Dorkin
 
Toran's Avatar
Premium Member
Join Date: May 2006
Posts: 143
bump - please let me know if this could me a layout issue or if it's an oUF issue. Thanks.
  Reply With Quote
09-03-10, 01:38 PM   #16
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
I haven't been able to reproduce your issue with it, but I also haven't torn down your layout. A small proof of concept would be much wanted, at least for a quick "check".
__________________
「貴方は1人じゃないよ」
  Reply With Quote
09-03-10, 01:45 PM   #17
Toran
A Nerdscale Dorkin
 
Toran's Avatar
Premium Member
Join Date: May 2006
Posts: 143
What part of the layout would benefit you? Or should I just link the whole thing to a pastey?
  Reply With Quote
09-03-10, 01:49 PM   #18
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by Toran View Post
What part of the layout would benefit you? Or should I just link the whole thing to a pastey?
The best solution would be if you could build a layout with the least amount of code needed to clearly present the issue.
__________________
「貴方は1人じゃないよ」
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Player's pet's partypet frame has wrong .unit set


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