simplify
This commit is contained in:
@@ -144,21 +144,12 @@ void UtilSetXY( Actor& actor, CString sClassName )
|
|||||||
float UtilCommand( Actor& actor, CString sClassName, CString sCommandName )
|
float UtilCommand( Actor& actor, CString sClassName, CString sCommandName )
|
||||||
{
|
{
|
||||||
ASSERT( !actor.GetName().empty() );
|
ASSERT( !actor.GetName().empty() );
|
||||||
return actor.Command( THEME->GetMetric(sClassName,actor.GetName()+sCommandName+"Command") );
|
|
||||||
}
|
|
||||||
|
|
||||||
float UtilOnCommand( Actor& actor, CString sClassName )
|
|
||||||
{
|
|
||||||
ASSERT( !actor.GetName().empty() );
|
|
||||||
return actor.Command( THEME->GetMetric(sClassName,actor.GetName()+"OnCommand") );
|
|
||||||
}
|
|
||||||
|
|
||||||
float UtilOffCommand( Actor& actor, CString sClassName )
|
|
||||||
{
|
|
||||||
// HACK: It's very often that we command things to TweenOffScreen
|
// HACK: It's very often that we command things to TweenOffScreen
|
||||||
// that we aren't drawing. We know that an Actor is not being
|
// that we aren't drawing. We know that an Actor is not being
|
||||||
// used if it's name is blank. So, do nothing on Actors with a blank name.
|
// used if it's name is blank. So, do nothing on Actors with a blank name.
|
||||||
if( actor.GetName().empty() )
|
if( sCommandName=="Off" && actor.GetName().empty() )
|
||||||
return 0;
|
return 0;
|
||||||
return actor.Command( THEME->GetMetric(sClassName,actor.GetName()+"OffCommand") );
|
|
||||||
|
return actor.Command( THEME->GetMetric(sClassName,actor.GetName()+sCommandName+"Command") );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,13 +26,13 @@ void UtilSetXY( Actor& actor, CString sClassName );
|
|||||||
inline void UtilSetXY( Actor* pActor, CString sClassName ) { UtilSetXY( *pActor, sClassName ); }
|
inline void UtilSetXY( Actor* pActor, CString sClassName ) { UtilSetXY( *pActor, sClassName ); }
|
||||||
|
|
||||||
|
|
||||||
float UtilOnCommand( Actor& actor, CString sClassName );
|
|
||||||
inline float UtilOnCommand( Actor* pActor, CString sClassName ) { return UtilOnCommand( *pActor, sClassName ); }
|
|
||||||
|
|
||||||
float UtilCommand( Actor& actor, CString sClassName, CString sCommandName );
|
float UtilCommand( Actor& actor, CString sClassName, CString sCommandName );
|
||||||
inline float UtilCommand( Actor* pActor, CString sClassName, CString sCommandName ) { return UtilCommand( *pActor, sClassName, sCommandName ); }
|
inline float UtilCommand( Actor* pActor, CString sClassName, CString sCommandName ) { return UtilCommand( *pActor, sClassName, sCommandName ); }
|
||||||
|
|
||||||
float UtilOffCommand( Actor& actor, CString sClassName );
|
inline float UtilOnCommand( Actor& actor, CString sClassName ) { return UtilCommand( actor, sClassName, "On" ); }
|
||||||
|
inline float UtilOnCommand( Actor* pActor, CString sClassName ) { return UtilOnCommand( *pActor, sClassName ); }
|
||||||
|
|
||||||
|
inline float UtilOffCommand( Actor& actor, CString sClassName ) { return UtilCommand( actor, sClassName, "Off" ); }
|
||||||
inline float UtilOffCommand( Actor* pActor, CString sClassName ) { return UtilOffCommand( *pActor, sClassName ); }
|
inline float UtilOffCommand( Actor* pActor, CString sClassName ) { return UtilOffCommand( *pActor, sClassName ); }
|
||||||
|
|
||||||
inline float UtilSetXYAndOnCommand( Actor& actor, CString sClassName )
|
inline float UtilSetXYAndOnCommand( Actor& actor, CString sClassName )
|
||||||
|
|||||||
Reference in New Issue
Block a user