View Single Post
  #1419  
Old 02-24-2012, 01:32 AM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Quote:
Originally Posted by Crow View Post
I suppose you catch the event from the GUI object you animate?
Oh true I misread. In that case I suppose I could always catch the event in a separate weapon from the one being destroyed.

Edit: Works, albeit this is slightly complicated when there's a chance the GUI can quickly be recreated, and its creation is also animated.
Which means I have:

Class within Weapon about to be destroyed -

PHP Code:
temp.gui.destroying true;
SomeSystemWeapon.scheduleDestroyGUI(temp.gui); 
Weapon -

PHP Code:
public function scheduleDestroyGUI(temp.gui){
  
thiso.catchevent(temp.gui.name"onAnimationFinished""destroyGUI");
}

function 
destroyGUI(temp.gui){
  if(
temp.gui.destroying){
    
this.ignoreevent(temp.gui.name"onAnimationFinished");
    
temp.gui.destroy();
  }

Whereas using the scheduleevent method it would be:

Class within Weapon about to be destroyed -

PHP Code:
SomeSystemWeapon.scheduleDestroyGUI(temp.guitemp.time); 
PHP Code:
public function scheduleDestroyGUI(temp.guitemp.time){
  
thiso.scheduleEvent(temp.time"DestroyGUI"temp.gui);
}

function 
onDestroyGUI(temp.gui){
  if(
temp.gui != NULL){
    
temp.gui.destroy();
  }

It works fine for me either way, I just thought a built-in variable to handle it would make things easier.

Last edited by ffcmike; 02-24-2012 at 02:44 AM..
Reply With Quote