add DifficultyMeter to ScreenGameplay, ScreenEval

add PlayerName to ScreenEval
This commit is contained in:
Chris Danford
2004-05-31 06:04:30 +00:00
parent ce61094cad
commit 3a5a46ab9f
6 changed files with 65 additions and 27 deletions
+3 -3
View File
@@ -74,14 +74,14 @@ void DifficultyMeter::Load()
}
else
Feet = "0X";
m_textFeet.LoadFromTextureAndChars( THEME->GetPathToG( ssprintf("%s bar", m_sName.c_str())), Feet );
m_textFeet.LoadFromTextureAndChars( THEME->GetPathG(m_sName,"bar"), Feet );
SET_XY_AND_ON_COMMAND( &m_textFeet );
this->AddChild( &m_textFeet );
}
if( SHOW_DIFFICULTY )
{
m_Difficulty.Load( THEME->GetPathToG( ssprintf("%s difficulty", m_sName.c_str())) );
m_Difficulty.Load( THEME->GetPathG(m_sName,"difficulty") );
m_Difficulty->SetName( "Difficulty" );
SET_XY_AND_ON_COMMAND( m_Difficulty );
this->AddChild( m_Difficulty );
@@ -90,7 +90,7 @@ void DifficultyMeter::Load()
if( SHOW_METER )
{
m_textMeter.SetName( "Meter" );
m_textMeter.LoadFromFont( THEME->GetPathToN( ssprintf("%s meter", m_sName.c_str())) );
m_textMeter.LoadFromFont( THEME->GetPathN(m_sName,"meter") );
SET_XY_AND_ON_COMMAND( m_textMeter );
this->AddChild( &m_textMeter );
}
+1 -1
View File
@@ -732,7 +732,7 @@ int GameState::GetCourseSongIndex() const
CString GameState::GetPlayerDisplayName( PlayerNumber pn ) const
{
ASSERT( IsPlayerEnabled(pn) );
const CString defaultnames[NUM_PLAYERS] = { "PLAYER 1", "PLAYER 2" };
const CString defaultnames[NUM_PLAYERS] = { "Player 1", "Player 2" };
if( IsHumanPlayer(pn) )
{
if( !PROFILEMAN->GetPlayerName(pn).empty() )
+41 -14
View File
@@ -290,6 +290,19 @@ void ScreenEvaluation::Init()
//
m_soundStart.Load( THEME->GetPathToS("ScreenEvaluation start") );
//
// init player name area
//
FOREACH_EnabledPlayer( p )
{
m_textPlayerName[p].LoadFromFont( THEME->GetPathF(m_sName,"PlayerName") );
m_textPlayerName[p].SetName( ssprintf("PlayerNameP%d",p+1) );
m_textPlayerName[p].SetText( GAMESTATE->GetPlayerDisplayName(p) );
SET_XY_AND_ON_COMMAND( m_textPlayerName[p] );
this->AddChild( &m_textPlayerName[p] );
}
//
// init banner area
//
@@ -375,6 +388,23 @@ void ScreenEvaluation::Init()
SET_XY_AND_ON_COMMAND( m_DifficultyIcon[p] );
this->AddChild( &m_DifficultyIcon[p] );
m_DifficultyMeter[p].SetName( ssprintf("ScreenEvaluation DifficultyMeterP%d",p+1) );
m_DifficultyMeter[p].Load();
switch( m_Type )
{
case stage:
m_DifficultyMeter[p].SetFromSteps( GAMESTATE->m_pCurSteps[p] );
break;
case course:
m_DifficultyMeter[p].SetFromCourse( GAMESTATE->m_pCurCourse, p );
break;
default:
ASSERT(0);
}
m_DifficultyMeter[p].SetName( ssprintf("DifficultyMeterP%d",p+1) );
SET_XY_AND_ON_COMMAND( m_DifficultyMeter[p] );
this->AddChild( &m_DifficultyMeter[p] );
m_textPlayerOptions[p].LoadFromFont( THEME->GetPathToF("Common normal") );
CString sPO = GAMESTATE->m_PlayerOptions[p].GetThemedString();
sPO.Replace( ", ", PLAYER_OPTIONS_SEPARATOR );
@@ -1127,15 +1157,20 @@ void ScreenEvaluation::CommitScores(
void ScreenEvaluation::TweenOffScreen()
{
// player name area
FOREACH_EnabledPlayer( p )
{
OFF_COMMAND( m_textPlayerName[p] );
}
// large banner area
OFF_COMMAND( m_LargeBanner );
OFF_COMMAND( m_sprLargeBannerFrame );
OFF_COMMAND( m_sprStage );
FOREACH_PlayerNumber( p )
FOREACH_EnabledPlayer( p )
{
if( !GAMESTATE->IsPlayerEnabled(p) )
continue;
OFF_COMMAND( m_DifficultyIcon[p] );
OFF_COMMAND( m_DifficultyMeter[p] );
OFF_COMMAND( m_textPlayerOptions[p] );
OFF_COMMAND( m_sprDisqualified[p] );
}
@@ -1150,10 +1185,8 @@ void ScreenEvaluation::TweenOffScreen()
// grade area
if( SHOW_GRADE_AREA )
{
FOREACH_PlayerNumber( p )
FOREACH_EnabledPlayer( p )
{
if( !GAMESTATE->IsPlayerEnabled(p) )
continue;
OFF_COMMAND( m_sprGradeFrame[p] );
OFF_COMMAND( m_Grades[p] );
OFF_COMMAND( m_sprGrade[p] );
@@ -1162,11 +1195,8 @@ void ScreenEvaluation::TweenOffScreen()
if( SHOW_GRAPH_AREA )
{
FOREACH_PlayerNumber( p )
FOREACH_EnabledPlayer( p )
{
if( !GAMESTATE->IsPlayerEnabled(p) )
continue; // skip
OFF_COMMAND( m_sprGraphFrame[p] );
OFF_COMMAND( m_Graph[p] );
}
@@ -1174,11 +1204,8 @@ void ScreenEvaluation::TweenOffScreen()
if( SHOW_COMBO_AREA )
{
FOREACH_PlayerNumber( p )
FOREACH_EnabledPlayer( p )
{
if( !GAMESTATE->IsPlayerEnabled(p) )
continue; // skip
OFF_COMMAND( m_Combo[p] );
}
}
+5
View File
@@ -21,6 +21,7 @@
#include "ScoreDisplayNormal.h"
#include "Banner.h"
#include "DifficultyIcon.h"
#include "DifficultyMeter.h"
#include "PercentageDisplay.h"
#include "GraphDisplay.h"
#include "ComboGraph.h"
@@ -76,11 +77,15 @@ protected:
BGAnimation m_bgOverlay;
ConditionalBGA m_bgCondBga;
// player name area
BitmapText m_textPlayerName[NUM_PLAYERS];
// banner area
Banner m_LargeBanner;
AutoActor m_sprLargeBannerFrame;
AutoActor m_sprStage;
DifficultyIcon m_DifficultyIcon[NUM_PLAYERS];
DifficultyMeter m_DifficultyMeter[NUM_PLAYERS];
BitmapText m_textPlayerOptions[NUM_PLAYERS];
AutoActor m_sprDisqualified[NUM_PLAYERS];
Banner m_SmallBanner[MAX_SONGS_TO_SHOW];
+13 -9
View File
@@ -613,15 +613,16 @@ void ScreenGameplay::Init()
FOREACH_PlayerNumber(p)
FOREACH_EnabledPlayer(p)
{
if( !GAMESTATE->IsPlayerEnabled(p) )
continue;
m_DifficultyIcon[p].Load( THEME->GetPathToG(ssprintf("ScreenGameplay difficulty icons 2x%d",NUM_DIFFICULTIES)) );
/* Position it in LoadNextSong. */
this->AddChild( &m_DifficultyIcon[p] );
m_DifficultyMeter[p].SetName( ssprintf("ScreenGameplay DifficultyMeterP%d",p+1) );
m_DifficultyMeter[p].Load();
/* Position it in LoadNextSong. */
this->AddChild( &m_DifficultyMeter[p] );
}
@@ -912,7 +913,8 @@ void ScreenGameplay::LoadNextSong()
PREFSMAN->m_iProgressiveNonstopLifebar);
}
m_DifficultyIcon[p].SetFromSteps( PlayerNumber(p), GAMESTATE->m_pCurSteps[p] );
m_DifficultyIcon[p].SetFromSteps( p, GAMESTATE->m_pCurSteps[p] );
m_DifficultyMeter[p].SetFromSteps( GAMESTATE->m_pCurSteps[p] );
/* The actual note data for scoring is the base class of Player. This includes
* transforms, like Wide. Otherwise, the scoring will operate on the wrong data. */
@@ -964,11 +966,11 @@ void ScreenGameplay::LoadNextSong()
{
FOREACH_EnabledPlayer( p )
{
if( !GAMESTATE->IsPlayerEnabled(PlayerNumber(p)) )
continue;
m_DifficultyIcon[p].SetName( ssprintf("DifficultyP%d%s%s",p+1,bExtra?"Extra":"",bReverse[p]?"Reverse":"") );
SET_XY( m_DifficultyIcon[p] );
m_DifficultyMeter[p].SetName( ssprintf("DifficultyMeterP%d%s%s",p+1,bExtra?"Extra":"",bReverse[p]?"Reverse":"") );
SET_XY( m_DifficultyMeter[p] );
}
}
@@ -2317,6 +2319,7 @@ void ScreenGameplay::TweenOnScreen()
ON_COMMAND( m_textPlayerOptions[p] );
ON_COMMAND( m_ActiveAttackList[p] );
ON_COMMAND( m_DifficultyIcon[p] );
ON_COMMAND( m_DifficultyMeter[p] );
}
m_Overlay.PlayCommand("On");
}
@@ -2350,6 +2353,7 @@ void ScreenGameplay::TweenOffScreen()
OFF_COMMAND( m_textPlayerOptions[p] );
OFF_COMMAND( m_ActiveAttackList[p] );
OFF_COMMAND( m_DifficultyIcon[p] );
OFF_COMMAND( m_DifficultyMeter[p] );
}
m_Overlay.PlayCommand("Off");
+2
View File
@@ -23,6 +23,7 @@
#include "LifeMeter.h"
#include "ScoreDisplay.h"
#include "DifficultyIcon.h"
#include "DifficultyMeter.h"
#include "BPMDisplay.h"
class Inventory;
#include "BeginnerHelper.h"
@@ -165,6 +166,7 @@ protected:
Inventory* m_pInventory[NUM_PLAYERS];
DifficultyIcon m_DifficultyIcon[NUM_PLAYERS];
DifficultyMeter m_DifficultyMeter[NUM_PLAYERS];
Sprite m_sprOniGameOver[NUM_PLAYERS];
void ShowOniGameOver( PlayerNumber pn );