From 2efbf12d641d57f6bd5c4b5aaf8fe3e9f810b79e Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 16 Dec 2003 10:04:37 +0000 Subject: [PATCH] add stats area --- stepmania/src/ScreenEvaluation.cpp | 93 +++++++++++++++++++----------- stepmania/src/ScreenEvaluation.h | 7 ++- 2 files changed, 63 insertions(+), 37 deletions(-) diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index 6e4a7583b5..4e5c4bd1d8 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -40,12 +40,15 @@ const char* JUDGE_STRING[NUM_JUDGE_LINES] = { "Marvelous", "Perfect", "Great", "Good", "Boo", "Miss", "OK", "MaxCombo", "TotalError" }; +const char* STATS_STRING[NUM_STATS_LINES] = +{ + "Jumps", "Holds", "Mines", "Hands" +}; + #define SPIN_GRADES THEME->GetMetricB("ScreenEvaluation","SpinGrades") #define CHEER_DELAY_SECONDS THEME->GetMetricF("ScreenEvaluation","CheerDelaySeconds") #define BAR_ACTUAL_MAX_COMMAND THEME->GetMetric ("ScreenEvaluation","BarActualMaxCommand") -// #define JUDGE_SOUND_TIME( name ) THEME->GetMetricF( m_sName, ssprintf("JudgeSoundTime%s", name) ); -// #define SOUND_ON_FULL_ALPHA THEME->GetMetricB( m_sName, "JudgeSoundIfJudgeGraphicsFullAlpha" ) // metrics that are specific to classes derived from ScreenEvaluation #define FAILED_SCREEN THEME->GetMetric (m_sName, "FailedScreen") #define NEXT_SCREEN THEME->GetMetric (m_sName,"NextScreen") @@ -57,6 +60,7 @@ const char* JUDGE_STRING[NUM_JUDGE_LINES] = #define SHOW_SURVIVED_AREA THEME->GetMetricB(m_sName,"ShowSurvivedArea") #define SHOW_WIN_AREA THEME->GetMetricB(m_sName,"ShowWinArea") #define SHOW_JUDGMENT( l ) THEME->GetMetricB(m_sName,ssprintf("Show%s",JUDGE_STRING[l])) +#define SHOW_STAT( s ) THEME->GetMetricB(m_sName,ssprintf("Show%s",STATS_STRING[l])) #define SHOW_SCORE_AREA THEME->GetMetricB(m_sName,"ShowScoreArea") #define SHOW_TIME_AREA THEME->GetMetricB(m_sName,"ShowTimeArea") #define SHOW_GRAPH_AREA THEME->GetMetricB(m_sName,"ShowGraphArea") @@ -68,7 +72,7 @@ const char* JUDGE_STRING[NUM_JUDGE_LINES] = #define FAILED_SOUND_TIME THEME->GetMetricF(m_sName,"FailedSoundTime") #define NUM_SEQUENCE_SOUNDS THEME->GetMetricI(m_sName,"NumSequenceSounds") #define SOUNDSEQ_TIME( i ) THEME->GetMetricF(m_sName,ssprintf("SoundSeqTime%d", i+1)) -#define SOUNDSEQ_NAME( i ) THEME->GetMetric(m_sName,ssprintf("SoundSeqName%d", i+1)) +#define SOUNDSEQ_NAME( i ) THEME->GetMetric (m_sName,ssprintf("SoundSeqName%d", i+1)) static const int NUM_SHOWN_RADAR_CATEGORIES = 5; @@ -659,7 +663,6 @@ ScreenEvaluation::ScreenEvaluation( CString sClassName ) : Screen(sClassName) int l; for( l=0; lShowMarvelous() ) continue; // skip @@ -672,14 +675,6 @@ ScreenEvaluation::ScreenEvaluation( CString sClassName ) : Screen(sClassName) UtilSetXYAndOnCommand( m_sprJudgeLabels[l], "ScreenEvaluation" ); this->AddChild( &m_sprJudgeLabels[l] ); -#ifdef _XBOX - //shorten filenames for FATX - // m_soundJudgeSound[l].Load( THEME->GetPathToS( ssprintf("ScreenEvaluation j %s", JUDGE_STRING[l]) ) ); -#else - // m_soundJudgeSound[l].Load( THEME->GetPathToS( ssprintf("ScreenEvaluation JudgeSound %s", JUDGE_STRING[l]) ) ); -#endif - // m_TimeToPlayJudgeSound[l] = JUDGE_SOUND_TIME( JUDGE_STRING[l] ); - for( p=0; pIsPlayerEnabled( (PlayerNumber)p ) ) @@ -711,6 +706,41 @@ ScreenEvaluation::ScreenEvaluation( CString sClassName ) : Screen(sClassName) } } + for( l=0; lGetPathToG( ssprintf("ScreenEvaluation label %s", STATS_STRING[l]) ) ); + m_sprStatsLabel[l]->StopAnimating(); + m_sprStatsLabel[l]->SetState( l ); + m_sprStatsLabel[l]->SetName( ssprintf("%sLabel",STATS_STRING[l]) ); + UtilSetXYAndOnCommand( m_sprStatsLabel[l], "ScreenEvaluation" ); + this->AddChild( m_sprStatsLabel[l] ); + + for( p=0; pIsPlayerEnabled( (PlayerNumber)p ) ) + continue; // skip + + m_textStatsText[l][p].LoadFromFont( THEME->GetPathToF("ScreenEvaluation stats") ); + m_textStatsText[l][p].SetDiffuse( PlayerToColor(p) ); + m_textStatsText[l][p].SetName( ssprintf("%sTextP%d",STATS_STRING[l],p+1) ); + UtilSetXYAndOnCommand( m_textStatsText[l][p], "ScreenEvaluation" ); + this->AddChild( &m_textStatsText[l][p] ); + + const int indeces[NUM_STATS_LINES] = + { + RADAR_NUM_JUMPS, RADAR_NUM_HOLDS, RADAR_NUM_MINES, RADAR_NUM_HANDS + }; + const int ind = indeces[l]; + const int iActual = (int) roundf(stageStats.fRadarActual[p][ind]); + const int iPossible = (int) roundf(stageStats.fRadarPossible[p][ind]); + + m_textStatsText[l][p].SetText( ssprintf("%i/%i",iActual, iPossible) ); + } + } + // // init score area // @@ -1008,6 +1038,22 @@ void ScreenEvaluation::TweenOffScreen() } } + // stats area + for( l=0; lIsPlayerEnabled(p) ) + continue; + UtilOffCommand( m_textStatsText[l][p], "ScreenEvaluation" ); + } + } + // score area if( SHOW_SCORE_AREA ) { @@ -1107,29 +1153,6 @@ void ScreenEvaluation::Update( float fDeltaTime ) if( SHOW_SCORE_AREA ) m_textScore[p].SetText( ssprintf("%*.0i", NUM_SCORE_DIGITS, GAMESTATE->m_CurStageStats.iScore[p]) ); } - -/* for( int l=0; l