2003-02-16 04:01:45 +00:00
|
|
|
#include "global.h"
|
2002-06-24 22:04:31 +00:00
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
Class: ScreenEvaluation
|
|
|
|
|
|
|
|
|
|
Desc: See header.
|
|
|
|
|
|
|
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
|
|
|
|
Chris Danford
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "ScreenEvaluation.h"
|
|
|
|
|
#include "SongManager.h"
|
|
|
|
|
#include "ScreenManager.h"
|
|
|
|
|
#include "GameManager.h"
|
|
|
|
|
#include "RageUtil.h"
|
|
|
|
|
#include "GameConstantsAndTypes.h"
|
|
|
|
|
#include "Notes.h"
|
2002-07-23 01:41:40 +00:00
|
|
|
#include "PrefsManager.h"
|
2002-06-24 22:04:31 +00:00
|
|
|
#include "RageLog.h"
|
|
|
|
|
#include "AnnouncerManager.h"
|
2002-07-23 01:41:40 +00:00
|
|
|
#include "GameState.h"
|
2002-08-27 03:59:22 +00:00
|
|
|
#include "GrooveRadar.h"
|
2002-11-11 04:53:31 +00:00
|
|
|
#include "ThemeManager.h"
|
2003-01-02 07:54:28 +00:00
|
|
|
#include "RageSoundManager.h"
|
2003-04-15 02:47:24 +00:00
|
|
|
#include "ActorUtil.h"
|
2003-05-11 22:19:40 +00:00
|
|
|
#include "RageTimer.h"
|
2002-08-27 03:59:22 +00:00
|
|
|
|
2003-03-28 23:13:32 +00:00
|
|
|
const int NUM_SCORE_DIGITS = 9;
|
|
|
|
|
|
2003-03-28 05:47:42 +00:00
|
|
|
// metrics that are common to all ScreenEvaluation classes
|
|
|
|
|
#define BANNER_WIDTH THEME->GetMetricF("ScreenEvaluation","BannerWidth")
|
|
|
|
|
#define BANNER_HEIGHT THEME->GetMetricF("ScreenEvaluation","BannerHeight")
|
2003-04-15 02:47:24 +00:00
|
|
|
const char* JUDGE_STRING[NUM_JUDGE_LINES] = { "Marvelous", "Perfect", "Great", "Good", "Boo", "Miss", "OK", "MaxCombo" };
|
|
|
|
|
#define SPIN_GRADES THEME->GetMetricB("ScreenEvaluation","SpinGrades")
|
|
|
|
|
#define CHEER_DELAY_SECONDS THEME->GetMetricF("ScreenEvaluation","CheerDelaySeconds")
|
|
|
|
|
#define BAR_ACTUAL_MAX_COMMAND THEME->GetMetric ("ScreenEvaluation","BarActualMaxCommand")
|
|
|
|
|
|
|
|
|
|
/*
|
2003-03-28 05:47:42 +00:00
|
|
|
#define LARGE_BANNER_ON_COMMAND THEME->GetMetric ("ScreenEvaluation","LargeBannerOnCommand")
|
2003-04-15 02:47:24 +00:00
|
|
|
#define LARGE_BANNER_UtilOffCommand THEME->GetMetric ("ScreenEvaluation","LargeBannerUtilOffCommand")
|
2003-03-28 05:47:42 +00:00
|
|
|
#define STAGE_ON_COMMAND THEME->GetMetric ("ScreenEvaluation","StageOnCommand")
|
2003-04-15 02:47:24 +00:00
|
|
|
#define STAGE_UtilOffCommand THEME->GetMetric ("ScreenEvaluation","StageUtilOffCommand")
|
2003-03-28 05:47:42 +00:00
|
|
|
#define DIFFICULTY_ICON_ON_COMMAND( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("DifficultyIconP%dOnCommand",p+1))
|
2003-04-15 02:47:24 +00:00
|
|
|
#define DIFFICULTY_ICON_UtilOffCommand( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("DifficultyIconP%dUtilOffCommand",p+1))
|
2003-03-28 05:47:42 +00:00
|
|
|
#define PLAYER_OPTIONS_ON_COMMAND( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("PlayerOptionsP%dOnCommand",p+1))
|
2003-04-15 02:47:24 +00:00
|
|
|
#define PLAYER_OPTIONS_UtilOffCommand( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("PlayerOptionsP%dUtilOffCommand",p+1))
|
2003-03-28 05:47:42 +00:00
|
|
|
#define SMALL_BANNER_ON_COMMAND( i ) THEME->GetMetric ("ScreenEvaluation",ssprintf("SmallBanner%dOnCommand",i+1))
|
2003-04-15 02:47:24 +00:00
|
|
|
#define SMALL_BANNER_UtilOffCommand( i ) THEME->GetMetric ("ScreenEvaluation",ssprintf("SmallBanner%dUtilOffCommand",i+1))
|
2003-03-28 05:47:42 +00:00
|
|
|
#define GRADE_FRAME_ON_COMMAND( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("GradeFrameP%dOnCommand",p+1))
|
2003-04-15 02:47:24 +00:00
|
|
|
#define GRADE_FRAME_UtilOffCommand( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("GradeFrameP%dUtilOffCommand",p+1))
|
2003-03-28 05:47:42 +00:00
|
|
|
#define GRADE_ON_COMMAND( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("GradeP%dOnCommand",p+1))
|
2003-04-15 02:47:24 +00:00
|
|
|
#define GRADE_UtilOffCommand( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("GradeP%dUtilOffCommand",p+1))
|
2003-03-28 05:47:42 +00:00
|
|
|
#define PERCENT_FRAME_ON_COMMAND( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("PercentFrameP%dOnCommand",p+1))
|
2003-04-15 02:47:24 +00:00
|
|
|
#define PERCENT_FRAME_UtilOffCommand( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("PercentFrameP%dUtilOffCommand",p+1))
|
2003-03-28 05:47:42 +00:00
|
|
|
#define PERCENT_WHOLE_ON_COMMAND( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("PercentWholeP%dOnCommand",p+1))
|
2003-04-15 02:47:24 +00:00
|
|
|
#define PERCENT_WHOLE_UtilOffCommand( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("PercentWholeP%dUtilOffCommand",p+1))
|
2003-03-28 05:47:42 +00:00
|
|
|
#define PERCENT_REMAINDER_ON_COMMAND( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("PercentRemainderP%dOnCommand",p+1))
|
2003-04-15 02:47:24 +00:00
|
|
|
#define PERCENT_REMAINDER_UtilOffCommand( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("PercentRemainderP%dUtilOffCommand",p+1))
|
2003-03-28 05:47:42 +00:00
|
|
|
#define DANCE_POINTS_ON_COMMAND( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("DancePointsP%dOnCommand",p+1))
|
2003-04-15 02:47:24 +00:00
|
|
|
#define DANCE_POINTS_UtilOffCommand( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("DancePointsP%dUtilOffCommand",p+1))
|
2003-03-28 05:47:42 +00:00
|
|
|
#define JUDGE_LABEL_ON_COMMAND( l ) THEME->GetMetric ("ScreenEvaluation",ssprintf("%sLabelOnCommand",JUDGE_STRING[l]))
|
2003-04-15 02:47:24 +00:00
|
|
|
#define JUDGE_LABEL_UtilOffCommand( l ) THEME->GetMetric ("ScreenEvaluation",ssprintf("%sLabelUtilOffCommand",JUDGE_STRING[l]))
|
2003-03-28 05:47:42 +00:00
|
|
|
#define JUDGE_NUMBER_ON_COMMAND( l, p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("%sNumberP%dOnCommand",JUDGE_STRING[l],p+1))
|
2003-04-15 02:47:24 +00:00
|
|
|
#define JUDGE_NUMBER_UtilOffCommand( l, p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("%sNumberP%dUtilOffCommand",JUDGE_STRING[l],p+1))
|
2003-03-28 05:47:42 +00:00
|
|
|
#define SCORE_LABEL_ON_COMMAND THEME->GetMetric ("ScreenEvaluation","ScoreLabelOnCommand")
|
2003-04-15 02:47:24 +00:00
|
|
|
#define SCORE_LABEL_UtilOffCommand THEME->GetMetric ("ScreenEvaluation","ScoreLabelUtilOffCommand")
|
2003-03-28 05:47:42 +00:00
|
|
|
#define SCORE_NUMBER_ON_COMMAND( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("ScoreNumberP%dOnCommand",p+1))
|
2003-04-15 02:47:24 +00:00
|
|
|
#define SCORE_NUMBER_UtilOffCommand( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("ScoreNumberP%dUtilOffCommand",p+1))
|
2003-03-28 05:47:42 +00:00
|
|
|
#define TIME_LABEL_ON_COMMAND THEME->GetMetric ("ScreenEvaluation","TimeLabelOnCommand")
|
2003-04-15 02:47:24 +00:00
|
|
|
#define TIME_LABEL_UtilOffCommand THEME->GetMetric ("ScreenEvaluation","TimeLabelUtilOffCommand")
|
2003-03-28 05:47:42 +00:00
|
|
|
#define TIME_NUMBER_ON_COMMAND( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("TimeNumberP%dOnCommand",p+1))
|
2003-04-15 02:47:24 +00:00
|
|
|
#define TIME_NUMBER_UtilOffCommand( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("TimeNumberP%dUtilOffCommand",p+1))
|
2003-03-28 05:47:42 +00:00
|
|
|
#define BONUS_FRAME_ON_COMMAND( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("BonusFrameP%dOnCommand",p+1))
|
2003-04-15 02:47:24 +00:00
|
|
|
#define BONUS_FRAME_UtilOffCommand( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("BonusFrameP%dUtilOffCommand",p+1))
|
2003-03-28 05:47:42 +00:00
|
|
|
#define BAR_POSSIBLE_ON_COMMAND( i, p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("BarPossible%dP%dOnCommand",i+1,p+1))
|
2003-04-15 02:47:24 +00:00
|
|
|
#define BAR_POSSIBLE_UtilOffCommand( i, p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("BarPossible%dP%dUtilOffCommand",i+1,p+1))
|
2003-03-28 05:47:42 +00:00
|
|
|
#define BAR_ACTUAL_ON_COMMAND( i, p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("BarActual%dP%dOnCommand",i+1,p+1))
|
2003-04-15 02:47:24 +00:00
|
|
|
#define BAR_ACTUAL_UtilOffCommand( i, p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("BarActual%dP%dUtilOffCommand",i+1,p+1))
|
2003-03-28 05:47:42 +00:00
|
|
|
#define SURVIVED_FRAME_ON_COMMAND( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("SurvivedFrameP%dOnCommand",p+1))
|
2003-04-15 02:47:24 +00:00
|
|
|
#define SURVIVED_FRAME_UtilOffCommand( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("SurvivedFrameP%dUtilOffCommand",p+1))
|
2003-03-28 05:47:42 +00:00
|
|
|
#define SURVIVED_NUMBER_ON_COMMAND( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("SurvivedNumberP%dOnCommand",p+1))
|
2003-04-15 02:47:24 +00:00
|
|
|
#define SURVIVED_NUMBER_UtilOffCommand( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("SurvivedNumberP%dUtilOffCommand",p+1))
|
2003-03-28 05:47:42 +00:00
|
|
|
#define NEW_RECORD_ON_COMMAND( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("NewRecordP%dOnCommand",p+1))
|
2003-04-15 02:47:24 +00:00
|
|
|
#define NEW_RECORD_UtilOffCommand( p ) THEME->GetMetric ("ScreenEvaluation",ssprintf("NewRecordP%dUtilOffCommand",p+1))
|
2003-03-28 05:47:42 +00:00
|
|
|
#define TRY_EXTRA_STAGE_ON_COMMAND THEME->GetMetric ("ScreenEvaluation",ssprintf("TryExtraStageOnCommand"))
|
2003-04-15 02:47:24 +00:00
|
|
|
#define TRY_EXTRA_STAGE_UtilOffCommand THEME->GetMetric ("ScreenEvaluation",ssprintf("TryExtraStageUtilOffCommand"))
|
|
|
|
|
*/
|
2003-03-28 05:47:42 +00:00
|
|
|
|
2003-05-22 01:34:03 +00:00
|
|
|
// #define JUDGE_SOUND_TIME( name ) THEME->GetMetricF( m_sName, ssprintf("JudgeSoundTime%s", name) );
|
|
|
|
|
// #define SOUND_ON_FULL_ALPHA THEME->GetMetricB( m_sName, "JudgeSoundIfJudgeGraphicsFullAlpha" )
|
2003-03-28 05:47:42 +00:00
|
|
|
// metrics that are specific to classes derived from ScreenEvaluation
|
2003-04-12 06:16:12 +00:00
|
|
|
#define NEXT_SCREEN THEME->GetMetric (m_sName,"NextScreen")
|
|
|
|
|
#define END_SCREEN THEME->GetMetric (m_sName,"EndScreen")
|
|
|
|
|
#define SHOW_BANNER_AREA THEME->GetMetricB(m_sName,"ShowBannerArea")
|
|
|
|
|
#define SHOW_GRADE_AREA THEME->GetMetricB(m_sName,"ShowGradeArea")
|
|
|
|
|
#define SHOW_POINTS_AREA THEME->GetMetricB(m_sName,"ShowPointsArea")
|
|
|
|
|
#define SHOW_BONUS_AREA THEME->GetMetricB(m_sName,"ShowBonusArea")
|
|
|
|
|
#define SHOW_SURVIVED_AREA THEME->GetMetricB(m_sName,"ShowSurvivedArea")
|
2003-04-15 02:47:24 +00:00
|
|
|
#define SHOW_WIN_AREA THEME->GetMetricB(m_sName,"ShowWinArea")
|
2003-04-12 06:16:12 +00:00
|
|
|
#define SHOW_JUDGMENT( l ) THEME->GetMetricB(m_sName,ssprintf("Show%s",JUDGE_STRING[l]))
|
|
|
|
|
#define SHOW_SCORE_AREA THEME->GetMetricB(m_sName,"ShowScoreArea")
|
|
|
|
|
#define SHOW_TIME_AREA THEME->GetMetricB(m_sName,"ShowTimeArea")
|
2003-03-28 05:47:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
const ScreenMessage SM_GoToSelectCourse = ScreenMessage(SM_User+3);
|
2003-03-24 21:59:50 +00:00
|
|
|
const ScreenMessage SM_GoToEvaluationSummary = ScreenMessage(SM_User+4);
|
2003-03-28 05:47:42 +00:00
|
|
|
const ScreenMessage SM_GoToEndScreen = ScreenMessage(SM_User+5);
|
|
|
|
|
const ScreenMessage SM_PlayCheer = ScreenMessage(SM_User+6);
|
2002-06-24 22:04:31 +00:00
|
|
|
|
|
|
|
|
|
2003-04-12 06:16:12 +00:00
|
|
|
ScreenEvaluation::ScreenEvaluation( CString sClassName, Type type ) : Screen(sClassName)
|
2002-06-24 22:04:31 +00:00
|
|
|
{
|
2003-01-24 02:43:07 +00:00
|
|
|
//
|
2003-03-24 21:37:13 +00:00
|
|
|
// debugging
|
2003-01-24 02:43:07 +00:00
|
|
|
//
|
2003-03-28 23:13:32 +00:00
|
|
|
/* GAMESTATE->m_PlayMode = PLAY_MODE_NONSTOP;
|
2003-03-24 21:37:13 +00:00
|
|
|
GAMESTATE->m_CurStyle = STYLE_DANCE_VERSUS;
|
|
|
|
|
GAMESTATE->m_MasterPlayerNumber = PLAYER_1;
|
2003-03-28 05:47:42 +00:00
|
|
|
GAMESTATE->m_pCurSong = SONGMAN->GetAllSongs()[0];
|
2003-03-25 21:17:29 +00:00
|
|
|
GAMESTATE->m_pCurCourse = SONGMAN->m_pCourses[0];
|
2003-03-28 05:47:42 +00:00
|
|
|
GAMESTATE->m_pCurNotes[PLAYER_1] = GAMESTATE->m_pCurSong->GetNotes( NOTES_TYPE_DANCE_SINGLE, DIFFICULTY_HARD );
|
|
|
|
|
GAMESTATE->m_pCurNotes[PLAYER_2] = GAMESTATE->m_pCurSong->GetNotes( NOTES_TYPE_DANCE_SINGLE, DIFFICULTY_HARD );
|
2003-03-24 21:37:13 +00:00
|
|
|
GAMESTATE->m_PlayerOptions[PLAYER_1].m_bHoldNotes = false;
|
|
|
|
|
GAMESTATE->m_PlayerOptions[PLAYER_2].m_bHoldNotes = false;
|
|
|
|
|
GAMESTATE->m_PlayerOptions[PLAYER_1].m_fScrollSpeed = 2;
|
|
|
|
|
GAMESTATE->m_PlayerOptions[PLAYER_2].m_fScrollSpeed = 2;
|
2003-03-28 05:47:42 +00:00
|
|
|
GAMESTATE->m_iCurrentStageIndex = 2;
|
2003-03-28 23:13:32 +00:00
|
|
|
*/
|
2003-03-24 21:37:13 +00:00
|
|
|
|
|
|
|
|
LOG->Trace( "ScreenEvaluation::ScreenEvaluation()" );
|
|
|
|
|
|
2003-04-12 06:16:12 +00:00
|
|
|
m_sName = sClassName;
|
2003-03-24 21:37:13 +00:00
|
|
|
m_Type = type;
|
|
|
|
|
|
|
|
|
|
int p;
|
2002-06-24 22:04:31 +00:00
|
|
|
|
2003-01-24 02:43:07 +00:00
|
|
|
//
|
|
|
|
|
// Figure out which statistics and songs we're going to display
|
|
|
|
|
//
|
|
|
|
|
StageStats stageStats;
|
|
|
|
|
vector<Song*> vSongsToShow;
|
2003-03-24 21:37:13 +00:00
|
|
|
switch( m_Type )
|
2002-06-24 22:04:31 +00:00
|
|
|
{
|
2003-03-24 21:37:13 +00:00
|
|
|
case summary:
|
2003-01-27 02:00:38 +00:00
|
|
|
GAMESTATE->GetFinalEvalStatsAndSongs( stageStats, vSongsToShow );
|
2002-07-28 20:28:37 +00:00
|
|
|
break;
|
2003-03-24 21:37:13 +00:00
|
|
|
case stage:
|
|
|
|
|
case course:
|
2003-01-24 02:43:07 +00:00
|
|
|
stageStats = GAMESTATE->m_CurStageStats;
|
2002-07-23 01:41:40 +00:00
|
|
|
break;
|
2003-01-24 02:43:07 +00:00
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
|
|
|
|
|
2003-03-28 23:13:32 +00:00
|
|
|
/*
|
2003-01-24 02:43:07 +00:00
|
|
|
//
|
2003-03-24 21:37:13 +00:00
|
|
|
// Debugging
|
2003-01-24 02:43:07 +00:00
|
|
|
//
|
2002-06-24 22:04:31 +00:00
|
|
|
{
|
2003-03-24 21:37:13 +00:00
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ ) // foreach line
|
|
|
|
|
for( int r=0; r<NUM_RADAR_CATEGORIES; r++ ) // foreach line
|
2002-07-16 22:00:59 +00:00
|
|
|
{
|
2003-03-24 21:37:13 +00:00
|
|
|
stageStats.fRadarPossible[p][r] = 0.5f + r/10.0f;
|
|
|
|
|
stageStats.fRadarActual[p][r] = 0.5f + r/10.0f;
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
|
|
|
|
}
|
2003-03-28 23:13:32 +00:00
|
|
|
*/
|
2002-06-24 22:04:31 +00:00
|
|
|
|
2002-07-23 01:41:40 +00:00
|
|
|
//
|
|
|
|
|
// Calculate grades
|
|
|
|
|
//
|
2002-06-24 22:04:31 +00:00
|
|
|
Grade grade[NUM_PLAYERS];
|
2002-07-23 01:41:40 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
2003-02-03 05:53:59 +00:00
|
|
|
if( GAMESTATE->IsPlayerEnabled(p) )
|
|
|
|
|
grade[p] = stageStats.GetGrade( (PlayerNumber)p );
|
2003-01-24 02:43:07 +00:00
|
|
|
else
|
2003-02-03 05:53:59 +00:00
|
|
|
grade[p] = GRADE_E;
|
2002-07-23 01:41:40 +00:00
|
|
|
}
|
|
|
|
|
|
2002-07-28 20:28:37 +00:00
|
|
|
Grade max_grade = GRADE_NO_DATA;
|
|
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
max_grade = max( max_grade, grade[p] );
|
|
|
|
|
|
2002-06-24 22:04:31 +00:00
|
|
|
|
2003-01-24 02:43:07 +00:00
|
|
|
//
|
2002-08-27 16:53:25 +00:00
|
|
|
// update persistent statistics
|
2003-01-24 02:43:07 +00:00
|
|
|
//
|
2003-03-24 21:37:13 +00:00
|
|
|
bool bNewRecord[NUM_PLAYERS];
|
|
|
|
|
ZERO( bNewRecord );
|
2002-07-31 04:59:49 +00:00
|
|
|
|
2003-02-16 10:12:03 +00:00
|
|
|
|
2003-03-24 21:37:13 +00:00
|
|
|
switch( m_Type )
|
2003-02-14 21:42:44 +00:00
|
|
|
{
|
2003-03-24 21:37:13 +00:00
|
|
|
case stage:
|
2003-02-16 10:12:03 +00:00
|
|
|
{
|
|
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
2003-05-09 05:56:05 +00:00
|
|
|
{
|
2003-04-10 05:46:31 +00:00
|
|
|
if( GAMESTATE->IsHumanPlayer(p) )
|
2003-05-09 05:56:05 +00:00
|
|
|
{
|
2003-06-18 20:08:39 +00:00
|
|
|
GAMESTATE->m_pCurNotes[p]->AddScore( (PlayerNumber)p, grade[p], stageStats.iScore[p], bNewRecord[p] );
|
2003-05-09 05:56:05 +00:00
|
|
|
}
|
|
|
|
|
}
|
2003-02-16 10:12:03 +00:00
|
|
|
}
|
2003-02-14 21:42:44 +00:00
|
|
|
break;
|
2003-03-24 21:37:13 +00:00
|
|
|
case summary:
|
2003-02-16 10:12:03 +00:00
|
|
|
{
|
|
|
|
|
NotesType nt = GAMESTATE->GetCurrentStyleDef()->m_NotesType;
|
2003-04-10 05:46:31 +00:00
|
|
|
bool bIsHumanPlayer[NUM_PLAYERS];
|
2003-02-16 10:12:03 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
2003-04-10 05:46:31 +00:00
|
|
|
bIsHumanPlayer[p] = GAMESTATE->IsHumanPlayer(p);
|
2003-02-16 10:12:03 +00:00
|
|
|
|
|
|
|
|
RankingCategory cat[NUM_PLAYERS];
|
|
|
|
|
int iRankingIndex[NUM_PLAYERS];
|
2003-05-11 08:19:24 +00:00
|
|
|
float fTotalDP = 0;
|
2003-02-16 10:12:03 +00:00
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
|
|
|
|
float fAverageMeter = stageStats.iMeter[p] / (float)PREFSMAN->m_iNumArcadeStages;
|
|
|
|
|
cat[p] = AverageMeterToRankingCategory( fAverageMeter );
|
2003-05-09 05:56:05 +00:00
|
|
|
fTotalDP += stageStats.iActualDancePoints[p];
|
2003-02-16 10:12:03 +00:00
|
|
|
}
|
|
|
|
|
|
2003-06-18 20:08:39 +00:00
|
|
|
SONGMAN->AddScores( nt, bIsHumanPlayer, cat, stageStats.iScore, iRankingIndex );
|
2003-02-16 10:12:03 +00:00
|
|
|
|
|
|
|
|
COPY( GAMESTATE->m_RankingCategory, cat );
|
|
|
|
|
COPY( GAMESTATE->m_iRankingIndex, iRankingIndex );
|
|
|
|
|
GAMESTATE->m_RankingNotesType = nt;
|
2003-05-09 05:56:05 +00:00
|
|
|
|
|
|
|
|
// If unlocking is enabled, save the dance points
|
|
|
|
|
if( PREFSMAN->m_bUseUnlockSystem )
|
|
|
|
|
{
|
|
|
|
|
PREFSMAN->m_fDancePointsAccumulated += fTotalDP;
|
|
|
|
|
PREFSMAN->SaveGlobalPrefsToDisk();
|
|
|
|
|
}
|
2003-02-16 10:12:03 +00:00
|
|
|
}
|
2003-02-14 21:42:44 +00:00
|
|
|
break;
|
2003-03-24 21:37:13 +00:00
|
|
|
case course:
|
2003-02-16 10:12:03 +00:00
|
|
|
{
|
|
|
|
|
NotesType nt = GAMESTATE->GetCurrentStyleDef()->m_NotesType;
|
2003-04-10 05:46:31 +00:00
|
|
|
bool bIsHumanPlayer[NUM_PLAYERS];
|
2003-02-16 10:12:03 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
2003-04-10 05:46:31 +00:00
|
|
|
bIsHumanPlayer[p] = GAMESTATE->IsHumanPlayer(p);
|
2003-02-16 10:12:03 +00:00
|
|
|
|
|
|
|
|
int iRankingIndex[NUM_PLAYERS];
|
|
|
|
|
|
|
|
|
|
Course* pCourse = GAMESTATE->m_pCurCourse;
|
2003-06-30 08:06:47 +00:00
|
|
|
|
|
|
|
|
int *score;
|
|
|
|
|
if( pCourse->IsOni() )
|
|
|
|
|
score = stageStats.iActualDancePoints;
|
|
|
|
|
else
|
|
|
|
|
score = stageStats.iScore;
|
|
|
|
|
pCourse->AddScores( nt, bIsHumanPlayer, score, stageStats.fAliveSeconds, iRankingIndex, bNewRecord );
|
2003-02-16 10:12:03 +00:00
|
|
|
COPY( GAMESTATE->m_iRankingIndex, iRankingIndex );
|
|
|
|
|
GAMESTATE->m_pRankingCourse = pCourse;
|
|
|
|
|
GAMESTATE->m_RankingNotesType = nt;
|
|
|
|
|
}
|
2003-02-14 21:42:44 +00:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
|
|
|
|
|
2003-01-24 02:43:07 +00:00
|
|
|
m_bTryExtraStage =
|
|
|
|
|
GAMESTATE->HasEarnedExtraStage() &&
|
2003-03-24 21:37:13 +00:00
|
|
|
m_Type==stage;
|
2003-02-28 04:31:36 +00:00
|
|
|
|
2003-03-24 21:37:13 +00:00
|
|
|
|
|
|
|
|
|
2003-04-12 06:16:12 +00:00
|
|
|
m_Menu.Load( m_sName );
|
2003-03-24 21:37:13 +00:00
|
|
|
this->AddChild( &m_Menu );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2003-01-24 02:43:07 +00:00
|
|
|
//
|
2003-03-24 21:37:13 +00:00
|
|
|
// init banner area
|
2003-01-24 02:43:07 +00:00
|
|
|
//
|
2003-03-28 05:47:42 +00:00
|
|
|
if( SHOW_BANNER_AREA )
|
2002-08-22 09:31:32 +00:00
|
|
|
{
|
2003-03-28 05:47:42 +00:00
|
|
|
switch( m_Type )
|
2003-03-24 21:37:13 +00:00
|
|
|
{
|
2003-03-28 05:47:42 +00:00
|
|
|
case stage:
|
2002-07-23 01:41:40 +00:00
|
|
|
{
|
2003-03-28 05:47:42 +00:00
|
|
|
m_LargeBanner.SetCroppedSize( BANNER_WIDTH, BANNER_HEIGHT );
|
|
|
|
|
m_LargeBanner.LoadFromSong( GAMESTATE->m_pCurSong );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_LargeBanner.SetName( "LargeBanner" );
|
|
|
|
|
UtilSetXYAndOnCommand( m_LargeBanner, "ScreenEvaluation" );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_LargeBanner );
|
|
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_sprLargeBannerFrame.Load( THEME->GetPathToG("ScreenEvaluation banner frame") );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_sprLargeBannerFrame.SetName( "LargeBanner" );
|
|
|
|
|
UtilSetXYAndOnCommand( m_sprLargeBannerFrame, "ScreenEvaluation" );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_sprLargeBannerFrame );
|
|
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_sprStage.Load( THEME->GetPathToG("ScreenEvaluation stage "+GAMESTATE->GetStageText()) );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_sprStage.SetName( "Stage" );
|
|
|
|
|
UtilSetXYAndOnCommand( m_sprStage, "ScreenEvaluation" );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_sprStage );
|
|
|
|
|
|
|
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
|
|
|
|
if( !GAMESTATE->IsPlayerEnabled(p) )
|
|
|
|
|
continue; // skip
|
|
|
|
|
|
2003-05-09 06:04:50 +00:00
|
|
|
m_DifficultyIcon[p].Load( THEME->GetPathToG("ScreenEvaluation difficulty icons 1x5") );
|
2003-03-28 05:47:42 +00:00
|
|
|
m_DifficultyIcon[p].SetFromNotes( (PlayerNumber)p, GAMESTATE->m_pCurNotes[p] );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_DifficultyIcon[p].SetName( ssprintf("DifficultyIconP%d",p+1) );
|
|
|
|
|
UtilSetXYAndOnCommand( m_DifficultyIcon[p], "ScreenEvaluation" );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_DifficultyIcon[p] );
|
|
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_textPlayerOptions[p].LoadFromFont( THEME->GetPathToF("Common normal") );
|
2003-03-28 05:47:42 +00:00
|
|
|
CString sPO = GAMESTATE->m_PlayerOptions[p].GetString();
|
|
|
|
|
sPO.Replace( ", ", "\n" );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_textPlayerOptions[p].SetName( ssprintf("PlayerOptionsP%d",p+1) );
|
|
|
|
|
UtilSetXYAndOnCommand( m_textPlayerOptions[p], "ScreenEvaluation" );
|
2003-03-28 05:47:42 +00:00
|
|
|
m_textPlayerOptions[p].SetText( sPO );
|
|
|
|
|
this->AddChild( &m_textPlayerOptions[p] );
|
|
|
|
|
}
|
2002-07-23 01:41:40 +00:00
|
|
|
}
|
2003-03-28 05:47:42 +00:00
|
|
|
break;
|
|
|
|
|
case summary:
|
2002-07-17 19:24:27 +00:00
|
|
|
{
|
2003-03-28 05:47:42 +00:00
|
|
|
for( unsigned i=0; i<vSongsToShow.size(); i++ )
|
|
|
|
|
{
|
|
|
|
|
m_SmallBanner[i].SetCroppedSize( BANNER_WIDTH, BANNER_HEIGHT );
|
|
|
|
|
m_SmallBanner[i].LoadFromSong( vSongsToShow[i] );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_SmallBanner[i].SetName( ssprintf("SmallBanner%d",i+1) );
|
|
|
|
|
UtilSetXYAndOnCommand( m_SmallBanner[i], "ScreenEvaluation" );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_SmallBanner[i] );
|
|
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_sprSmallBannerFrame[i].Load( THEME->GetPathToG("ScreenEvaluation banner frame") );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_sprSmallBannerFrame[i].SetName( ssprintf("SmallBanner%d",i+1) );
|
|
|
|
|
UtilSetXYAndOnCommand( m_sprSmallBannerFrame[i], "ScreenEvaluation" );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_sprSmallBannerFrame[i] );
|
|
|
|
|
}
|
2002-07-17 19:24:27 +00:00
|
|
|
}
|
2003-03-28 05:47:42 +00:00
|
|
|
break;
|
|
|
|
|
case course:
|
|
|
|
|
{
|
|
|
|
|
m_LargeBanner.SetCroppedSize( BANNER_WIDTH, BANNER_HEIGHT );
|
|
|
|
|
m_LargeBanner.LoadFromCourse( GAMESTATE->m_pCurCourse );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_LargeBanner.SetName( "LargeBanner" );
|
|
|
|
|
UtilSetXYAndOnCommand( m_LargeBanner, "ScreenEvaluation" );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_LargeBanner );
|
|
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_sprLargeBannerFrame.Load( THEME->GetPathToG("ScreenEvaluation banner frame") );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_sprLargeBannerFrame.SetName( "LargeBanner" );
|
|
|
|
|
UtilSetXYAndOnCommand( m_sprLargeBannerFrame, "ScreenEvaluation" );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_sprLargeBannerFrame );
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
2003-03-24 21:37:13 +00:00
|
|
|
}
|
2002-06-24 22:04:31 +00:00
|
|
|
|
2003-03-24 21:37:13 +00:00
|
|
|
//
|
|
|
|
|
// init grade area
|
|
|
|
|
//
|
2003-03-28 05:47:42 +00:00
|
|
|
if( SHOW_GRADE_AREA )
|
2003-03-24 21:37:13 +00:00
|
|
|
{
|
2003-03-28 05:47:42 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
|
|
|
|
if( !GAMESTATE->IsPlayerEnabled( (PlayerNumber)p ) )
|
|
|
|
|
continue; // skip
|
2003-03-24 21:37:13 +00:00
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_sprGradeFrame[p].Load( THEME->GetPathToG("ScreenEvaluation grade frame 1x2") );
|
2003-03-28 05:47:42 +00:00
|
|
|
m_sprGradeFrame[p].StopAnimating();
|
|
|
|
|
m_sprGradeFrame[p].SetState( p );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_sprGradeFrame[p].SetName( ssprintf("GradeFrameP%d",p+1) );
|
|
|
|
|
UtilSetXYAndOnCommand( m_sprGradeFrame[p], "ScreenEvaluation" );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_sprGradeFrame[p] );
|
2003-03-24 21:37:13 +00:00
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_Grades[p].Load( THEME->GetPathToG("ScreenEvaluation grades") );
|
2003-03-31 03:11:31 +00:00
|
|
|
m_Grades[p].SetGrade( (PlayerNumber)p, grade[p] );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_Grades[p].SetName( ssprintf("GradeP%d",p+1) );
|
|
|
|
|
UtilSetXYAndOnCommand( m_Grades[p], "ScreenEvaluation" );
|
2003-03-28 05:47:42 +00:00
|
|
|
if( SPIN_GRADES )
|
2003-03-31 03:11:31 +00:00
|
|
|
m_Grades[p].Spin();
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_Grades[p] );
|
2003-03-25 21:17:29 +00:00
|
|
|
}
|
2003-03-28 05:47:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// init points area
|
|
|
|
|
//
|
|
|
|
|
if( SHOW_POINTS_AREA )
|
|
|
|
|
{
|
|
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
2003-03-25 21:17:29 +00:00
|
|
|
{
|
2003-04-12 17:39:27 +00:00
|
|
|
m_sprPercentFrame[p].Load( THEME->GetPathToG("ScreenEvaluation percent frame 1x2") );
|
2003-03-28 05:47:42 +00:00
|
|
|
m_sprPercentFrame[p].StopAnimating();
|
|
|
|
|
m_sprPercentFrame[p].SetState( p );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_sprPercentFrame[p].SetName( ssprintf("PercentFrameP%d",p+1) );
|
|
|
|
|
UtilSetXYAndOnCommand( m_sprPercentFrame[p], "ScreenEvaluation" );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_sprPercentFrame[p] );
|
|
|
|
|
|
|
|
|
|
if( !PREFSMAN->m_bDancePointsForOni )
|
|
|
|
|
{
|
2003-04-12 17:39:27 +00:00
|
|
|
m_textPercentWhole[p].LoadFromNumbers( THEME->GetPathToN("ScreenEvaluation percent") );
|
2003-03-28 05:47:42 +00:00
|
|
|
m_textPercentWhole[p].EnableShadow( false );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_textPercentWhole[p].SetName( ssprintf("PercentWholeP%d",p+1) );
|
|
|
|
|
UtilSetXYAndOnCommand( m_textPercentWhole[p], "ScreenEvaluation" );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_textPercentWhole[p] );
|
|
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_textPercentRemainder[p].LoadFromNumbers( THEME->GetPathToN("ScreenEvaluation percent") );
|
2003-03-28 05:47:42 +00:00
|
|
|
m_textPercentRemainder[p].EnableShadow( false );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_textPercentRemainder[p].SetName( ssprintf("PercentRemainderP%d",p+1) );
|
|
|
|
|
UtilSetXYAndOnCommand( m_textPercentRemainder[p], "ScreenEvaluation" );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_textPercentRemainder[p] );
|
|
|
|
|
|
|
|
|
|
stageStats.iPossibleDancePoints[p] = max( 1, stageStats.iPossibleDancePoints[p] );
|
|
|
|
|
float fPercentDancePoints = stageStats.iActualDancePoints[p] / (float)stageStats.iPossibleDancePoints[p] + 0.0001f; // correct for rounding errors
|
|
|
|
|
fPercentDancePoints = max( fPercentDancePoints, 0 );
|
|
|
|
|
int iPercentWhole = int(fPercentDancePoints*100);
|
|
|
|
|
int iPercentRemainder = int( (fPercentDancePoints*100 - int(fPercentDancePoints*100)) * 10 );
|
|
|
|
|
m_textPercentWhole[p].SetText( ssprintf("%02d", iPercentWhole) );
|
|
|
|
|
m_textPercentRemainder[p].SetText( ssprintf(".%01d%%", iPercentRemainder) );
|
|
|
|
|
}
|
|
|
|
|
else // PREFSMAN->m_bDancePointsForOni
|
|
|
|
|
{
|
2003-04-12 17:39:27 +00:00
|
|
|
m_textDancePoints[p].LoadFromNumbers( THEME->GetPathToN("ScreenEvaluation percent") );
|
2003-03-28 05:47:42 +00:00
|
|
|
m_textDancePoints[p].EnableShadow( false );
|
|
|
|
|
m_textDancePoints[p].SetText( ssprintf("%d", stageStats.iActualDancePoints[p]) );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_textDancePoints[p].SetName( ssprintf("DancePointsP%d",p+1) );
|
|
|
|
|
UtilSetXYAndOnCommand( m_textDancePoints[p], "ScreenEvaluation" );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_textDancePoints[p] );
|
|
|
|
|
}
|
2003-03-25 21:17:29 +00:00
|
|
|
}
|
2003-03-24 21:37:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// init bonus area
|
|
|
|
|
//
|
2003-03-28 05:47:42 +00:00
|
|
|
if( SHOW_BONUS_AREA )
|
2003-03-24 21:37:13 +00:00
|
|
|
{
|
2003-03-28 05:47:42 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
|
|
|
|
if( !GAMESTATE->IsPlayerEnabled( (PlayerNumber)p ) )
|
|
|
|
|
continue; // skip
|
2003-03-24 21:37:13 +00:00
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_sprBonusFrame[p].Load( THEME->GetPathToG("ScreenEvaluation bonus frame 2x1") );
|
2003-03-28 05:47:42 +00:00
|
|
|
m_sprBonusFrame[p].StopAnimating();
|
|
|
|
|
m_sprBonusFrame[p].SetState( p );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_sprBonusFrame[p].SetName( ssprintf("BonusFrameP%d",p+1) );
|
|
|
|
|
UtilSetXYAndOnCommand( m_sprBonusFrame[p], "ScreenEvaluation" );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_sprBonusFrame[p] );
|
2003-03-24 21:37:13 +00:00
|
|
|
|
2003-03-28 05:47:42 +00:00
|
|
|
for( int r=0; r<NUM_RADAR_CATEGORIES; r++ ) // foreach line
|
|
|
|
|
{
|
2003-04-12 17:39:27 +00:00
|
|
|
m_sprPossibleBar[p][r].Load( THEME->GetPathToG("ScreenEvaluation bars possible 1x2") );
|
2003-03-28 05:47:42 +00:00
|
|
|
m_sprPossibleBar[p][r].StopAnimating();
|
|
|
|
|
m_sprPossibleBar[p][r].SetState( p );
|
|
|
|
|
m_sprPossibleBar[p][r].SetWidth( m_sprPossibleBar[p][r].GetUnzoomedWidth() * stageStats.fRadarPossible[p][r] );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_sprPossibleBar[p][r].SetName( ssprintf("BarPossible%dP%d",r+1,p+1) );
|
|
|
|
|
UtilSetXYAndOnCommand( m_sprPossibleBar[p][r], "ScreenEvaluation" );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_sprPossibleBar[p][r] );
|
|
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_sprActualBar[p][r].Load( THEME->GetPathToG("ScreenEvaluation bars actual 1x2") );
|
2003-03-28 05:47:42 +00:00
|
|
|
m_sprActualBar[p][r].StopAnimating();
|
|
|
|
|
m_sprActualBar[p][r].SetState( p );
|
|
|
|
|
m_sprActualBar[p][r].SetWidth( m_sprActualBar[p][r].GetUnzoomedWidth() * stageStats.fRadarActual[p][r] );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_sprActualBar[p][r].SetName( ssprintf("BarActual%dP%d",r+1,p+1) );
|
|
|
|
|
UtilSetXYAndOnCommand( m_sprActualBar[p][r], "ScreenEvaluation" );
|
2003-03-28 05:47:42 +00:00
|
|
|
if( stageStats.fRadarActual[p][r] == stageStats.fRadarPossible[p][r] )
|
|
|
|
|
m_sprActualBar[p][r].Command( BAR_ACTUAL_MAX_COMMAND );
|
|
|
|
|
this->AddChild( &m_sprActualBar[p][r] );
|
|
|
|
|
}
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
2003-03-28 05:47:42 +00:00
|
|
|
}
|
2003-03-24 21:37:13 +00:00
|
|
|
|
2003-03-28 05:47:42 +00:00
|
|
|
//
|
|
|
|
|
// init survived area
|
|
|
|
|
//
|
|
|
|
|
if( SHOW_SURVIVED_AREA )
|
|
|
|
|
{
|
|
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
|
|
|
|
if( !GAMESTATE->IsPlayerEnabled( (PlayerNumber)p ) )
|
|
|
|
|
continue; // skip
|
|
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_sprSurvivedFrame[p].Load( THEME->GetPathToG("ScreenEvaluation survived frame 2x1") );
|
2003-03-28 05:47:42 +00:00
|
|
|
m_sprSurvivedFrame[p].StopAnimating();
|
|
|
|
|
m_sprSurvivedFrame[p].SetState( p );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_sprSurvivedFrame[p].SetName( ssprintf("SurvivedFrameP%d",p+1) );
|
|
|
|
|
UtilSetXYAndOnCommand( m_sprSurvivedFrame[p], "ScreenEvaluation" );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_sprSurvivedFrame[p] );
|
|
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_textSurvivedNumber[p].LoadFromNumbers( THEME->GetPathToN("ScreenEvaluation stage") );
|
2003-03-28 05:47:42 +00:00
|
|
|
m_textSurvivedNumber[p].EnableShadow( false );
|
|
|
|
|
m_textSurvivedNumber[p].SetText( ssprintf("%02d", stageStats.iSongsPlayed[p]) );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_textSurvivedNumber[p].SetName( ssprintf("SurvivedNumberP%d",p+1) );
|
|
|
|
|
UtilSetXYAndOnCommand( m_textSurvivedNumber[p], "ScreenEvaluation" );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_textSurvivedNumber[p] );
|
|
|
|
|
}
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
2003-03-28 05:47:42 +00:00
|
|
|
|
2003-04-15 02:47:24 +00:00
|
|
|
//
|
|
|
|
|
// init win area
|
|
|
|
|
//
|
|
|
|
|
if( SHOW_WIN_AREA )
|
|
|
|
|
{
|
|
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
|
|
|
|
if( !GAMESTATE->IsPlayerEnabled( (PlayerNumber)p ) )
|
|
|
|
|
continue; // skip
|
|
|
|
|
|
|
|
|
|
m_sprWinFrame[p].Load( THEME->GetPathToG("ScreenEvaluation win frame 2x1") );
|
|
|
|
|
m_sprWinFrame[p].StopAnimating();
|
|
|
|
|
m_sprWinFrame[p].SetState( p );
|
|
|
|
|
m_sprWinFrame[p].SetName( ssprintf("WinFrameP%d",p+1) );
|
|
|
|
|
UtilSetXYAndOnCommand( m_sprWinFrame[p], "ScreenEvaluation" );
|
|
|
|
|
this->AddChild( &m_sprWinFrame[p] );
|
|
|
|
|
|
2003-04-21 02:41:10 +00:00
|
|
|
m_sprWin[p].Load( THEME->GetPathToG("ScreenEvaluation win 2x3") );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_sprWin[p].StopAnimating();
|
2003-04-21 02:41:10 +00:00
|
|
|
int iFrame = GAMESTATE->GetBattleResult( (PlayerNumber)p )*2 + p;
|
|
|
|
|
m_sprWin[p].SetState( iFrame );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_sprWin[p].SetName( ssprintf("WinP%d",p+1) );
|
|
|
|
|
UtilSetXYAndOnCommand( m_sprWin[p], "ScreenEvaluation" );
|
|
|
|
|
this->AddChild( &m_sprWin[p] );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-01-24 02:43:07 +00:00
|
|
|
//
|
2003-03-28 05:47:42 +00:00
|
|
|
// init judgment area
|
2003-01-24 02:43:07 +00:00
|
|
|
//
|
2003-02-14 06:53:13 +00:00
|
|
|
int l;
|
|
|
|
|
for( l=0; l<NUM_JUDGE_LINES; l++ )
|
2002-09-10 08:21:55 +00:00
|
|
|
{
|
2003-05-22 01:34:03 +00:00
|
|
|
// m_TimeToPlayJudgeSound[l] = -1;
|
2003-04-11 00:12:07 +00:00
|
|
|
if( l == 0 && !PREFSMAN->m_bMarvelousTiming )
|
|
|
|
|
continue; // skip
|
|
|
|
|
|
2003-03-28 05:47:42 +00:00
|
|
|
if( SHOW_JUDGMENT(l) )
|
|
|
|
|
{
|
2003-04-12 17:39:27 +00:00
|
|
|
m_sprJudgeLabels[l].Load( THEME->GetPathToG("ScreenEvaluation judge labels 1x8") );
|
2003-03-28 05:47:42 +00:00
|
|
|
m_sprJudgeLabels[l].StopAnimating();
|
|
|
|
|
m_sprJudgeLabels[l].SetState( l );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_sprJudgeLabels[l].SetName( ssprintf("%sLabel",JUDGE_STRING[l]) );
|
|
|
|
|
UtilSetXYAndOnCommand( m_sprJudgeLabels[l], "ScreenEvaluation" );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_sprJudgeLabels[l] );
|
2002-09-10 08:21:55 +00:00
|
|
|
|
2003-05-22 01:34:03 +00:00
|
|
|
// m_soundJudgeSound[l].Load( THEME->GetPathToS( ssprintf("ScreenEvaluation JudgeSound %s", JUDGE_STRING[l]) ) );
|
|
|
|
|
// m_TimeToPlayJudgeSound[l] = JUDGE_SOUND_TIME( JUDGE_STRING[l] );
|
2003-05-11 22:19:40 +00:00
|
|
|
|
2003-03-28 05:47:42 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
|
|
|
|
if( !GAMESTATE->IsPlayerEnabled( (PlayerNumber)p ) )
|
|
|
|
|
continue; // skip
|
2002-09-10 08:21:55 +00:00
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_textJudgeNumbers[l][p].LoadFromNumbers( THEME->GetPathToN("ScreenEvaluation judge") );
|
2003-03-28 05:47:42 +00:00
|
|
|
m_textJudgeNumbers[l][p].EnableShadow( false );
|
|
|
|
|
m_textJudgeNumbers[l][p].SetDiffuse( PlayerToColor(p) );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_textJudgeNumbers[l][p].SetName( ssprintf("%sNumberP%d",JUDGE_STRING[l],p+1) );
|
|
|
|
|
UtilSetXYAndOnCommand( m_textJudgeNumbers[l][p], "ScreenEvaluation" );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_textJudgeNumbers[l][p] );
|
|
|
|
|
|
|
|
|
|
int iValue;
|
|
|
|
|
switch( l )
|
|
|
|
|
{
|
|
|
|
|
case 0: iValue = stageStats.iTapNoteScores[p][TNS_MARVELOUS]; break;
|
|
|
|
|
case 1: iValue = stageStats.iTapNoteScores[p][TNS_PERFECT]; break;
|
|
|
|
|
case 2: iValue = stageStats.iTapNoteScores[p][TNS_GREAT]; break;
|
|
|
|
|
case 3: iValue = stageStats.iTapNoteScores[p][TNS_GOOD]; break;
|
|
|
|
|
case 4: iValue = stageStats.iTapNoteScores[p][TNS_BOO]; break;
|
|
|
|
|
case 5: iValue = stageStats.iTapNoteScores[p][TNS_MISS]; break;
|
2003-04-10 05:46:31 +00:00
|
|
|
case 6: iValue = stageStats.iHoldNoteScores[p][HNS_OK]; break;
|
2003-03-28 05:47:42 +00:00
|
|
|
case 7: iValue = stageStats.iMaxCombo[p]; break;
|
2003-03-28 23:13:32 +00:00
|
|
|
default: iValue = 0; ASSERT(0);
|
2003-03-28 05:47:42 +00:00
|
|
|
}
|
|
|
|
|
m_textJudgeNumbers[l][p].SetText( ssprintf("%4d",iValue) );
|
|
|
|
|
}
|
2002-09-10 08:21:55 +00:00
|
|
|
}
|
2003-03-24 21:37:13 +00:00
|
|
|
}
|
2002-09-10 08:21:55 +00:00
|
|
|
|
2003-03-24 21:37:13 +00:00
|
|
|
//
|
|
|
|
|
// init score area
|
|
|
|
|
//
|
2003-03-28 05:47:42 +00:00
|
|
|
if( SHOW_SCORE_AREA )
|
2003-03-24 21:37:13 +00:00
|
|
|
{
|
2003-04-15 02:47:24 +00:00
|
|
|
m_sprScoreLabel.Load( THEME->GetPathToG("ScreenEvaluation score labels 1x2") );
|
|
|
|
|
m_sprScoreLabel.SetState( 0 );
|
|
|
|
|
m_sprScoreLabel.StopAnimating();
|
|
|
|
|
m_sprScoreLabel.SetName( "ScoreLabel" );
|
|
|
|
|
UtilSetXYAndOnCommand( m_sprScoreLabel, "ScreenEvaluation" );
|
|
|
|
|
this->AddChild( &m_sprScoreLabel );
|
2003-03-28 05:47:42 +00:00
|
|
|
|
|
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
|
|
|
|
if( !GAMESTATE->IsPlayerEnabled( (PlayerNumber)p ) )
|
|
|
|
|
continue; // skip
|
|
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_textScore[p].LoadFromNumbers( THEME->GetPathToN("ScreenEvaluation score") );
|
2003-03-28 23:13:32 +00:00
|
|
|
m_textScore[p].EnableShadow( false );
|
|
|
|
|
m_textScore[p].SetDiffuse( PlayerToColor(p) );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_textScore[p].SetName( ssprintf("ScoreNumberP%d",p+1) );
|
|
|
|
|
UtilSetXYAndOnCommand( m_textScore[p], "ScreenEvaluation" );
|
2003-06-18 20:08:39 +00:00
|
|
|
m_textScore[p].SetText( ssprintf("%*.0i", NUM_SCORE_DIGITS, stageStats.iScore[p]) );
|
2003-03-28 23:13:32 +00:00
|
|
|
this->AddChild( &m_textScore[p] );
|
2003-03-28 05:47:42 +00:00
|
|
|
}
|
2002-09-10 08:21:55 +00:00
|
|
|
}
|
|
|
|
|
|
2003-03-28 05:47:42 +00:00
|
|
|
//
|
|
|
|
|
// init time area
|
|
|
|
|
//
|
|
|
|
|
if( SHOW_TIME_AREA )
|
2003-03-24 21:37:13 +00:00
|
|
|
{
|
2003-04-12 17:39:27 +00:00
|
|
|
m_sprTimeLabel.Load( THEME->GetPathToG("ScreenEvaluation score labels 1x2") );
|
2003-03-28 05:47:42 +00:00
|
|
|
m_sprTimeLabel.SetState( 1 );
|
|
|
|
|
m_sprTimeLabel.StopAnimating();
|
2003-04-15 02:47:24 +00:00
|
|
|
m_sprTimeLabel.SetName( "TimeLabel" );
|
|
|
|
|
UtilSetXYAndOnCommand( m_sprTimeLabel, "ScreenEvaluation" );
|
2003-03-28 05:47:42 +00:00
|
|
|
this->AddChild( &m_sprTimeLabel );
|
2002-09-10 08:21:55 +00:00
|
|
|
|
2003-03-28 05:47:42 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
2003-03-24 21:37:13 +00:00
|
|
|
{
|
2003-03-28 05:47:42 +00:00
|
|
|
if( !GAMESTATE->IsPlayerEnabled( (PlayerNumber)p ) )
|
|
|
|
|
continue; // skip
|
|
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_textTime[p].LoadFromNumbers( THEME->GetPathToN("ScreenEvaluation score") );
|
2003-03-28 23:13:32 +00:00
|
|
|
m_textTime[p].EnableShadow( false );
|
|
|
|
|
m_textTime[p].SetDiffuse( PlayerToColor(p) );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_textTime[p].SetName( ssprintf("ScoreNumberP%d",p+1) );
|
|
|
|
|
UtilSetXYAndOnCommand( m_textTime[p], "ScreenEvaluation" );
|
2003-03-28 23:13:32 +00:00
|
|
|
m_textTime[p].SetText( SecondsToTime(stageStats.fAliveSeconds[p]) );
|
|
|
|
|
this->AddChild( &m_textTime[p] );
|
2003-03-24 21:37:13 +00:00
|
|
|
}
|
2003-03-28 05:47:42 +00:00
|
|
|
}
|
2003-03-24 21:37:13 +00:00
|
|
|
|
|
|
|
|
|
2003-03-28 05:47:42 +00:00
|
|
|
//
|
|
|
|
|
// init extra area
|
|
|
|
|
//
|
|
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
2003-03-24 21:37:13 +00:00
|
|
|
if( bNewRecord[p] )
|
|
|
|
|
{
|
2003-04-12 17:39:27 +00:00
|
|
|
m_sprNewRecord[p].Load( THEME->GetPathToG("ScreenEvaluation new record") );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_sprNewRecord[p].SetName( ssprintf("NewRecordP%d",p+1) );
|
|
|
|
|
UtilSetXYAndOnCommand( m_sprNewRecord[p], "ScreenEvaluation" );
|
2003-03-24 21:37:13 +00:00
|
|
|
this->AddChild( &m_sprNewRecord[p] );
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-09-09 05:22:02 +00:00
|
|
|
|
|
|
|
|
bool bOneHasNewRecord = false;
|
|
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
if( GAMESTATE->IsPlayerEnabled(p) && bNewRecord[p] )
|
|
|
|
|
bOneHasNewRecord = true;
|
2002-06-24 22:04:31 +00:00
|
|
|
|
|
|
|
|
if( m_bTryExtraStage )
|
|
|
|
|
{
|
2003-04-12 17:39:27 +00:00
|
|
|
m_sprTryExtraStage.Load( THEME->GetPathToG(GAMESTATE->IsExtraStage()?"ScreenEvaluation try extra2":"ScreenEvaluation try extra1") );
|
2003-04-15 02:47:24 +00:00
|
|
|
m_sprTryExtraStage.SetName( "TryExtraStage" );
|
|
|
|
|
UtilSetXYAndOnCommand( m_sprTryExtraStage, "ScreenEvaluation" );
|
2002-09-03 22:31:06 +00:00
|
|
|
this->AddChild( &m_sprTryExtraStage );
|
2002-06-24 22:04:31 +00:00
|
|
|
|
2003-03-12 01:26:44 +00:00
|
|
|
if( GAMESTATE->IsExtraStage() )
|
2003-04-12 17:39:27 +00:00
|
|
|
SOUNDMAN->PlayOnce( THEME->GetPathToS("ScreenEvaluation try extra2") );
|
2003-03-12 01:26:44 +00:00
|
|
|
else
|
2003-04-12 17:39:27 +00:00
|
|
|
SOUNDMAN->PlayOnce( THEME->GetPathToS("ScreenEvaluation try extra1") );
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
2002-10-24 01:51:01 +00:00
|
|
|
else if( bOneHasNewRecord && ANNOUNCER->HasSoundsFor("evaluation new record") )
|
2002-09-09 05:22:02 +00:00
|
|
|
{
|
2003-01-02 08:13:34 +00:00
|
|
|
SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation new record") );
|
2002-09-09 05:22:02 +00:00
|
|
|
}
|
2002-06-24 22:04:31 +00:00
|
|
|
else
|
2003-03-28 05:47:42 +00:00
|
|
|
{
|
2003-03-24 21:37:13 +00:00
|
|
|
switch( m_Type )
|
2002-06-24 22:04:31 +00:00
|
|
|
{
|
2003-03-24 21:37:13 +00:00
|
|
|
case stage:
|
2003-05-13 13:35:32 +00:00
|
|
|
switch( GAMESTATE->m_PlayMode )
|
|
|
|
|
{
|
|
|
|
|
case PLAY_MODE_BATTLE:
|
|
|
|
|
{
|
|
|
|
|
bool bWon = GAMESTATE->GetBattleResult(GAMESTATE->m_MasterPlayerNumber) == RESULT_WIN;
|
|
|
|
|
if( bWon )
|
|
|
|
|
SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation win") );
|
|
|
|
|
else
|
|
|
|
|
SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation lose") );
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation "+GradeToString(max_grade)) );
|
|
|
|
|
break;
|
|
|
|
|
}
|
2002-07-23 01:41:40 +00:00
|
|
|
break;
|
2003-03-24 21:37:13 +00:00
|
|
|
case course:
|
|
|
|
|
case summary:
|
2003-02-17 02:45:30 +00:00
|
|
|
SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation final "+GradeToString(max_grade)) );
|
2002-07-23 01:41:40 +00:00
|
|
|
break;
|
2002-06-24 22:04:31 +00:00
|
|
|
default:
|
2002-07-23 01:41:40 +00:00
|
|
|
ASSERT(0);
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-10-18 19:01:32 +00:00
|
|
|
switch( max_grade )
|
|
|
|
|
{
|
|
|
|
|
case GRADE_AA:
|
|
|
|
|
case GRADE_AAA:
|
2003-01-11 08:55:21 +00:00
|
|
|
case GRADE_AAAA:
|
2003-04-15 02:47:24 +00:00
|
|
|
this->PostScreenMessage( SM_PlayCheer, CHEER_DELAY_SECONDS );
|
2002-10-18 19:01:32 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2002-08-27 16:53:25 +00:00
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
SOUNDMAN->PlayMusic( THEME->GetPathToS("ScreenEvaluation music") );
|
2003-05-11 22:19:40 +00:00
|
|
|
m_fScreenCreateTime = RageTimer::GetTimeSinceStart();
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ScreenEvaluation::TweenOffScreen()
|
|
|
|
|
{
|
2003-03-24 21:37:13 +00:00
|
|
|
int p;
|
2002-06-24 22:04:31 +00:00
|
|
|
|
2003-03-28 05:47:42 +00:00
|
|
|
// large banner area
|
2003-04-15 02:47:24 +00:00
|
|
|
UtilOffCommand( m_LargeBanner, "ScreenEvaluation" );
|
|
|
|
|
UtilOffCommand( m_sprLargeBannerFrame, "ScreenEvaluation" );
|
|
|
|
|
UtilOffCommand( m_sprStage, "ScreenEvaluation" );
|
2003-03-24 21:37:13 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
2003-04-15 02:47:24 +00:00
|
|
|
if( !GAMESTATE->IsPlayerEnabled(p) )
|
|
|
|
|
continue;
|
|
|
|
|
UtilOffCommand( m_DifficultyIcon[p], "ScreenEvaluation" );
|
|
|
|
|
UtilOffCommand( m_textPlayerOptions[p], "ScreenEvaluation" );
|
2003-03-24 21:37:13 +00:00
|
|
|
}
|
2002-08-01 20:30:40 +00:00
|
|
|
|
2003-03-28 05:47:42 +00:00
|
|
|
// small banner area
|
|
|
|
|
for( unsigned i=0; i<MAX_SONGS_TO_SHOW; i++ )
|
|
|
|
|
{
|
2003-04-15 02:47:24 +00:00
|
|
|
UtilOffCommand( m_SmallBanner[i], "ScreenEvaluation" );
|
|
|
|
|
UtilOffCommand( m_sprSmallBannerFrame[i], "ScreenEvaluation" );
|
2003-03-28 05:47:42 +00:00
|
|
|
}
|
|
|
|
|
|
2003-03-24 21:37:13 +00:00
|
|
|
// grade area
|
2002-10-06 16:56:58 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
2002-06-24 22:04:31 +00:00
|
|
|
{
|
2003-04-15 02:47:24 +00:00
|
|
|
if( !GAMESTATE->IsPlayerEnabled(p) )
|
|
|
|
|
continue;
|
|
|
|
|
UtilOffCommand( m_sprGradeFrame[p], "ScreenEvaluation" );
|
|
|
|
|
UtilOffCommand( m_Grades[p], "ScreenEvaluation" );
|
2003-03-28 05:47:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// points area
|
|
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
2003-04-15 02:47:24 +00:00
|
|
|
if( !GAMESTATE->IsPlayerEnabled(p) )
|
|
|
|
|
continue;
|
|
|
|
|
UtilOffCommand( m_sprPercentFrame[p], "ScreenEvaluation" );
|
|
|
|
|
UtilOffCommand( m_textPercentWhole[p], "ScreenEvaluation" );
|
|
|
|
|
UtilOffCommand( m_textPercentRemainder[p], "ScreenEvaluation" );
|
|
|
|
|
UtilOffCommand( m_textDancePoints[p], "ScreenEvaluation" );
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
|
|
|
|
|
2003-03-24 21:37:13 +00:00
|
|
|
// bonus area
|
2002-08-22 09:31:32 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
2002-06-24 22:04:31 +00:00
|
|
|
{
|
2003-04-15 02:47:24 +00:00
|
|
|
if( !GAMESTATE->IsPlayerEnabled(p) )
|
|
|
|
|
continue;
|
|
|
|
|
UtilOffCommand( m_sprBonusFrame[p], "ScreenEvaluation" );
|
2003-03-24 21:37:13 +00:00
|
|
|
for( int r=0; r<NUM_RADAR_CATEGORIES; r++ ) // foreach line
|
2002-08-22 09:31:32 +00:00
|
|
|
{
|
2003-04-15 02:47:24 +00:00
|
|
|
UtilOffCommand( m_sprPossibleBar[p][r], "ScreenEvaluation" );
|
|
|
|
|
UtilOffCommand( m_sprActualBar[p][r], "ScreenEvaluation" );
|
2002-08-22 09:31:32 +00:00
|
|
|
}
|
2003-03-28 05:47:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// survived area
|
|
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
2003-04-15 02:47:24 +00:00
|
|
|
if( !GAMESTATE->IsPlayerEnabled(p) )
|
|
|
|
|
continue;
|
|
|
|
|
UtilOffCommand( m_sprSurvivedFrame[p], "ScreenEvaluation" );
|
|
|
|
|
UtilOffCommand( m_textSurvivedNumber[p], "ScreenEvaluation" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// win area
|
|
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
|
|
|
|
if( !GAMESTATE->IsPlayerEnabled(p) )
|
|
|
|
|
continue;
|
|
|
|
|
UtilOffCommand( m_sprWinFrame[p], "ScreenEvaluation" );
|
|
|
|
|
UtilOffCommand( m_sprWin[p], "ScreenEvaluation" );
|
2003-03-24 21:37:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// judgement area
|
|
|
|
|
int l;
|
|
|
|
|
for( l=0; l<NUM_JUDGE_LINES; l++ )
|
2003-04-15 02:47:24 +00:00
|
|
|
UtilOffCommand( m_sprJudgeLabels[l], "ScreenEvaluation" );
|
2002-07-28 20:28:37 +00:00
|
|
|
|
2003-03-24 21:37:13 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
2003-04-15 02:47:24 +00:00
|
|
|
{
|
|
|
|
|
if( !GAMESTATE->IsPlayerEnabled(p) )
|
|
|
|
|
continue;
|
2003-03-24 21:37:13 +00:00
|
|
|
for( l=0; l<NUM_JUDGE_LINES; l++ )
|
2003-04-15 02:47:24 +00:00
|
|
|
UtilOffCommand( m_textJudgeNumbers[l][p], "ScreenEvaluation" );
|
|
|
|
|
}
|
2002-09-15 23:41:26 +00:00
|
|
|
|
2003-03-24 21:37:13 +00:00
|
|
|
// score area
|
2003-04-15 02:47:24 +00:00
|
|
|
UtilOffCommand( m_sprScoreLabel, "ScreenEvaluation" );
|
2003-03-28 05:47:42 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
2003-04-15 02:47:24 +00:00
|
|
|
{
|
|
|
|
|
if( !GAMESTATE->IsPlayerEnabled(p) )
|
|
|
|
|
continue;
|
|
|
|
|
UtilOffCommand( m_textScore[p], "ScreenEvaluation" );
|
|
|
|
|
}
|
2003-03-28 05:47:42 +00:00
|
|
|
|
|
|
|
|
// time area
|
2003-04-15 02:47:24 +00:00
|
|
|
UtilOffCommand( m_sprTimeLabel, "ScreenEvaluation" );
|
2003-03-28 05:47:42 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
2003-04-15 02:47:24 +00:00
|
|
|
{
|
|
|
|
|
if( !GAMESTATE->IsPlayerEnabled(p) )
|
|
|
|
|
continue;
|
|
|
|
|
UtilOffCommand( m_textTime[p], "ScreenEvaluation" );
|
|
|
|
|
}
|
2003-03-28 05:47:42 +00:00
|
|
|
|
|
|
|
|
// extra area
|
2003-03-24 21:37:13 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
2003-04-15 02:47:24 +00:00
|
|
|
{
|
|
|
|
|
if( !GAMESTATE->IsPlayerEnabled(p) )
|
|
|
|
|
continue;
|
|
|
|
|
UtilOffCommand( m_sprNewRecord[p], "ScreenEvaluation" );
|
|
|
|
|
}
|
|
|
|
|
UtilOffCommand( m_sprTryExtraStage, "ScreenEvaluation" );
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenEvaluation::Update( float fDeltaTime )
|
|
|
|
|
{
|
|
|
|
|
Screen::Update( fDeltaTime );
|
2003-05-11 22:19:40 +00:00
|
|
|
|
2003-05-22 01:34:03 +00:00
|
|
|
/* for( int l=0; l<NUM_JUDGE_LINES; l++ )
|
2003-05-11 22:19:40 +00:00
|
|
|
{
|
2003-05-12 01:01:22 +00:00
|
|
|
if(!SHOW_JUDGMENT(l))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
if(m_TimeToPlayJudgeSound[l] == -1)
|
|
|
|
|
continue;
|
|
|
|
|
|
2003-05-12 01:02:11 +00:00
|
|
|
if(RageTimer::GetTimeSinceStart() < m_fScreenCreateTime + m_TimeToPlayJudgeSound[l])
|
|
|
|
|
continue;
|
|
|
|
|
|
2003-05-12 01:04:28 +00:00
|
|
|
if(SOUND_ON_FULL_ALPHA)
|
2003-05-11 22:19:40 +00:00
|
|
|
{
|
2003-05-12 01:04:28 +00:00
|
|
|
if( m_sprJudgeLabels[l].GetDiffuse().a != 1.0f &&
|
|
|
|
|
m_textJudgeNumbers[l][PLAYER_1].GetDiffuse().a != 1.0f &&
|
|
|
|
|
m_textJudgeNumbers[l][PLAYER_2].GetDiffuse().a != 1.0f )
|
|
|
|
|
continue;
|
2003-05-11 22:19:40 +00:00
|
|
|
}
|
2003-05-12 01:02:11 +00:00
|
|
|
|
2003-05-12 01:04:28 +00:00
|
|
|
m_soundJudgeSound[l].Play();
|
|
|
|
|
m_TimeToPlayJudgeSound[l] = -1;
|
2003-05-22 01:34:03 +00:00
|
|
|
}*/
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenEvaluation::DrawPrimitives()
|
|
|
|
|
{
|
|
|
|
|
m_Menu.DrawBottomLayer();
|
|
|
|
|
Screen::DrawPrimitives();
|
|
|
|
|
m_Menu.DrawTopLayer();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenEvaluation::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
|
|
|
|
|
{
|
2002-09-06 00:33:51 +00:00
|
|
|
// LOG->Trace( "ScreenEvaluation::Input()" );
|
2002-06-24 22:04:31 +00:00
|
|
|
|
2003-03-09 00:55:49 +00:00
|
|
|
if( m_Menu.IsTransitioning() )
|
2002-06-24 22:04:31 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
Screen::Input( DeviceI, type, GameI, MenuI, StyleI );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenEvaluation::HandleScreenMessage( const ScreenMessage SM )
|
|
|
|
|
{
|
|
|
|
|
switch( SM )
|
|
|
|
|
{
|
|
|
|
|
case SM_MenuTimer:
|
|
|
|
|
MenuStart( PLAYER_INVALID );
|
|
|
|
|
break;
|
2003-03-28 05:47:42 +00:00
|
|
|
case SM_GoToNextScreen:
|
|
|
|
|
SCREENMAN->SetNewScreen( NEXT_SCREEN );
|
2002-06-27 17:49:10 +00:00
|
|
|
break;
|
2002-08-01 05:11:11 +00:00
|
|
|
case SM_GoToSelectCourse:
|
2002-08-27 03:59:22 +00:00
|
|
|
SCREENMAN->SetNewScreen( "ScreenSelectCourse" );
|
2002-08-01 05:11:11 +00:00
|
|
|
break;
|
2003-03-28 05:47:42 +00:00
|
|
|
case SM_GoToEndScreen:
|
|
|
|
|
SCREENMAN->SetNewScreen( END_SCREEN );
|
2002-06-27 17:49:10 +00:00
|
|
|
break;
|
2003-03-24 21:59:50 +00:00
|
|
|
case SM_GoToEvaluationSummary:
|
|
|
|
|
SCREENMAN->SetNewScreen( "ScreenEvaluationSummary" );
|
2002-06-24 22:04:31 +00:00
|
|
|
break;
|
2002-10-18 19:01:32 +00:00
|
|
|
case SM_PlayCheer:
|
2003-01-02 08:13:34 +00:00
|
|
|
SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation cheer") );
|
2002-10-18 19:01:32 +00:00
|
|
|
break;
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-12-21 10:04:25 +00:00
|
|
|
void ScreenEvaluation::MenuLeft( PlayerNumber pn )
|
|
|
|
|
{
|
2003-01-24 02:43:07 +00:00
|
|
|
// What is the purpose of this? I keep my feet on the pads and
|
|
|
|
|
// was wondering why the grades weren't spinning. -Chris
|
2003-01-24 22:21:48 +00:00
|
|
|
// To be able to see the grade without having to wait for it to
|
|
|
|
|
// stop spinning. (I was hitting left repeatedly and wondering
|
|
|
|
|
// why it kept spinning ...)
|
2003-01-24 02:43:07 +00:00
|
|
|
//m_Grades[pn].SettleQuickly();
|
2002-12-21 10:04:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenEvaluation::MenuRight( PlayerNumber pn )
|
|
|
|
|
{
|
2003-01-24 02:43:07 +00:00
|
|
|
// What is the purpose of this? I keep my feet on the pads and
|
|
|
|
|
// was wondering why the grades weren't spinning. -Chris
|
|
|
|
|
//m_Grades[pn].SettleQuickly();
|
2002-12-21 10:04:25 +00:00
|
|
|
}
|
|
|
|
|
|
2002-09-04 03:49:08 +00:00
|
|
|
void ScreenEvaluation::MenuBack( PlayerNumber pn )
|
2002-06-24 22:04:31 +00:00
|
|
|
{
|
2002-09-04 03:49:08 +00:00
|
|
|
MenuStart( pn );
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
|
|
|
|
|
2002-09-04 03:49:08 +00:00
|
|
|
void ScreenEvaluation::MenuStart( PlayerNumber pn )
|
2002-06-24 22:04:31 +00:00
|
|
|
{
|
|
|
|
|
TweenOffScreen();
|
|
|
|
|
|
2003-03-25 22:23:58 +00:00
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
m_Grades[p].SettleImmediately();
|
|
|
|
|
|
|
|
|
|
|
2003-04-19 19:05:25 +00:00
|
|
|
if( PREFSMAN->m_bEventMode )
|
2002-06-29 11:59:09 +00:00
|
|
|
{
|
2003-05-05 04:13:39 +00:00
|
|
|
m_Menu.StartTransitioning( SM_GoToNextScreen );
|
2002-06-29 11:59:09 +00:00
|
|
|
}
|
2002-08-01 05:11:11 +00:00
|
|
|
else // not event mode
|
2002-06-27 17:49:10 +00:00
|
|
|
{
|
2003-03-24 21:37:13 +00:00
|
|
|
switch( m_Type )
|
2002-12-19 20:01:53 +00:00
|
|
|
{
|
2003-03-24 21:37:13 +00:00
|
|
|
case stage:
|
2003-02-11 02:44:26 +00:00
|
|
|
if( m_bTryExtraStage )
|
|
|
|
|
{
|
2003-03-28 05:47:42 +00:00
|
|
|
m_Menu.StartTransitioning( SM_GoToNextScreen );
|
2003-02-11 02:44:26 +00:00
|
|
|
}
|
|
|
|
|
else if( GAMESTATE->IsFinalStage() || GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() )
|
2003-01-27 06:49:02 +00:00
|
|
|
{
|
|
|
|
|
/* Tween the screen out, but leave the MenuElements where they are.
|
2003-02-11 02:44:26 +00:00
|
|
|
* Play the "swoosh" sound manually (would normally be played by the ME
|
|
|
|
|
* tween out). */
|
2003-01-27 06:49:02 +00:00
|
|
|
TweenOffScreen();
|
2003-03-24 21:59:50 +00:00
|
|
|
m_Menu.StartTransitioning( SM_GoToEvaluationSummary );
|
2003-01-27 06:49:02 +00:00
|
|
|
}
|
2003-02-10 05:30:12 +00:00
|
|
|
else
|
|
|
|
|
{
|
2003-03-28 05:47:42 +00:00
|
|
|
m_Menu.StartTransitioning( SM_GoToNextScreen );
|
2003-02-10 05:30:12 +00:00
|
|
|
}
|
2003-02-11 02:44:26 +00:00
|
|
|
break;
|
2003-03-24 21:37:13 +00:00
|
|
|
case summary:
|
2003-03-28 05:47:42 +00:00
|
|
|
m_Menu.StartTransitioning( SM_GoToEndScreen );
|
2003-02-11 02:44:26 +00:00
|
|
|
break;
|
2003-03-24 21:37:13 +00:00
|
|
|
case course:
|
2003-03-28 05:47:42 +00:00
|
|
|
m_Menu.StartTransitioning( SM_GoToEndScreen );
|
2003-02-11 02:44:26 +00:00
|
|
|
break;
|
|
|
|
|
}
|
2002-06-27 17:49:10 +00:00
|
|
|
}
|
|
|
|
|
|
2003-03-24 21:37:13 +00:00
|
|
|
switch( m_Type )
|
2003-02-03 05:53:59 +00:00
|
|
|
{
|
2003-03-24 21:37:13 +00:00
|
|
|
case stage:
|
2003-02-10 05:30:12 +00:00
|
|
|
// Increment the stage counter.
|
|
|
|
|
int iNumStagesOfLastSong;
|
|
|
|
|
iNumStagesOfLastSong = SongManager::GetNumStagesForSong( GAMESTATE->m_pCurSong );
|
|
|
|
|
GAMESTATE->m_iCurrentStageIndex += iNumStagesOfLastSong;
|
2003-02-03 05:53:59 +00:00
|
|
|
|
|
|
|
|
// add current stage stats to accumulated total only if this song was passed
|
|
|
|
|
{
|
|
|
|
|
bool bOnePassed = false;
|
|
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
2003-04-10 05:46:31 +00:00
|
|
|
if( GAMESTATE->IsHumanPlayer(p) )
|
2003-02-03 05:53:59 +00:00
|
|
|
bOnePassed |= !GAMESTATE->m_CurStageStats.bFailed[p];
|
|
|
|
|
|
|
|
|
|
if( bOnePassed )
|
|
|
|
|
GAMESTATE->m_vPassedStageStats.push_back( GAMESTATE->m_CurStageStats ); // Save this stage's stats
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
2002-06-24 22:04:31 +00:00
|
|
|
}
|
|
|
|
|
|