fix OnCommand sometimes run twice
This commit is contained in:
@@ -63,6 +63,17 @@ bool Transition::EarlyAbortDraw() const
|
|||||||
return m_State == waiting;
|
return m_State == waiting;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Our parent might send us OnCommand. We do that ourself, because
|
||||||
|
* we sometimes want to know GetLengthSeconds before StartTransitioning.
|
||||||
|
* Make sure we don't process OnCommand twice. */
|
||||||
|
void Transition::PlayCommand( const CString &sCommandName, Actor *pParent )
|
||||||
|
{
|
||||||
|
if( sCommandName == "On" )
|
||||||
|
return;
|
||||||
|
|
||||||
|
ActorFrame::PlayCommand( sCommandName, pParent );
|
||||||
|
}
|
||||||
|
|
||||||
void Transition::StartTransitioning( ScreenMessage send_when_done )
|
void Transition::StartTransitioning( ScreenMessage send_when_done )
|
||||||
{
|
{
|
||||||
if( m_State != waiting )
|
if( m_State != waiting )
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ public:
|
|||||||
void Load( CString sBGAniDir );
|
void Load( CString sBGAniDir );
|
||||||
|
|
||||||
virtual void UpdateInternal( float fDeltaTime );
|
virtual void UpdateInternal( float fDeltaTime );
|
||||||
|
virtual void PlayCommand( const CString &sCommandName, Actor *pParent = NULL );
|
||||||
|
|
||||||
virtual void StartTransitioning( ScreenMessage send_when_done = SM_None );
|
virtual void StartTransitioning( ScreenMessage send_when_done = SM_None );
|
||||||
virtual bool EarlyAbortDraw() const;
|
virtual bool EarlyAbortDraw() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user