m_sID experiment
This commit is contained in:
@@ -66,10 +66,15 @@ public:
|
||||
|
||||
|
||||
|
||||
CString m_sName;
|
||||
CString m_sName, m_sID;
|
||||
|
||||
CString GetName() { return m_sName; };
|
||||
void SetName( CString n ) { m_sName = n; };
|
||||
CString GetName() const { return m_sName; };
|
||||
CString GetID() const { return m_sID; };
|
||||
/* m_sName is the name actors use to look up internal metrics for themselves, and for
|
||||
* filenames. m_sID is the name parents use to look up their own metrics for an actor
|
||||
* (usually via ActorUtil). (This is experimental; see DifficultyMeter.cpp for more
|
||||
* information.) */
|
||||
void SetName( const CString &sName, const CString &sID = "" ) { m_sName = sName; m_sID = (sID.size()? sID:sName); };
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -139,8 +139,8 @@ void IncorrectActorParametersWarning( const CStringArray &asTokens, int iMaxInde
|
||||
|
||||
void UtilSetXY( Actor& actor, CString sClassName )
|
||||
{
|
||||
ASSERT( !actor.GetName().empty() );
|
||||
actor.SetXY( THEME->GetMetricF(sClassName,actor.GetName()+"X"), THEME->GetMetricF(sClassName,actor.GetName()+"Y") );
|
||||
ASSERT( !actor.GetID().empty() );
|
||||
actor.SetXY( THEME->GetMetricF(sClassName,actor.GetID()+"X"), THEME->GetMetricF(sClassName,actor.GetID()+"Y") );
|
||||
}
|
||||
|
||||
float UtilCommand( Actor& actor, CString sClassName, CString sCommandName )
|
||||
@@ -153,11 +153,11 @@ float UtilCommand( Actor& actor, CString sClassName, CString sCommandName )
|
||||
// (Do "playcommand" anyway; BGAs often have no name.)
|
||||
if( sCommandName=="Off" )
|
||||
{
|
||||
if( actor.GetName().empty() )
|
||||
if( actor.GetID().empty() )
|
||||
return ret;
|
||||
} else {
|
||||
ASSERT( !actor.GetName().empty() );
|
||||
ASSERT( !actor.GetID().empty() );
|
||||
}
|
||||
|
||||
return max( ret, actor.Command( THEME->GetMetric(sClassName,actor.GetName()+sCommandName+"Command") ) );
|
||||
return max( ret, actor.Command( THEME->GetMetric(sClassName,actor.GetID()+sCommandName+"Command") ) );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user