little hack to allow forcing propagation of commands to children that
normally aren't
This commit is contained in:
@@ -742,7 +742,7 @@ void Actor::HandleCommand( const ParsedCommand &command )
|
||||
* on these commands. */
|
||||
else if( sName=="customtexturerect" || sName=="texcoordvelocity" || sName=="scaletoclipped" ||
|
||||
sName=="stretchtexcoords" || sName=="position" || sName=="loop" || sName=="play" ||
|
||||
sName=="pause" || sName=="rate" )
|
||||
sName=="pause" || sName=="rate" || sName=="propagate" )
|
||||
return;
|
||||
else
|
||||
{
|
||||
|
||||
@@ -3,6 +3,11 @@
|
||||
#include "arch/Dialog/Dialog.h"
|
||||
#include "RageUtil.h"
|
||||
|
||||
ActorFrame::ActorFrame()
|
||||
{
|
||||
m_bPropagateCommands = false;
|
||||
}
|
||||
|
||||
void ActorFrame::AddChild( Actor* pActor )
|
||||
{
|
||||
#if _DEBUG
|
||||
@@ -68,6 +73,12 @@ void ActorFrame::RunCommandOnChildren( const CString &cmd )
|
||||
m_SubActors[i]->Command( cmd );
|
||||
}
|
||||
|
||||
void ActorFrame::RunCommandOnChildren( const ParsedCommand &cmd )
|
||||
{
|
||||
for( unsigned i=0; i<m_SubActors.size(); i++ )
|
||||
m_SubActors[i]->HandleCommand( cmd );
|
||||
}
|
||||
|
||||
void ActorFrame::Update( float fDeltaTime )
|
||||
{
|
||||
// LOG->Trace( "ActorFrame::Update( %f )", fDeltaTime );
|
||||
@@ -146,9 +157,29 @@ void ActorFrame::DeleteAllChildren()
|
||||
|
||||
void ActorFrame::HandleCommand( const ParsedCommand &command )
|
||||
{
|
||||
Actor::HandleCommand( command );
|
||||
HandleParams;
|
||||
|
||||
// don't propograte most commands to children
|
||||
const CString& sName = sParam(0);
|
||||
do
|
||||
{
|
||||
if( sName=="propagate" )
|
||||
{
|
||||
m_bPropagateCommands = bParam(1);
|
||||
RunCommandOnChildren( command );
|
||||
}
|
||||
else
|
||||
{
|
||||
Actor::HandleCommand( command );
|
||||
break;
|
||||
}
|
||||
CheckHandledParams;
|
||||
} while(0);
|
||||
|
||||
/* By default, don't propograte most commands to children; it makes no sense
|
||||
* to run "x,50" recursively. If m_bPropagateCommands is set, propagate all
|
||||
* commands. */
|
||||
if( m_bPropagateCommands && sName!="propagate" )
|
||||
RunCommandOnChildren( command );
|
||||
}
|
||||
|
||||
void ActorFrame::GainFocus( float fRate, bool bRewindMovie, bool bLoop )
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
class ActorFrame : public Actor
|
||||
{
|
||||
public:
|
||||
ActorFrame();
|
||||
virtual void AddChild( Actor* pActor );
|
||||
virtual void RemoveChild( Actor* pActor );
|
||||
virtual void MoveToTail( Actor* pActor );
|
||||
@@ -19,6 +20,7 @@ public:
|
||||
void DeleteAllChildren();
|
||||
|
||||
virtual void RunCommandOnChildren( const CString &cmd ); /* but not on self */
|
||||
virtual void RunCommandOnChildren( const ParsedCommand &cmd ); /* but not on self */
|
||||
virtual void HandleCommand( const ParsedCommand &command ); // derivable
|
||||
|
||||
virtual void Update( float fDeltaTime );
|
||||
@@ -41,6 +43,7 @@ public:
|
||||
|
||||
protected:
|
||||
vector<Actor*> m_SubActors;
|
||||
bool m_bPropagateCommands;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user