Thread Tools Display Modes
12-23-10, 03:45 PM   #1
Æxò
A Murloc Raider
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 9
Default UI: disabling PlayerFrame_AnimateOut

Hi,

I like the default UI and have been modifying it for a long time, but I’ve been stuck on a glitch I can’t figure out:

When the PlayerFrame switches to VehicleUI and back, Blizzard’s script runs an animation (see code) that animates the frame out of the viewport, to the top, and back to its original position. (For the record, I’ve set the new position with this script: http://www.wowinterface.com/forums/s...233#post224233)

Out of combat, when leaving a vehicle, the PlayerFrame stays at the correct position. But in combat, and most annoyingly during raids, the PlayerFrame resets at Blizzard’s default position and stays there until end of combat.

Code:
local function PlayerFrame_AnimPos(self, fraction)
	return "TOPLEFT", UIParent, "TOPLEFT", -19, fraction*140-4;
end

local PlayerFrameAnimTable = {
	totalTime = 0.3,
	updateFunc = "SetPoint",
	getPosFunc = PlayerFrame_AnimPos,
	}
function PlayerFrame_AnimateOut(self)
	self.inSeat = false;
	self.animFinished = false;
	self.inSequence = true;
	SetUpAnimation(PlayerFrame, PlayerFrameAnimTable, PlayerFrame_AnimFinished, false)
end

function PlayerFrame_AnimFinished(self)
	self.animFinished = true;
	PlayerFrame_UpdateArt(self);
end

function PlayerFrame_UpdateArt(self)
	if ( self.animFinished and self.inSeat and self.inSequence) then
		SetUpAnimation(PlayerFrame, PlayerFrameAnimTable, PlayerFrame_SequenceFinished, true)
		if ( UnitHasVehiclePlayerFrameUI("player") ) then
			PlayerFrame_ToVehicleArt(self, UnitVehicleSkin("player"));
		else
			PlayerFrame_ToPlayerArt(self);
		end
	end
end

function PlayerFrame_SequenceFinished(self)
	self.inSequence = false;
	PetFrame_Update(PetFrame);
end

I tried to neutralize these functions using empty functions and hooksecurefunc; I tried to set the position again when the animation is finished. In fact, I’ve tried many things but none worked. I suppose it’s due to Blizzard’s preventing addons to modify Blizzard’s code during combat (tainting?).

But how to explain that I’ve changed so many other things, and yet they work out and in combat? Well, anyway, it ain’t the question.

My question is: how to prevent the default PlayerFrame to resets to the default position each time I leave a vehicle in combat?

Thank you.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Default UI: disabling PlayerFrame_AnimateOut


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