Always call LoadAllCommands explicitly.
The hack to LoadAllCommands when playing a command was leading to weird interactions: If a theme element contained an OnCommand, it would cause the rest of the commands defined in metrics to not be loaded.
This commit is contained in:
@@ -275,13 +275,13 @@ void ScreenEvaluation::Init()
|
||||
m_SmallBanner[i].ScaleToClipped( BANNER_WIDTH, BANNER_HEIGHT );
|
||||
m_SmallBanner[i].SetName( ssprintf("SmallBanner%d",i+1) );
|
||||
ActorUtil::LoadAllCommands( m_SmallBanner[i], m_sName );
|
||||
SET_XY( m_SmallBanner[i] );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_SmallBanner[i] );
|
||||
this->AddChild( &m_SmallBanner[i] );
|
||||
|
||||
m_sprSmallBannerFrame[i].Load( THEME->GetPathG(m_sName,"banner frame") );
|
||||
m_sprSmallBannerFrame[i]->SetName( ssprintf("SmallBanner%d",i+1) );
|
||||
ActorUtil::LoadAllCommands( *m_sprSmallBannerFrame[i], m_sName );
|
||||
SET_XY( m_sprSmallBannerFrame[i] );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_sprSmallBannerFrame[i] );
|
||||
this->AddChild( m_sprSmallBannerFrame[i] );
|
||||
}
|
||||
}
|
||||
@@ -294,13 +294,13 @@ void ScreenEvaluation::Init()
|
||||
m_LargeBanner.ScaleToClipped( BANNER_WIDTH, BANNER_HEIGHT );
|
||||
m_LargeBanner.SetName( "LargeBanner" );
|
||||
ActorUtil::LoadAllCommands( m_LargeBanner, m_sName );
|
||||
SET_XY( m_LargeBanner );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_LargeBanner );
|
||||
this->AddChild( &m_LargeBanner );
|
||||
|
||||
m_sprLargeBannerFrame.Load( THEME->GetPathG(m_sName,"banner frame") );
|
||||
m_sprLargeBannerFrame->SetName( "LargeBannerFrame" );
|
||||
ActorUtil::LoadAllCommands( *m_sprLargeBannerFrame, m_sName );
|
||||
SET_XY( m_sprLargeBannerFrame );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_sprLargeBannerFrame );
|
||||
this->AddChild( m_sprLargeBannerFrame );
|
||||
}
|
||||
}
|
||||
@@ -317,7 +317,7 @@ void ScreenEvaluation::Init()
|
||||
m_DifficultyIcon[p].SetFromSteps( p, GAMESTATE->m_pCurSteps[p] );
|
||||
m_DifficultyIcon[p].SetName( ssprintf("DifficultyIconP%d",p+1) );
|
||||
ActorUtil::LoadAllCommands( m_DifficultyIcon[p], m_sName );
|
||||
SET_XY( m_DifficultyIcon[p] );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_DifficultyIcon[p] );
|
||||
this->AddChild( &m_DifficultyIcon[p] );
|
||||
|
||||
m_DifficultyMeter[p].SetName( ssprintf("DifficultyMeterP%d",p+1) );
|
||||
@@ -327,13 +327,13 @@ void ScreenEvaluation::Init()
|
||||
else
|
||||
m_DifficultyMeter[p].SetFromSteps( GAMESTATE->m_pCurSteps[p] );
|
||||
ActorUtil::LoadAllCommands( m_DifficultyMeter[p], m_sName );
|
||||
SET_XY( m_DifficultyMeter[p] );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_DifficultyMeter[p] );
|
||||
this->AddChild( &m_DifficultyMeter[p] );
|
||||
|
||||
m_textPlayerOptions[p].LoadFromFont( THEME->GetPathF(m_sName,"PlayerOptions") );
|
||||
m_textPlayerOptions[p].SetName( ssprintf("PlayerOptionsP%d",p+1) );
|
||||
ActorUtil::LoadAllCommands( m_textPlayerOptions[p], m_sName );
|
||||
SET_XY( m_textPlayerOptions[p] );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_textPlayerOptions[p] );
|
||||
vector<RString> v;
|
||||
GAMESTATE->m_pPlayerState[p]->m_PlayerOptions.GetStage().GetLocalizedMods( v );
|
||||
RString sPO = join( PLAYER_OPTIONS_SEPARATOR, v );
|
||||
@@ -353,14 +353,14 @@ void ScreenEvaluation::Init()
|
||||
m_sprGradeFrame[p].Load( THEME->GetPathG(m_sName,ssprintf("grade frame p%d",p+1)) );
|
||||
m_sprGradeFrame[p]->SetName( ssprintf("GradeFrameP%d",p+1) );
|
||||
ActorUtil::LoadAllCommands( *m_sprGradeFrame[p], m_sName );
|
||||
SET_XY( m_sprGradeFrame[p] );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_sprGradeFrame[p] );
|
||||
this->AddChild( m_sprGradeFrame[p] );
|
||||
|
||||
m_Grades[p].Load( THEME->GetPathG(m_sName,"grades") );
|
||||
m_Grades[p].SetGrade( p, grade[p] );
|
||||
m_Grades[p].SetName( ssprintf("GradeP%d",p+1) );
|
||||
ActorUtil::LoadAllCommands( m_Grades[p], m_sName );
|
||||
SET_XY( m_Grades[p] );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_Grades[p] );
|
||||
this->AddChild( &m_Grades[p] );
|
||||
}
|
||||
}
|
||||
@@ -375,7 +375,7 @@ void ScreenEvaluation::Init()
|
||||
m_sprPercentFrame[p].Load( THEME->GetPathG(m_sName,ssprintf("percent frame p%d",p+1)) );
|
||||
m_sprPercentFrame[p]->SetName( ssprintf("PercentFrameP%d",p+1) );
|
||||
ActorUtil::LoadAllCommands( *m_sprPercentFrame[p], m_sName );
|
||||
SET_XY( m_sprPercentFrame[p] );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_sprPercentFrame[p] );
|
||||
this->AddChild( m_sprPercentFrame[p] );
|
||||
|
||||
/* Use "ScreenEvaluation Percent" for the [metric set], but position and
|
||||
@@ -383,7 +383,7 @@ void ScreenEvaluation::Init()
|
||||
m_Percent[p].SetName( ssprintf("PercentP%d",p+1) );
|
||||
m_Percent[p].Load( GAMESTATE->m_pPlayerState[p], &STATSMAN->m_CurStageStats.m_player[p], "ScreenEvaluation Percent", true );
|
||||
ActorUtil::LoadAllCommands( m_Percent[p], m_sName );
|
||||
SET_XY( m_Percent[p] );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_Percent[p] );
|
||||
this->AddChild( &m_Percent[p] );
|
||||
}
|
||||
}
|
||||
@@ -398,7 +398,7 @@ void ScreenEvaluation::Init()
|
||||
m_sprBonusFrame[p].Load( THEME->GetPathG(m_sName,ssprintf("bonus frame p%d",p+1)) );
|
||||
m_sprBonusFrame[p]->SetName( ssprintf("BonusFrameP%d",p+1) );
|
||||
ActorUtil::LoadAllCommands( *m_sprBonusFrame[p], m_sName );
|
||||
SET_XY( m_sprBonusFrame[p] );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_sprBonusFrame[p] );
|
||||
this->AddChild( m_sprBonusFrame[p] );
|
||||
|
||||
for( int r=0; r<NUM_SHOWN_RADAR_CATEGORIES; r++ ) // foreach line
|
||||
@@ -407,7 +407,7 @@ void ScreenEvaluation::Init()
|
||||
m_sprPossibleBar[p][r].SetWidth( m_sprPossibleBar[p][r].GetUnzoomedWidth() * STATSMAN->m_CurStageStats.m_player[p].m_radarPossible[r] );
|
||||
m_sprPossibleBar[p][r].SetName( ssprintf("BarPossible%dP%d",r+1,p+1) );
|
||||
ActorUtil::LoadAllCommands( m_sprPossibleBar[p][r], m_sName );
|
||||
SET_XY( m_sprPossibleBar[p][r] );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_sprPossibleBar[p][r] );
|
||||
this->AddChild( &m_sprPossibleBar[p][r] );
|
||||
|
||||
m_sprActualBar[p][r].Load( THEME->GetPathG(m_sName,ssprintf("bar actual p%d",p+1)) );
|
||||
@@ -419,7 +419,7 @@ void ScreenEvaluation::Init()
|
||||
|
||||
m_sprActualBar[p][r].SetName( ssprintf("BarActual%dP%d",r+1,p+1) );
|
||||
ActorUtil::LoadAllCommands( m_sprActualBar[p][r], m_sName );
|
||||
SET_XY( m_sprActualBar[p][r] );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_sprActualBar[p][r] );
|
||||
|
||||
// .99999 is fairly close to 1.00, so we use that
|
||||
if( STATSMAN->m_CurStageStats.m_player[p].m_radarActual[r] > 0.99999f )
|
||||
@@ -439,7 +439,7 @@ void ScreenEvaluation::Init()
|
||||
m_sprSurvivedFrame[p].Load( THEME->GetPathG(m_sName,ssprintf("survived frame p%d",p+1)) );
|
||||
m_sprSurvivedFrame[p]->SetName( ssprintf("SurvivedFrameP%d",p+1) );
|
||||
ActorUtil::LoadAllCommands( *m_sprSurvivedFrame[p], m_sName );
|
||||
SET_XY( m_sprSurvivedFrame[p] );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_sprSurvivedFrame[p] );
|
||||
this->AddChild( m_sprSurvivedFrame[p] );
|
||||
|
||||
m_textSurvivedNumber[p].LoadFromFont( THEME->GetPathF(m_sName, "stage") );
|
||||
@@ -449,7 +449,7 @@ void ScreenEvaluation::Init()
|
||||
m_textSurvivedNumber[p].SetText( ssprintf("%02d", STATSMAN->m_CurStageStats.m_player[p].m_iSongsPassed) );
|
||||
m_textSurvivedNumber[p].SetName( ssprintf("SurvivedNumberP%d",p+1) );
|
||||
ActorUtil::LoadAllCommands( m_textSurvivedNumber[p], m_sName );
|
||||
SET_XY( m_textSurvivedNumber[p] );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_textSurvivedNumber[p] );
|
||||
this->AddChild( &m_textSurvivedNumber[p] );
|
||||
}
|
||||
}
|
||||
@@ -464,7 +464,7 @@ void ScreenEvaluation::Init()
|
||||
m_sprWinFrame[p].Load( THEME->GetPathG(m_sName,ssprintf("win frame p%d",p+1)) );
|
||||
m_sprWinFrame[p]->SetName( ssprintf("WinFrameP%d",p+1) );
|
||||
ActorUtil::LoadAllCommands( *m_sprWinFrame[p], m_sName );
|
||||
SET_XY( m_sprWinFrame[p] );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_sprWinFrame[p] );
|
||||
this->AddChild( m_sprWinFrame[p] );
|
||||
|
||||
m_sprWin[p].Load( THEME->GetPathG(m_sName,ssprintf("win p%d 1x3",p+1)) );
|
||||
@@ -473,7 +473,7 @@ void ScreenEvaluation::Init()
|
||||
m_sprWin[p].SetState( iFrame );
|
||||
m_sprWin[p].SetName( ssprintf("WinP%d",p+1) );
|
||||
ActorUtil::LoadAllCommands( m_sprWin[p], m_sName );
|
||||
SET_XY( m_sprWin[p] );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_sprWin[p] );
|
||||
this->AddChild( &m_sprWin[p] );
|
||||
}
|
||||
}
|
||||
@@ -495,7 +495,7 @@ void ScreenEvaluation::Init()
|
||||
m_sprJudgeLabels[l].SetState( l );
|
||||
m_sprJudgeLabels[l].SetName( JudgeLineToString(l)+"Label" );
|
||||
ActorUtil::LoadAllCommands( m_sprJudgeLabels[l], m_sName );
|
||||
SET_XY( m_sprJudgeLabels[l] );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_sprJudgeLabels[l] );
|
||||
this->AddChild( &m_sprJudgeLabels[l] );
|
||||
}
|
||||
|
||||
@@ -506,7 +506,7 @@ void ScreenEvaluation::Init()
|
||||
m_textJudgeNumbers[l][p].RunCommands( CommonMetrics::PLAYER_COLOR.GetValue(p) );
|
||||
m_textJudgeNumbers[l][p].SetName( JudgeLineToString(l)+ssprintf("NumberP%d",p+1) );
|
||||
ActorUtil::LoadAllCommands( m_textJudgeNumbers[l][p], m_sName );
|
||||
SET_XY( m_textJudgeNumbers[l][p] );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_textJudgeNumbers[l][p] );
|
||||
this->AddChild( &m_textJudgeNumbers[l][p] );
|
||||
|
||||
int iValue;
|
||||
@@ -541,7 +541,7 @@ void ScreenEvaluation::Init()
|
||||
m_sprStatsLabel[l]->StopAnimating();
|
||||
m_sprStatsLabel[l]->SetName( StatLineToString(l)+"Label" );
|
||||
ActorUtil::LoadAllCommands( *m_sprStatsLabel[l], m_sName );
|
||||
SET_XY( m_sprStatsLabel[l] );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_sprStatsLabel[l] );
|
||||
this->AddChild( m_sprStatsLabel[l] );
|
||||
}
|
||||
|
||||
@@ -551,7 +551,7 @@ void ScreenEvaluation::Init()
|
||||
m_textStatsText[l][p].RunCommands( CommonMetrics::PLAYER_COLOR.GetValue(p) );
|
||||
m_textStatsText[l][p].SetName( StatLineToString(l)+ssprintf("TextP%d",p+1) );
|
||||
ActorUtil::LoadAllCommands( m_textStatsText[l][p], m_sName );
|
||||
SET_XY( m_textStatsText[l][p] );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_textStatsText[l][p] );
|
||||
this->AddChild( &m_textStatsText[l][p] );
|
||||
|
||||
static const int indeces[NUM_StatLine] =
|
||||
@@ -574,7 +574,7 @@ void ScreenEvaluation::Init()
|
||||
m_sprScoreLabel.Load( THEME->GetPathG(m_sName,"score label") );
|
||||
m_sprScoreLabel->SetName( "ScoreLabel" );
|
||||
ActorUtil::LoadAllCommands( *m_sprScoreLabel, m_sName );
|
||||
SET_XY( m_sprScoreLabel );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_sprScoreLabel );
|
||||
this->AddChild( m_sprScoreLabel );
|
||||
|
||||
FOREACH_EnabledPlayer( p )
|
||||
@@ -584,7 +584,7 @@ void ScreenEvaluation::Init()
|
||||
m_textScore[p].RunCommands( CommonMetrics::PLAYER_COLOR.GetValue(p) );
|
||||
m_textScore[p].SetName( ssprintf("ScoreNumberP%d",p+1) );
|
||||
ActorUtil::LoadAllCommands( m_textScore[p], m_sName );
|
||||
SET_XY( m_textScore[p] );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_textScore[p] );
|
||||
m_textScore[p].SetText( ssprintf("%*.0i", NUM_SCORE_DIGITS, STATSMAN->m_CurStageStats.m_player[p].m_iScore) );
|
||||
this->AddChild( &m_textScore[p] );
|
||||
}
|
||||
@@ -595,7 +595,7 @@ void ScreenEvaluation::Init()
|
||||
m_sprTotalScoreLabel.Load( THEME->GetPathG(m_sName,"totalscore label") );
|
||||
m_sprTotalScoreLabel->SetName( "TotalScoreLabel" );
|
||||
ActorUtil::LoadAllCommands( *m_sprTotalScoreLabel, m_sName );
|
||||
SET_XY( m_sprTotalScoreLabel );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_sprTotalScoreLabel );
|
||||
this->AddChild( m_sprTotalScoreLabel );
|
||||
|
||||
FOREACH_EnabledPlayer( p )
|
||||
@@ -612,7 +612,7 @@ void ScreenEvaluation::Init()
|
||||
m_textTotalScore[p].SetName( ssprintf("TotalScoreNumberP%d",p+1) );
|
||||
m_textTotalScore[p].SetText( ssprintf("%*.0i", NUM_SCORE_DIGITS+2, iTotalScore) );
|
||||
ActorUtil::LoadAllCommands( m_textTotalScore[p], m_sName );
|
||||
SET_XY( m_textTotalScore[p] );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_textTotalScore[p] );
|
||||
|
||||
this->AddChild( &m_textTotalScore[p] );
|
||||
}
|
||||
@@ -626,7 +626,7 @@ void ScreenEvaluation::Init()
|
||||
m_sprTimeLabel.Load( THEME->GetPathG(m_sName,"time label") );
|
||||
m_sprTimeLabel->SetName( "TimeLabel" );
|
||||
ActorUtil::LoadAllCommands( *m_sprTimeLabel, m_sName );
|
||||
SET_XY( m_sprTimeLabel );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_sprTimeLabel );
|
||||
this->AddChild( m_sprTimeLabel );
|
||||
|
||||
FOREACH_EnabledPlayer( p )
|
||||
@@ -636,7 +636,7 @@ void ScreenEvaluation::Init()
|
||||
m_textTime[p].RunCommands( CommonMetrics::PLAYER_COLOR.GetValue(p) );
|
||||
m_textTime[p].SetName( ssprintf("TimeNumberP%d",p+1) );
|
||||
ActorUtil::LoadAllCommands( m_textTime[p], m_sName );
|
||||
SET_XY( m_textTime[p] );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_textTime[p] );
|
||||
m_textTime[p].SetText( SecondsToMMSSMsMs(STATSMAN->m_CurStageStats.m_player[p].m_fAliveSeconds) );
|
||||
this->AddChild( &m_textTime[p] );
|
||||
}
|
||||
@@ -655,7 +655,7 @@ void ScreenEvaluation::Init()
|
||||
m_sprMachineRecord[p].Load( THEME->GetPathG( m_sName, ssprintf("MachineRecord %02d",STATSMAN->m_CurStageStats.m_player[p].m_iMachineHighScoreIndex+1) ) );
|
||||
m_sprMachineRecord[p]->SetName( ssprintf("MachineRecordP%d",p+1) );
|
||||
ActorUtil::LoadAllCommands( *m_sprMachineRecord[p], m_sName );
|
||||
SET_XY( m_sprMachineRecord[p] );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_sprMachineRecord[p] );
|
||||
this->AddChild( m_sprMachineRecord[p] );
|
||||
}
|
||||
if( STATSMAN->m_CurStageStats.m_player[p].m_iPersonalHighScoreIndex != -1 )
|
||||
@@ -663,7 +663,7 @@ void ScreenEvaluation::Init()
|
||||
m_sprPersonalRecord[p].Load( THEME->GetPathG( m_sName, ssprintf("PersonalRecord %02d",STATSMAN->m_CurStageStats.m_player[p].m_iPersonalHighScoreIndex+1) ) );
|
||||
m_sprPersonalRecord[p]->SetName( ssprintf("PersonalRecordP%d",p+1) );
|
||||
ActorUtil::LoadAllCommands( *m_sprPersonalRecord[p], m_sName );
|
||||
SET_XY( m_sprPersonalRecord[p] );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_sprPersonalRecord[p] );
|
||||
this->AddChild( m_sprPersonalRecord[p] );
|
||||
}
|
||||
}
|
||||
@@ -683,7 +683,7 @@ void ScreenEvaluation::Init()
|
||||
m_sprTryExtraStage.Load( THEME->GetPathG(m_sName,GAMESTATE->IsExtraStage()?"try extra2":"try extra1") );
|
||||
m_sprTryExtraStage->SetName( "TryExtraStage" );
|
||||
ActorUtil::LoadAllCommands( *m_sprTryExtraStage, m_sName );
|
||||
SET_XY( m_sprTryExtraStage );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_sprTryExtraStage );
|
||||
this->AddChild( m_sprTryExtraStage );
|
||||
|
||||
if( GAMESTATE->IsExtraStage() )
|
||||
|
||||
Reference in New Issue
Block a user