Added: TotalScore element on Evaluation Screen
Title, Artist and Current Character Icon's for the Stage Screen
This commit is contained in:
@@ -103,6 +103,32 @@ CString Character::GetSongSelectIconPath() const
|
||||
return as[0];
|
||||
}
|
||||
|
||||
CString Character::GetStageIconPath() const
|
||||
{
|
||||
CStringArray as;
|
||||
// first try and find an icon specific to the select music screen
|
||||
// so you can have different icons for music select / char select
|
||||
GetDirListing( m_sCharDir+"stageicon.png", as, false, true );
|
||||
GetDirListing( m_sCharDir+"stageicon.jpg", as, false, true );
|
||||
GetDirListing( m_sCharDir+"stageicon.gif", as, false, true );
|
||||
GetDirListing( m_sCharDir+"stageicon.bmp", as, false, true );
|
||||
|
||||
if( as.empty() )
|
||||
{
|
||||
// if that failed, try using the regular icon
|
||||
GetDirListing( m_sCharDir+"card.png", as, false, true );
|
||||
GetDirListing( m_sCharDir+"card.jpg", as, false, true );
|
||||
GetDirListing( m_sCharDir+"card.gif", as, false, true );
|
||||
GetDirListing( m_sCharDir+"card.bmp", as, false, true );
|
||||
if( as.empty() )
|
||||
return "";
|
||||
else
|
||||
return as[0];
|
||||
}
|
||||
else
|
||||
return as[0];
|
||||
}
|
||||
|
||||
CString Character::GetCardPath() const
|
||||
{
|
||||
CStringArray as;
|
||||
|
||||
@@ -30,6 +30,7 @@ public:
|
||||
CString GetWarmUpAnimationPath() const;
|
||||
CString GetDanceAnimationPath() const;
|
||||
CString GetSongSelectIconPath() const;
|
||||
CString GetStageIconPath() const;
|
||||
bool Has2DElems();
|
||||
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
|
||||
const int NUM_SCORE_DIGITS = 9;
|
||||
|
||||
|
||||
// metrics that are common to all ScreenEvaluation classes
|
||||
#define BANNER_WIDTH THEME->GetMetricF("ScreenEvaluation","BannerWidth")
|
||||
#define BANNER_HEIGHT THEME->GetMetricF("ScreenEvaluation","BannerHeight")
|
||||
@@ -63,6 +64,7 @@ const char* STATS_STRING[NUM_STATS_LINES] =
|
||||
#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_TOTAL_SCORE_AREA THEME->GetMetricB(m_sName,"ShowTotalScoreArea")
|
||||
#define SHOW_TIME_AREA THEME->GetMetricB(m_sName,"ShowTimeArea")
|
||||
#define SHOW_GRAPH_AREA THEME->GetMetricB(m_sName,"ShowGraphArea")
|
||||
#define SHOW_COMBO_AREA THEME->GetMetricB(m_sName,"ShowComboArea")
|
||||
@@ -257,8 +259,6 @@ ScreenEvaluation::ScreenEvaluation( CString sClassName ) : Screen(sClassName)
|
||||
m_SoundSequences.push_back(temp);
|
||||
}
|
||||
}
|
||||
m_timerSoundSequences.SetZero(); // zero the sound sequence timer
|
||||
m_timerSoundSequences.Touch(); // set the timer going :]
|
||||
m_bPassFailTriggered = false; // the sound hasn't been triggered yet
|
||||
if(m_bFailed && m_Type==stage)
|
||||
{
|
||||
@@ -650,6 +650,39 @@ ScreenEvaluation::ScreenEvaluation( CString sClassName ) : Screen(sClassName)
|
||||
}
|
||||
}
|
||||
|
||||
if( SHOW_TOTAL_SCORE_AREA )
|
||||
{
|
||||
m_sprTotalScoreLabel.Load( THEME->GetPathToG("ScreenEvaluation totalscore labels 1x2") );
|
||||
m_sprTotalScoreLabel.SetState( 0 );
|
||||
m_sprTotalScoreLabel.StopAnimating();
|
||||
m_sprTotalScoreLabel.SetName( "TotalScoreLabel" );
|
||||
UtilSetXYAndOnCommand( m_sprTotalScoreLabel, "ScreenEvaluation" );
|
||||
this->AddChild( &m_sprTotalScoreLabel );
|
||||
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( !GAMESTATE->IsPlayerEnabled( (PlayerNumber)p ) )
|
||||
continue; // skip
|
||||
|
||||
int iTotalScore=0;
|
||||
|
||||
int i=0;
|
||||
for(i=0; i<GAMESTATE->m_vPlayedStageStats.size();i++)
|
||||
iTotalScore += GAMESTATE->m_vPlayedStageStats[i].iScore[p];
|
||||
|
||||
iTotalScore += stageStats.iScore[p];
|
||||
|
||||
m_textTotalScore[p].LoadFromNumbers( THEME->GetPathToN("ScreenEvaluation totalscore") );
|
||||
m_textTotalScore[p].EnableShadow( false );
|
||||
m_textTotalScore[p].SetDiffuse( PlayerToColor(p) );
|
||||
m_textTotalScore[p].SetName( ssprintf("TotalScoreNumberP%d",p+1) );
|
||||
m_textTotalScore[p].SetText( ssprintf("%*.0i", NUM_SCORE_DIGITS+2, iTotalScore) );
|
||||
UtilSetXYAndOnCommand( m_textTotalScore[p], "ScreenEvaluation" );
|
||||
|
||||
this->AddChild( &m_textTotalScore[p] );
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// init time area
|
||||
//
|
||||
@@ -791,6 +824,8 @@ ScreenEvaluation::ScreenEvaluation( CString sClassName ) : Screen(sClassName)
|
||||
|
||||
|
||||
SOUND->PlayMusic( THEME->GetPathToS("ScreenEvaluation music") );
|
||||
m_timerSoundSequences.SetZero(); // zero the sound sequence timer
|
||||
m_timerSoundSequences.Touch(); // set the timer going :]
|
||||
m_fScreenCreateTime = RageTimer::GetTimeSinceStart();
|
||||
}
|
||||
|
||||
@@ -1075,6 +1110,18 @@ void ScreenEvaluation::TweenOffScreen()
|
||||
}
|
||||
}
|
||||
|
||||
// total score area
|
||||
if( SHOW_TOTAL_SCORE_AREA )
|
||||
{
|
||||
UtilOffCommand( m_sprTotalScoreLabel, "ScreenEvaluation" );
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( !GAMESTATE->IsPlayerEnabled(p) )
|
||||
continue;
|
||||
UtilOffCommand( m_textTotalScore[p], "ScreenEvaluation" );
|
||||
}
|
||||
}
|
||||
|
||||
// time area
|
||||
if( SHOW_TIME_AREA )
|
||||
{
|
||||
|
||||
@@ -120,6 +120,10 @@ protected:
|
||||
Sprite m_sprScoreLabel;
|
||||
BitmapText m_textScore[NUM_PLAYERS];
|
||||
|
||||
// total score area
|
||||
Sprite m_sprTotalScoreLabel;
|
||||
BitmapText m_textTotalScore[NUM_PLAYERS];
|
||||
|
||||
// time area
|
||||
Sprite m_sprTimeLabel;
|
||||
BitmapText m_textTime[NUM_PLAYERS];
|
||||
|
||||
@@ -296,6 +296,9 @@ ScreenSelectMusic::ScreenSelectMusic( CString sClassName ) : Screen( sClassName
|
||||
m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,0) ); // invisible
|
||||
//this->AddChild( &m_sprOptionsMessage ); // we have to draw this manually over the top of transitions
|
||||
|
||||
m_bgOverlay.SetName( "BGAOverlay");
|
||||
m_bgOverlay.LoadFromAniDir( THEME->GetPathToB("ScreenSelectMusic Overlay"));
|
||||
this->AddChild( &m_bgOverlay );
|
||||
|
||||
m_soundSelect.Load( THEME->GetPathToS("Common start") );
|
||||
m_soundChangeNotes.Load( THEME->GetPathToS("ScreenSelectMusic difficulty") );
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "HelpDisplay.h"
|
||||
#include "PaneDisplay.h"
|
||||
#include "Character.h"
|
||||
#include "BGAnimation.h"
|
||||
|
||||
class ScreenSelectMusic : public Screen
|
||||
{
|
||||
@@ -111,6 +112,8 @@ protected:
|
||||
float m_fSampleStartSeconds, m_fSampleLengthSeconds;
|
||||
bool m_bAllowOptionsMenu, m_bAllowOptionsMenuRepeat;
|
||||
|
||||
BGAnimation m_bgOverlay;
|
||||
|
||||
RageSound m_soundSelect;
|
||||
RageSound m_soundChangeNotes;
|
||||
RageSound m_soundOptionsChange;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "ActorUtil.h"
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
Class: ScreenStage
|
||||
@@ -23,7 +24,7 @@
|
||||
#include "RageSounds.h"
|
||||
#include "ThemeManager.h"
|
||||
#include "LightsManager.h"
|
||||
|
||||
#include "Song.h"
|
||||
|
||||
#define NEXT_SCREEN THEME->GetMetric ("ScreenStage","NextScreen")
|
||||
|
||||
@@ -63,6 +64,8 @@ ScreenStage::ScreenStage( CString sClassName ) : Screen( sClassName )
|
||||
m_Background.LoadFromAniDir( THEME->GetPathToB("ScreenStage "+GAMESTATE->GetStageText()) );
|
||||
this->AddChild( &m_Background );
|
||||
|
||||
m_Overlay.LoadFromAniDir( THEME->GetPathToB("ScreenStage Overlay"));
|
||||
|
||||
m_In.Load( THEME->GetPathToB("ScreenStage in") );
|
||||
m_In.StartTransitioning();
|
||||
this->AddChild( &m_In );
|
||||
@@ -72,7 +75,7 @@ ScreenStage::ScreenStage( CString sClassName ) : Screen( sClassName )
|
||||
|
||||
m_Back.Load( THEME->GetPathToB("Common back") );
|
||||
this->AddChild( &m_Back );
|
||||
|
||||
|
||||
/* Prep the new screen once the animation is complete. This way, we
|
||||
* start loading the gameplay screen as soon as possible. */
|
||||
this->PostScreenMessage( SM_PrepScreen, m_Background.GetLengthSeconds() );
|
||||
@@ -88,6 +91,45 @@ ScreenStage::ScreenStage( CString sClassName ) : Screen( sClassName )
|
||||
|
||||
this->PostScreenMessage( SM_BeginFadingOut, fStartFadingOutSeconds );
|
||||
|
||||
int p;
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
Character* pChar = GAMESTATE->m_pCurCharacters[p];
|
||||
m_sprCharacterIcon[p].SetName( ssprintf("CharacterIconP%d",p+1) );
|
||||
m_sprCharacterIcon[p].Load( pChar->GetStageIconPath() );
|
||||
SET_XY( m_sprCharacterIcon[p] );
|
||||
// this->AddChild( &m_sprCharacterIcon[p] );
|
||||
ON_COMMAND( m_sprCharacterIcon[p] );
|
||||
}
|
||||
|
||||
m_SongTitle.SetName( "SongTitle");
|
||||
m_Artist.SetName( "Artist" );
|
||||
m_SongTitle.LoadFromFont( THEME->GetPathToF("ScreenStage Title") );
|
||||
m_Artist.LoadFromFont( THEME->GetPathToF("ScreenStage Artist") );
|
||||
|
||||
if(GAMESTATE->m_pCurSong != NULL)
|
||||
{
|
||||
m_SongTitle.SetText( GAMESTATE->m_pCurSong->m_sMainTitle );
|
||||
m_Artist.SetText( GAMESTATE->m_pCurSong->m_sArtist );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_SongTitle.SetText( "" );
|
||||
m_Artist.SetText( "" );
|
||||
}
|
||||
|
||||
SET_XY( m_Artist );
|
||||
SET_XY( m_SongTitle );
|
||||
ON_COMMAND( m_Artist );
|
||||
ON_COMMAND( m_SongTitle );
|
||||
|
||||
if ( PREFSMAN->m_bShowBanners )
|
||||
if( GAMESTATE->m_pCurSong != NULL)
|
||||
if( GAMESTATE->m_pCurSong->HasBanner() )
|
||||
m_Banner.LoadFromSong( GAMESTATE->m_pCurSong );
|
||||
m_Banner.SetName("Banner");
|
||||
SET_XY( m_Banner );
|
||||
ON_COMMAND(m_Banner);
|
||||
|
||||
//g_StageType = (StageType)STAGE_TYPE;
|
||||
|
||||
@@ -567,11 +609,35 @@ ScreenStage::ScreenStage( CString sClassName ) : Screen( sClassName )
|
||||
void ScreenStage::Update( float fDeltaTime )
|
||||
{
|
||||
Screen::Update( fDeltaTime );
|
||||
int p;
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
m_sprCharacterIcon[p].Update(fDeltaTime);
|
||||
}
|
||||
m_Overlay.Update(fDeltaTime);
|
||||
if ( PREFSMAN->m_bShowBanners )
|
||||
if( GAMESTATE->m_pCurSong != NULL)
|
||||
if( GAMESTATE->m_pCurSong->HasBanner() )
|
||||
m_Banner.Update(fDeltaTime);
|
||||
m_SongTitle.Update(fDeltaTime);
|
||||
m_Artist.Update(fDeltaTime);
|
||||
}
|
||||
|
||||
void ScreenStage::DrawPrimitives()
|
||||
{
|
||||
Screen::DrawPrimitives();
|
||||
int p;
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
m_sprCharacterIcon[p].Draw();
|
||||
}
|
||||
m_Overlay.Draw();
|
||||
if ( PREFSMAN->m_bShowBanners )
|
||||
if( GAMESTATE->m_pCurSong != NULL)
|
||||
if( GAMESTATE->m_pCurSong->HasBanner() )
|
||||
m_Banner.Draw();
|
||||
m_SongTitle.Draw();
|
||||
m_Artist.Draw();
|
||||
}
|
||||
|
||||
void ScreenStage::HandleScreenMessage( const ScreenMessage SM )
|
||||
@@ -583,6 +649,14 @@ void ScreenStage::HandleScreenMessage( const ScreenMessage SM )
|
||||
break;
|
||||
case SM_BeginFadingOut:
|
||||
m_Out.StartTransitioning( SM_GoToNextScreen );
|
||||
int p;
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
OFF_COMMAND( m_sprCharacterIcon[p] );
|
||||
}
|
||||
OFF_COMMAND( m_SongTitle );
|
||||
OFF_COMMAND( m_Artist );
|
||||
OFF_COMMAND( m_Banner );
|
||||
break;
|
||||
//case SM_StartFadingOut:
|
||||
// m_Fade.CloseWipingRight( SM_GoToNextScreen );
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
|
||||
#include "Screen.h"
|
||||
#include "Transition.h"
|
||||
#include "Sprite.h"
|
||||
#include "Character.h"
|
||||
#include "BitmapText.h"
|
||||
#include "Banner.h"
|
||||
|
||||
class ScreenStage : public Screen
|
||||
{
|
||||
@@ -53,7 +57,13 @@ private:
|
||||
*/
|
||||
Transition m_In, m_Out, m_Back;
|
||||
BGAnimation m_Background;
|
||||
BGAnimation m_Overlay; // overlays all elements except bitmaptexts
|
||||
Banner m_Banner;
|
||||
BitmapText m_SongTitle;
|
||||
BitmapText m_Artist;
|
||||
|
||||
// elements that cannot be created with BGAnimation
|
||||
Sprite m_sprCharacterIcon[NUM_PLAYERS];
|
||||
protected:
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user