Thread Tools Display Modes
01-23-09, 01:07 PM   #1
iindigo
An Aku'mai Servant
 
iindigo's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 32
Changing UnitFrame Position When Entering and Exiting Vehicles

Hey guys!

I have a small problem that I'm not sure how to solve. I've written a very simple addon that adjusts the position of the default unitframes based on sliders in a preference pane. It works wonderfully under normal use, but as soon as I use a vehicle, things get screwy - the frame and its background shift to different places on the screen and are generally messy.

I am aware that simply doing setPoint: on the frames again will fix this. The problem that I am trying to solve is figuring out how to do that AFTER the unitframe has finished the vehicle transition animation.

Any ideas? I've considered maybe using a timer, but haven't tried it for fear of its reliance on FPS killing the method's reliability.

Thanks!
  Reply With Quote
01-23-09, 01:51 PM   #2
Cralor
Mmm... cookies!!!
 
Cralor's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2007
Posts: 772
Actually, this is something that I have been trying to figure out, too.

Is there an event for the exiting of a Vehicle? That would probably do it if I could find it.
__________________
Never be satisfied with satisfactory.
  Reply With Quote
01-23-09, 02:16 PM   #3
iindigo
An Aku'mai Servant
 
iindigo's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 32
Originally Posted by Cralor View Post
Actually, this is something that I have been trying to figure out, too.

Is there an event for the exiting of a Vehicle? That would probably do it if I could find it.
There is, and it's called UNIT_EXITED_VEHICLE. UNIT_ENTERED_VEHICLE is also present. The problem is that they are fired the exact moment the player enters/exists a vehicle and thus actions hooked to them fire that exact moment instead of after the unitframe animation is complete. The result is that the unitframe will be placed in the correct position for a split second only to be moved back by the "sliding in" animation.
  Reply With Quote
01-24-09, 11:22 AM   #4
Cralor
Mmm... cookies!!!
 
Cralor's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2007
Posts: 772
Ah. That's probably why it didn't work for me.
__________________
Never be satisfied with satisfactory.
  Reply With Quote
01-24-09, 12:11 PM   #5
Akryn
A Firelord
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 479
You could probably figure out some way to watch the animation by looking through bliz's code. You could also just time it like you said; I don't think that would cause any problems as long as you're timing it correctly. But if you want to make sure you could always just call SetPoint every couple of OnUpdates for a few seconds after the first time. If it hasn't moved you wouldn't notice the difference.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Changing UnitFrame Position When Entering and Exiting Vehicles


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