simplify: Type -> Summary, pick stage or course appropriately
This commit is contained in:
@@ -68,10 +68,6 @@ const char* STATS_STRING[NUM_STATS_LINES] =
|
|||||||
#define SHOW_TOTAL_SCORE_AREA THEME->GetMetricB(m_sName,"ShowTotalScoreArea")
|
#define SHOW_TOTAL_SCORE_AREA THEME->GetMetricB(m_sName,"ShowTotalScoreArea")
|
||||||
#define SHOW_TIME_AREA THEME->GetMetricB(m_sName,"ShowTimeArea")
|
#define SHOW_TIME_AREA THEME->GetMetricB(m_sName,"ShowTimeArea")
|
||||||
#define SHOW_RECORDS_AREA THEME->GetMetricB(m_sName,"ShowRecordsArea")
|
#define SHOW_RECORDS_AREA THEME->GetMetricB(m_sName,"ShowRecordsArea")
|
||||||
#define TYPE THEME->GetMetric (m_sName,"Type")
|
|
||||||
#define PASSED_SOUND_TIME THEME->GetMetricF(m_sName,"PassedSoundTime")
|
|
||||||
#define FAILED_SOUND_TIME THEME->GetMetricF(m_sName,"FailedSoundTime")
|
|
||||||
#define NUM_SEQUENCE_SOUNDS THEME->GetMetricI(m_sName,"NumSequenceSounds")
|
|
||||||
#define MAX_COMBO_NUM_DIGITS THEME->GetMetricI(m_sName,"MaxComboNumDigits")
|
#define MAX_COMBO_NUM_DIGITS THEME->GetMetricI(m_sName,"MaxComboNumDigits")
|
||||||
#define PLAYER_OPTIONS_SEPARATOR THEME->GetMetric (m_sName,"PlayerOptionsSeparator")
|
#define PLAYER_OPTIONS_SEPARATOR THEME->GetMetric (m_sName,"PlayerOptionsSeparator")
|
||||||
|
|
||||||
@@ -177,23 +173,14 @@ void ScreenEvaluation::Init()
|
|||||||
ZERO( m_bSavedScreenshot );
|
ZERO( m_bSavedScreenshot );
|
||||||
|
|
||||||
|
|
||||||
CString sType = TYPE;
|
SUMMARY.Load( m_sName, "Summary" );
|
||||||
if( !sType.CompareNoCase("stage") )
|
|
||||||
m_Type = stage;
|
|
||||||
else if( !sType.CompareNoCase("summary") )
|
|
||||||
m_Type = summary;
|
|
||||||
else if( !sType.CompareNoCase("course") )
|
|
||||||
m_Type = course;
|
|
||||||
else
|
|
||||||
RageException::Throw("Unknown evaluation type \"%s\"", TYPE.c_str() );
|
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Figure out which statistics and songs we're going to display
|
// Figure out which statistics and songs we're going to display
|
||||||
//
|
//
|
||||||
STATSMAN->CalcAccumStageStats();
|
STATSMAN->CalcAccumStageStats();
|
||||||
|
|
||||||
if( m_Type == summary )
|
if( SUMMARY )
|
||||||
STATSMAN->GetFinalEvalStageStats( STATSMAN->m_CurStageStats );
|
STATSMAN->GetFinalEvalStageStats( STATSMAN->m_CurStageStats );
|
||||||
|
|
||||||
m_bFailed = STATSMAN->m_CurStageStats.AllFailed();
|
m_bFailed = STATSMAN->m_CurStageStats.AllFailed();
|
||||||
@@ -232,7 +219,7 @@ void ScreenEvaluation::Init()
|
|||||||
//
|
//
|
||||||
// update persistent statistics
|
// update persistent statistics
|
||||||
//
|
//
|
||||||
STATSMAN->m_CurStageStats.CommitScores( m_Type == summary );
|
STATSMAN->m_CurStageStats.CommitScores( SUMMARY );
|
||||||
|
|
||||||
FOREACH_HumanPlayer( p )
|
FOREACH_HumanPlayer( p )
|
||||||
STATSMAN->m_CurStageStats.m_player[p].CalcAwards( p );
|
STATSMAN->m_CurStageStats.m_player[p].CalcAwards( p );
|
||||||
@@ -256,7 +243,7 @@ void ScreenEvaluation::Init()
|
|||||||
m_bTryExtraStage =
|
m_bTryExtraStage =
|
||||||
GAMESTATE->HasEarnedExtraStage() &&
|
GAMESTATE->HasEarnedExtraStage() &&
|
||||||
!GAMESTATE->IsCourseMode() &&
|
!GAMESTATE->IsCourseMode() &&
|
||||||
m_Type != summary;
|
!SUMMARY;
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -270,27 +257,7 @@ void ScreenEvaluation::Init()
|
|||||||
//
|
//
|
||||||
if( SHOW_BANNER_AREA )
|
if( SHOW_BANNER_AREA )
|
||||||
{
|
{
|
||||||
switch( m_Type )
|
if( SUMMARY )
|
||||||
{
|
|
||||||
case stage:
|
|
||||||
case course:
|
|
||||||
{
|
|
||||||
if( GAMESTATE->IsCourseMode() )
|
|
||||||
m_LargeBanner.LoadFromCourse( GAMESTATE->m_pCurCourse );
|
|
||||||
else
|
|
||||||
m_LargeBanner.LoadFromSong( GAMESTATE->m_pCurSong );
|
|
||||||
m_LargeBanner.ScaleToClipped( BANNER_WIDTH, BANNER_HEIGHT );
|
|
||||||
m_LargeBanner.SetName( "LargeBanner" );
|
|
||||||
SET_XY_AND_ON_COMMAND( m_LargeBanner );
|
|
||||||
this->AddChild( &m_LargeBanner );
|
|
||||||
|
|
||||||
m_sprLargeBannerFrame.Load( THEME->GetPathG(m_sName,"banner frame") );
|
|
||||||
m_sprLargeBannerFrame->SetName( "LargeBannerFrame" );
|
|
||||||
SET_XY_AND_ON_COMMAND( m_sprLargeBannerFrame );
|
|
||||||
this->AddChild( m_sprLargeBannerFrame );
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case summary:
|
|
||||||
{
|
{
|
||||||
for( unsigned i=0; i<STATSMAN->m_CurStageStats.vpPlayedSongs.size(); i++ )
|
for( unsigned i=0; i<STATSMAN->m_CurStageStats.vpPlayedSongs.size(); i++ )
|
||||||
{
|
{
|
||||||
@@ -308,17 +275,26 @@ void ScreenEvaluation::Init()
|
|||||||
this->AddChild( m_sprSmallBannerFrame[i] );
|
this->AddChild( m_sprSmallBannerFrame[i] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
else
|
||||||
default:
|
{
|
||||||
ASSERT(0);
|
if( GAMESTATE->IsCourseMode() )
|
||||||
|
m_LargeBanner.LoadFromCourse( GAMESTATE->m_pCurCourse );
|
||||||
|
else
|
||||||
|
m_LargeBanner.LoadFromSong( GAMESTATE->m_pCurSong );
|
||||||
|
m_LargeBanner.ScaleToClipped( BANNER_WIDTH, BANNER_HEIGHT );
|
||||||
|
m_LargeBanner.SetName( "LargeBanner" );
|
||||||
|
SET_XY_AND_ON_COMMAND( m_LargeBanner );
|
||||||
|
this->AddChild( &m_LargeBanner );
|
||||||
|
|
||||||
|
m_sprLargeBannerFrame.Load( THEME->GetPathG(m_sName,"banner frame") );
|
||||||
|
m_sprLargeBannerFrame->SetName( "LargeBannerFrame" );
|
||||||
|
SET_XY_AND_ON_COMMAND( m_sprLargeBannerFrame );
|
||||||
|
this->AddChild( m_sprLargeBannerFrame );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
switch( m_Type )
|
if( !SUMMARY )
|
||||||
{
|
|
||||||
case stage:
|
|
||||||
case course:
|
|
||||||
{
|
{
|
||||||
FOREACH_EnabledPlayer( p )
|
FOREACH_EnabledPlayer( p )
|
||||||
{
|
{
|
||||||
@@ -350,12 +326,6 @@ void ScreenEvaluation::Init()
|
|||||||
this->AddChild( &m_textPlayerOptions[p] );
|
this->AddChild( &m_textPlayerOptions[p] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
case summary:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ASSERT(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -696,9 +666,12 @@ void ScreenEvaluation::Init()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
switch( m_Type )
|
if( SUMMARY || GAMESTATE->IsCourseMode() )
|
||||||
|
{
|
||||||
|
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation final "+GradeToOldString(best_grade)) );
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
case stage:
|
|
||||||
switch( GAMESTATE->m_PlayMode )
|
switch( GAMESTATE->m_PlayMode )
|
||||||
{
|
{
|
||||||
case PLAY_MODE_BATTLE:
|
case PLAY_MODE_BATTLE:
|
||||||
@@ -714,13 +687,6 @@ void ScreenEvaluation::Init()
|
|||||||
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation "+GradeToOldString(best_grade)) );
|
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation "+GradeToOldString(best_grade)) );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
case course:
|
|
||||||
case summary:
|
|
||||||
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation final "+GradeToOldString(best_grade)) );
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ASSERT(0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -978,9 +944,8 @@ void ScreenEvaluation::EndScreen()
|
|||||||
|
|
||||||
if( !GAMESTATE->IsEventMode() )
|
if( !GAMESTATE->IsEventMode() )
|
||||||
{
|
{
|
||||||
switch( m_Type )
|
if( !SUMMARY && !GAMESTATE->IsCourseMode() )
|
||||||
{
|
{
|
||||||
case stage:
|
|
||||||
if( !m_bTryExtraStage && (GAMESTATE->IsFinalStage() || GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2()) )
|
if( !m_bTryExtraStage && (GAMESTATE->IsFinalStage() || GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2()) )
|
||||||
{
|
{
|
||||||
/* Tween the screen out, but leave the MenuElements where they are.
|
/* Tween the screen out, but leave the MenuElements where they are.
|
||||||
@@ -988,7 +953,6 @@ void ScreenEvaluation::EndScreen()
|
|||||||
* tween out). */
|
* tween out). */
|
||||||
TweenOursOffScreen();
|
TweenOursOffScreen();
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
StartTransitioning( SM_GoToNextScreen );
|
StartTransitioning( SM_GoToNextScreen );
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#include "PercentageDisplay.h"
|
#include "PercentageDisplay.h"
|
||||||
#include "ActorUtil.h"
|
#include "ActorUtil.h"
|
||||||
#include "RageSound.h"
|
#include "RageSound.h"
|
||||||
|
#include "ThemeMetric.h"
|
||||||
|
|
||||||
const int MAX_SONGS_TO_SHOW = 5; // In summary, we show last 3 stages, plus extra stages if passed
|
const int MAX_SONGS_TO_SHOW = 5; // In summary, we show last 3 stages, plus extra stages if passed
|
||||||
enum JudgeLine { marvelous, perfect, great, good, boo, miss, ok, max_combo, error, NUM_JUDGE_LINES };
|
enum JudgeLine { marvelous, perfect, great, good, boo, miss, ok, max_combo, error, NUM_JUDGE_LINES };
|
||||||
@@ -21,7 +22,6 @@ enum StatsLine { jumps, holds, mines, hands, rolls, NUM_STATS_LINES };
|
|||||||
class ScreenEvaluation : public ScreenWithMenuElements
|
class ScreenEvaluation : public ScreenWithMenuElements
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum Type { stage, summary, course };
|
|
||||||
ScreenEvaluation( CString sClassName );
|
ScreenEvaluation( CString sClassName );
|
||||||
virtual void Init();
|
virtual void Init();
|
||||||
virtual void Input( const InputEventPlus &input );
|
virtual void Input( const InputEventPlus &input );
|
||||||
@@ -34,7 +34,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void EndScreen();
|
void EndScreen();
|
||||||
|
|
||||||
Type m_Type;
|
bool m_bSummary;
|
||||||
|
|
||||||
// banner area
|
// banner area
|
||||||
Banner m_LargeBanner;
|
Banner m_LargeBanner;
|
||||||
@@ -97,6 +97,8 @@ protected:
|
|||||||
|
|
||||||
RageSound m_soundStart; // sound played if the player passes or fails
|
RageSound m_soundStart; // sound played if the player passes or fails
|
||||||
|
|
||||||
|
ThemeMetric<bool> SUMMARY;
|
||||||
|
|
||||||
bool m_bSavedScreenshot[NUM_PLAYERS];
|
bool m_bSavedScreenshot[NUM_PLAYERS];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user