Moving more constants into theme metrics.

This commit is contained in:
Chris Danford
2002-08-27 16:53:25 +00:00
parent 142002091a
commit 941d9cb24d
33 changed files with 245 additions and 161 deletions
+35 -2
View File
@@ -38,6 +38,8 @@ NextScreen=ScreenCaution
NextScreen=ScreenSelectStyle NextScreen=ScreenSelectStyle
[ScreenEz2SelectPlayer] [ScreenEz2SelectPlayer]
HelpText=Press $ on the pad you wish to play on
TimerSeconds=40
NextScreen=ScreenSelectGroup NextScreen=ScreenSelectGroup
[ScreenSelectStyle] [ScreenSelectStyle]
@@ -55,7 +57,14 @@ HelpText=Use ! " to select, then press START
TimerSeconds=40 TimerSeconds=40
NextScreen=ScreenSelectDifficulty NextScreen=ScreenSelectDifficulty
[ScreenSelectStyle5th]
HelpText=Use ! " to select, then press START
TimerSeconds=40
NextScreen=ScreenSelectDifficulty
[ScreenEz2SelectStyle] [ScreenEz2SelectStyle]
HelpText=Press ! " to change, then press START
TimerSeconds=40
NextScreen=ScreenSelectGroup NextScreen=ScreenSelectGroup
[ScreenSelectDifficulty] [ScreenSelectDifficulty]
@@ -302,7 +311,7 @@ NewRecordP1X=150
NewRecordP2X=490 NewRecordP2X=490
NewRecordY=404 NewRecordY=404
TryExtraStageX=320 TryExtraStageX=320
TryExtraStageY=420 TryExtraStageY=424
HelpText=Press START to continue HelpText=Press START to continue
TimerSeconds=40 TimerSeconds=40
SpinGrades=1 SpinGrades=1
@@ -347,7 +356,31 @@ SectionColor7=0.8, 0.6, 0.0, 1
[LifeMeterBar] [LifeMeterBar]
MeterWidth=258 MeterWidth=258
MeterHeight=20 MeterHeight=20
DangerThreshold=0.4 DangerThreshold=0.2
[TransitionKeepAlive]
StopMusicOnNext=0
KeepAliveType=0 // 0 for MAX, 1 for 5th
[MenuElements]
TopEdgeX=320
TopEdgeY=24
BottomEdgeX=320
BottomEdgeY=462
HelpX=320
HelpY=452
StyleIconX=440
StyleIconY=28
TimerX=590
TimerY=24
[HoldJudgement] [HoldJudgement]
DisplayTime=0.6 DisplayTime=0.6
[ScreenOptions]
HelpText=# $ to change line ! " to select between options then press START
TimerSeconds=40
[ScreenMapInstruments]
HelpText=Use arrow keys to navigate, ENTER to assign, and SPACE to clear.
+7 -7
View File
@@ -220,7 +220,7 @@ void Background::LoadFromSong( Song* pSong )
case MODE_MOVIE_BG: case MODE_MOVIE_BG:
{ {
pTempBGA = new BackgroundAnimation; pTempBGA = new BackgroundAnimation;
pTempBGA->LoadFromMovie( pSong->GetMovieBackgroundPath(), false, true ); pTempBGA->LoadFromMovie( pSong->GetMovieBackgroundPath(), false, true, true, sSongBackgroundPath );
m_BackgroundAnimations.Add( pTempBGA ); m_BackgroundAnimations.Add( pTempBGA );
} }
break; break;
@@ -230,21 +230,19 @@ void Background::LoadFromSong( Song* pSong )
GetDirListing( VISUALIZATIONS_DIR + "*.avi", arrayPossibleMovies, false, true ); GetDirListing( VISUALIZATIONS_DIR + "*.avi", arrayPossibleMovies, false, true );
GetDirListing( VISUALIZATIONS_DIR + "*.mpg", arrayPossibleMovies, false, true ); GetDirListing( VISUALIZATIONS_DIR + "*.mpg", arrayPossibleMovies, false, true );
GetDirListing( VISUALIZATIONS_DIR + "*.mpeg", arrayPossibleMovies, false, true ); GetDirListing( VISUALIZATIONS_DIR + "*.mpeg", arrayPossibleMovies, false, true );
while( arrayPossibleMovies.GetSize() > 0 && m_BackgroundAnimations.GetSize() < 2 )
{
int index = rand() % arrayPossibleMovies.GetSize(); int index = rand() % arrayPossibleMovies.GetSize();
pTempBGA = new BackgroundAnimation; pTempBGA = new BackgroundAnimation;
pTempBGA->LoadFromVisualization( arrayPossibleMovies[index], sSongBackgroundPath ); pTempBGA->LoadFromVisualization( arrayPossibleMovies[index], sSongBackgroundPath );
m_BackgroundAnimations.Add( pTempBGA ); m_BackgroundAnimations.Add( pTempBGA );
arrayPossibleMovies.RemoveAt( index ); arrayPossibleMovies.RemoveAt( index );
} }
}
break; break;
case MODE_ANIMATIONS: case MODE_ANIMATIONS:
{ {
CStringArray arrayPossibleAnims; CStringArray arrayPossibleAnims;
GetDirListing( BG_ANIMS_DIR+"*.*", arrayPossibleAnims, true, true ); GetDirListing( BG_ANIMS_DIR+"*.*", arrayPossibleAnims, true, true );
while( arrayPossibleAnims.GetSize() > 0 && m_BackgroundAnimations.GetSize() < 5 ) for( int i=0; i<4 && arrayPossibleAnims.GetSize()>0; i++ )
{ {
int index = rand() % arrayPossibleAnims.GetSize(); int index = rand() % arrayPossibleAnims.GetSize();
pTempBGA = new BackgroundAnimation; pTempBGA = new BackgroundAnimation;
@@ -260,11 +258,11 @@ void Background::LoadFromSong( Song* pSong )
GetDirListing( RANDOMMOVIES_DIR + "*.avi", arrayPossibleMovies, false, true ); GetDirListing( RANDOMMOVIES_DIR + "*.avi", arrayPossibleMovies, false, true );
GetDirListing( RANDOMMOVIES_DIR + "*.mpg", arrayPossibleMovies, false, true ); GetDirListing( RANDOMMOVIES_DIR + "*.mpg", arrayPossibleMovies, false, true );
GetDirListing( RANDOMMOVIES_DIR + "*.mpeg", arrayPossibleMovies, false, true ); GetDirListing( RANDOMMOVIES_DIR + "*.mpeg", arrayPossibleMovies, false, true );
while( arrayPossibleMovies.GetSize() > 0 && m_BackgroundAnimations.GetSize() < 5 ) for( int i=0; i<4 && arrayPossibleMovies.GetSize()>0; i++ )
{ {
int index = rand() % arrayPossibleMovies.GetSize(); int index = rand() % arrayPossibleMovies.GetSize();
pTempBGA = new BackgroundAnimation; pTempBGA = new BackgroundAnimation;
pTempBGA->LoadFromMovie( arrayPossibleMovies[index], true, false, false, "" ); pTempBGA->LoadFromMovie( arrayPossibleMovies[index], true, false, i==0, sSongBackgroundPath );
m_BackgroundAnimations.Add( pTempBGA ); m_BackgroundAnimations.Add( pTempBGA );
arrayPossibleMovies.RemoveAt( index ); arrayPossibleMovies.RemoveAt( index );
} }
@@ -297,6 +295,8 @@ void Background::LoadFromSong( Song* pSong )
int index; int index;
if( m_BackgroundAnimations.GetSize()==1 ) if( m_BackgroundAnimations.GetSize()==1 )
index = 0; index = 0;
else if( f == fFirstBeat )
index = 1; // force the first random background to play first
else else
index = 1 + rand()%(m_BackgroundAnimations.GetSize()-1); index = 1 + rand()%(m_BackgroundAnimations.GetSize()-1);
m_aBGSegments.Add( BGSegment(f,index) ); m_aBGSegments.Add( BGSegment(f,index) );
+58 -51
View File
@@ -23,42 +23,37 @@
#include "GameState.h" #include "GameState.h"
const float HELP_X = CENTER_X; #define TOP_EDGE_X THEME->GetMetricF("MenuElements","TopEdgeX")
const float HELP_Y = SCREEN_BOTTOM-28; #define TOP_EDGE_Y THEME->GetMetricF("MenuElements","TopEdgeY")
#define BOTTOM_EDGE_X THEME->GetMetricF("MenuElements","BottomEdgeX")
const float STYLE_ICON_LOCAL_X = 130; #define BOTTOM_EDGE_Y THEME->GetMetricF("MenuElements","BottomEdgeY")
const float STYLE_ICON_LOCAL_Y = 6; #define STYLE_ICON_X THEME->GetMetricF("MenuElements","StyleIconX")
#define STYLE_ICON_Y THEME->GetMetricF("MenuElements","StyleIconY")
const float TIMER_LOCAL_X = 270; #define TIMER_X THEME->GetMetricF("MenuElements","TimerX")
const float TIMER_LOCAL_Y = 0; #define TIMER_Y THEME->GetMetricF("MenuElements","TimerY")
#define HELP_X THEME->GetMetricF("MenuElements","HelpX")
#define HELP_Y THEME->GetMetricF("MenuElements","HelpY")
MenuElements::MenuElements() MenuElements::MenuElements()
{ {
m_frameTopBar.AddSubActor( &m_sprTopEdge ); this->AddSubActor( &m_sprTopEdge );
m_frameTopBar.AddSubActor( &m_sprStyleIcon ); this->AddSubActor( &m_sprStyleIcon );
m_frameTopBar.AddSubActor( &m_MenuTimer ); this->AddSubActor( &m_MenuTimer );
this->AddSubActor( &m_sprBottomEdge );
m_frameBottomBar.AddSubActor( &m_sprBottomEdge );
this->AddSubActor( &m_sprBG ); this->AddSubActor( &m_sprBG );
this->AddSubActor( &m_frameTopBar );
this->AddSubActor( &m_frameBottomBar );
this->AddSubActor( &m_textHelp ); this->AddSubActor( &m_textHelp );
m_KeepAlive.SetZ( -2 );
m_KeepAlive.SetOpened(); m_KeepAlive.SetOpened();
this->AddSubActor( &m_KeepAlive ); this->AddSubActor( &m_KeepAlive );
m_Wipe.SetZ( -2 );
m_Wipe.SetOpened(); m_Wipe.SetOpened();
this->AddSubActor( &m_Wipe ); this->AddSubActor( &m_Wipe );
this->AddSubActor( &m_Invisible ); this->AddSubActor( &m_Invisible );
} }
void MenuElements::Load( CString sBackgroundPath, CString sTopEdgePath, CString sHelpText, bool bShowStyleIcon, bool bTimerEnabled, int iTimerSeconds ) void MenuElements::Load( CString sBackgroundPath, CString sTopEdgePath, CString sHelpText, bool bTimerEnabled, int iTimerSeconds )
{ {
LOG->Trace( "MenuElements::MenuElements()" ); LOG->Trace( "MenuElements::MenuElements()" );
@@ -67,22 +62,18 @@ void MenuElements::Load( CString sBackgroundPath, CString sTopEdgePath, CString
m_sprBG.StretchTo( CRect(0,0,SCREEN_WIDTH,SCREEN_HEIGHT) ); m_sprBG.StretchTo( CRect(0,0,SCREEN_WIDTH,SCREEN_HEIGHT) );
m_sprBG.TurnShadowOff(); m_sprBG.TurnShadowOff();
m_frameTopBar.SetZ( -1 );
m_sprTopEdge.Load( sTopEdgePath ); m_sprTopEdge.Load( sTopEdgePath );
m_sprTopEdge.TurnShadowOff(); m_sprTopEdge.SetXY( TOP_EDGE_X, TOP_EDGE_Y );
m_sprStyleIcon.Load( THEME->GetPathTo("Graphics","menu style icons") ); m_sprStyleIcon.Load( THEME->GetPathTo("Graphics",ssprintf("menu style icons game %d",GAMESTATE->m_CurGame)) );
m_sprStyleIcon.StopAnimating(); m_sprStyleIcon.StopAnimating();
m_sprStyleIcon.SetXY( STYLE_ICON_LOCAL_X, STYLE_ICON_LOCAL_Y ); m_sprStyleIcon.SetXY( STYLE_ICON_X, STYLE_ICON_Y );
m_sprStyleIcon.SetZ( -1 ); if( GAMESTATE->m_CurStyle == STYLE_NONE )
if( GAMESTATE->m_CurStyle == STYLE_NONE || !bShowStyleIcon )
m_sprStyleIcon.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); m_sprStyleIcon.SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
else else
m_sprStyleIcon.SetState( GAMESTATE->m_CurStyle ); m_sprStyleIcon.SetState( GAMESTATE->m_CurStyle*2+GAMESTATE->m_MasterPlayerNumber );
m_MenuTimer.SetXY( TIMER_LOCAL_X, TIMER_LOCAL_Y ); m_MenuTimer.SetXY( TIMER_X, TIMER_Y );
m_MenuTimer.SetZ( -1 );
if( !bTimerEnabled || !PREFSMAN->m_bMenuTimer ) if( !bTimerEnabled || !PREFSMAN->m_bMenuTimer )
{ {
m_MenuTimer.SetTimer( 99 ); m_MenuTimer.SetTimer( 99 );
@@ -92,10 +83,8 @@ void MenuElements::Load( CString sBackgroundPath, CString sTopEdgePath, CString
else else
m_MenuTimer.SetTimer( iTimerSeconds ); m_MenuTimer.SetTimer( iTimerSeconds );
m_frameBottomBar.SetZ( -1 );
m_sprBottomEdge.Load( THEME->GetPathTo("Graphics","menu bottom edge") ); m_sprBottomEdge.Load( THEME->GetPathTo("Graphics","menu bottom edge") );
m_sprBottomEdge.TurnShadowOff(); m_sprBottomEdge.SetXY( BOTTOM_EDGE_X, BOTTOM_EDGE_Y );
m_textHelp.SetXY( HELP_X, HELP_Y ); m_textHelp.SetXY( HELP_X, HELP_Y );
CStringArray asHelpTips; CStringArray asHelpTips;
@@ -106,18 +95,21 @@ void MenuElements::Load( CString sBackgroundPath, CString sTopEdgePath, CString
m_soundSwoosh.Load( THEME->GetPathTo("Sounds","menu swoosh") ); m_soundSwoosh.Load( THEME->GetPathTo("Sounds","menu swoosh") );
m_soundBack.Load( THEME->GetPathTo("Sounds","menu back") ); m_soundBack.Load( THEME->GetPathTo("Sounds","menu back") );
m_frameTopBar.SetXY( CENTER_X, m_sprTopEdge.GetZoomedHeight()/2 );
m_frameBottomBar.SetXY( CENTER_X, SCREEN_HEIGHT - m_sprBottomEdge.GetZoomedHeight()/2 );
} }
void MenuElements::TweenTopLayerOnScreen() void MenuElements::TweenTopLayerOnScreen()
{ {
m_frameTopBar.SetXY( CENTER_X+SCREEN_WIDTH, m_sprTopEdge.GetZoomedHeight()/2 ); CArray<Actor*,Actor*> apActorsInTopFrame;
m_frameTopBar.BeginTweening( MENU_ELEMENTS_TWEEN_TIME, TWEEN_SPRING ); apActorsInTopFrame.Add( &m_sprTopEdge );
m_frameTopBar.SetTweenX( CENTER_X ); apActorsInTopFrame.Add( &m_sprStyleIcon );
apActorsInTopFrame.Add( &m_MenuTimer );
for( int i=0; i<apActorsInTopFrame.GetSize(); i++ )
{
float fOriginalX = apActorsInTopFrame[i]->GetX();
apActorsInTopFrame[i]->SetX( fOriginalX+SCREEN_WIDTH );
apActorsInTopFrame[i]->BeginTweening( MENU_ELEMENTS_TWEEN_TIME, TWEEN_SPRING );
apActorsInTopFrame[i]->SetTweenX( fOriginalX );
}
float fOriginalZoom = m_textHelp.GetZoomY(); float fOriginalZoom = m_textHelp.GetZoomY();
m_textHelp.SetZoomY( 0 ); m_textHelp.SetZoomY( 0 );
@@ -134,8 +126,16 @@ void MenuElements::TweenOnScreenFromMenu( ScreenMessage smSendWhenDone )
void MenuElements::TweenTopLayerOffScreen() void MenuElements::TweenTopLayerOffScreen()
{ {
m_frameTopBar.BeginTweening( MENU_ELEMENTS_TWEEN_TIME, TWEEN_BIAS_END ); CArray<Actor*,Actor*> apActorsInTopFrame;
m_frameTopBar.SetTweenX( SCREEN_WIDTH*1.5f ); apActorsInTopFrame.Add( &m_sprTopEdge );
apActorsInTopFrame.Add( &m_sprStyleIcon );
apActorsInTopFrame.Add( &m_MenuTimer );
for( int i=0; i<apActorsInTopFrame.GetSize(); i++ )
{
float fOriginalX = apActorsInTopFrame[i]->GetX();
apActorsInTopFrame[i]->BeginTweening( MENU_ELEMENTS_TWEEN_TIME, TWEEN_BOUNCE_BEGIN );
apActorsInTopFrame[i]->SetTweenX( fOriginalX+SCREEN_WIDTH );
}
m_textHelp.BeginTweening( MENU_ELEMENTS_TWEEN_TIME/2 ); m_textHelp.BeginTweening( MENU_ELEMENTS_TWEEN_TIME/2 );
m_textHelp.SetTweenZoomY( 0 ); m_textHelp.SetTweenZoomY( 0 );
@@ -151,20 +151,21 @@ void MenuElements::TweenOffScreenToMenu( ScreenMessage smSendWhenDone )
void MenuElements::TweenBottomLayerOnScreen() void MenuElements::TweenBottomLayerOnScreen()
{ {
m_frameBottomBar.SetXY( CENTER_X, SCREEN_HEIGHT + m_sprBottomEdge.GetZoomedHeight()/2 ); float fOriginalY = m_sprBottomEdge.GetY();
m_frameBottomBar.BeginTweening( MENU_ELEMENTS_TWEEN_TIME/2 ); m_sprBottomEdge.SetY( fOriginalY + 100 );
m_frameBottomBar.SetTweenY( SCREEN_HEIGHT - m_sprBottomEdge.GetZoomedHeight()/2 ); m_sprBottomEdge.BeginTweening( MENU_ELEMENTS_TWEEN_TIME/2 );
m_sprBottomEdge.SetTweenY( fOriginalY );
m_sprBG.SetDiffuseColor( D3DXCOLOR(0,0,0,1) ); m_sprBG.SetDiffuseColor( D3DXCOLOR(0,0,0,1) );
m_sprBG.BeginTweening( MENU_ELEMENTS_TWEEN_TIME/2 ); m_sprBG.BeginTweening( MENU_ELEMENTS_TWEEN_TIME/2 );
m_sprBG.SetTweenDiffuseColor( D3DXCOLOR(1,1,1,1) ); m_sprBG.SetTweenDiffuseColor( D3DXCOLOR(1,1,1,1) );
} }
void MenuElements::TweenBottomLayerOffScreen() void MenuElements::TweenBottomLayerOffScreen()
{ {
m_frameBottomBar.BeginTweening( MENU_ELEMENTS_TWEEN_TIME/2 ); float fOriginalY = m_sprBottomEdge.GetY();
m_frameBottomBar.SetTweenY( SCREEN_HEIGHT + m_sprTopEdge.GetZoomedHeight() ); m_sprBottomEdge.BeginTweening( MENU_ELEMENTS_TWEEN_TIME/2 );
m_sprBottomEdge.SetTweenY( fOriginalY + 100 );
m_sprBG.SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); m_sprBG.SetDiffuseColor( D3DXCOLOR(1,1,1,1) );
m_sprBG.StopTweening(); m_sprBG.StopTweening();
@@ -205,18 +206,24 @@ void MenuElements::DrawPrimitives()
void MenuElements::DrawTopLayer() void MenuElements::DrawTopLayer()
{ {
BeginDraw(); BeginDraw();
m_frameTopBar.Draw();
m_frameBottomBar.Draw(); m_sprTopEdge.Draw();
m_sprStyleIcon.Draw();
m_MenuTimer.Draw();
m_sprBottomEdge.Draw();
m_textHelp.Draw(); m_textHelp.Draw();
m_KeepAlive.Draw(); m_KeepAlive.Draw();
m_Wipe.Draw(); m_Wipe.Draw();
EndDraw(); EndDraw();
} }
void MenuElements::DrawBottomLayer() void MenuElements::DrawBottomLayer()
{ {
BeginDraw(); BeginDraw();
m_sprBG.Draw(); m_sprBG.Draw();
EndDraw(); EndDraw();
} }
+4 -11
View File
@@ -34,7 +34,7 @@ public:
virtual void DrawPrimitives(); virtual void DrawPrimitives();
void Load( CString sBackgroundPath, CString sTopEdgePath, CString sHelpText, bool bShowStyleIcon, bool bTimerEnabled, int iTimerSeconds ); void Load( CString sBackgroundPath, CString sTopEdgePath, CString sHelpText, bool bTimerEnabled, int iTimerSeconds );
void StallTimer(); void StallTimer();
void SetTimer( int iTimerSeconds ); void SetTimer( int iTimerSeconds );
void StopTimer(); void StopTimer();
@@ -58,23 +58,16 @@ protected:
void TweenBottomLayerOffScreen(); void TweenBottomLayerOffScreen();
// stuff in the top bar
ActorFrame m_frameTopBar;
Sprite m_sprTopEdge; Sprite m_sprTopEdge;
Sprite m_sprStyleIcon; Sprite m_sprStyleIcon;
MenuTimer m_MenuTimer; MenuTimer m_MenuTimer;
// stuff in the bottom bar
ActorFrame m_frameBottomBar;
Sprite m_sprBottomEdge; Sprite m_sprBottomEdge;
// stuff in the main frame
Sprite m_sprBG; Sprite m_sprBG;
TipDisplay m_textHelp; TipDisplay m_textHelp;
TransitionFadeWipe m_Wipe; TransitionFadeWipe m_Wipe; // for going back
TransitionKeepAlive m_KeepAlive; TransitionKeepAlive m_KeepAlive; // going back and forward
TransitionInvisible m_Invisible; TransitionInvisible m_Invisible; // for going forward to Menu
RageSoundSample m_soundSwoosh; RageSoundSample m_soundSwoosh;
RageSoundSample m_soundBack; RageSoundSample m_soundBack;
+3
View File
@@ -349,6 +349,9 @@ void Player::Step( int col )
else if( fPercentFromPerfect < 0.75f ) score = TNS_GOOD; else if( fPercentFromPerfect < 0.75f ) score = TNS_GOOD;
else score = TNS_BOO; else score = TNS_BOO;
if( GAMESTATE->m_bDemonstration || PREFSMAN->m_bAutoPlay )
score = TNS_PERFECT;
bDestroyedNote = score >= TNS_GOOD; bDestroyedNote = score >= TNS_GOOD;
@@ -54,6 +54,8 @@ ScreenAppearanceOptions::ScreenAppearanceOptions() :
NUM_APPEARANCE_OPTIONS_LINES NUM_APPEARANCE_OPTIONS_LINES
); );
m_Menu.StopTimer(); m_Menu.StopTimer();
MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","appearance options music") );
} }
void ScreenAppearanceOptions::ImportOptions() void ScreenAppearanceOptions::ImportOptions()
+3 -1
View File
@@ -10,12 +10,12 @@
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
*/ */
#include "ScreenCaution.h" #include "ScreenCaution.h"
#include "GameConstantsAndTypes.h" #include "GameConstantsAndTypes.h"
#include "PrefsManager.h" #include "PrefsManager.h"
#include "AnnouncerManager.h" #include "AnnouncerManager.h"
#include "GameState.h" #include "GameState.h"
#include "RageMusic.h"
#define NEXT_SCREEN THEME->GetMetric("ScreenCaution","NextScreen") #define NEXT_SCREEN THEME->GetMetric("ScreenCaution","NextScreen")
@@ -42,6 +42,8 @@ ScreenCaution::ScreenCaution()
this->AddSubActor( &m_FadeWipe ); this->AddSubActor( &m_FadeWipe );
this->SendScreenMessage( SM_StartClosing, 3 ); this->SendScreenMessage( SM_StartClosing, 3 );
MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","caution music") );
} }
+21 -4
View File
@@ -43,6 +43,15 @@ ScreenEditMenu::ScreenEditMenu()
// Selector.AllowNewNotes(); // Selector.AllowNewNotes();
this->AddSubActor( &Selector ); this->AddSubActor( &Selector );
m_Menu.Load(
THEME->GetPathTo("Graphics","edit background"),
THEME->GetPathTo("Graphics","edit top edge"),
ssprintf("%c %c change line %c %c change value START to continue", char(3), char(4), char(1), char(2) ),
false, 99
);
this->AddSubActor( &m_Menu );
m_textExplanation.LoadFromFont( THEME->GetPathTo("Fonts","normal") ); m_textExplanation.LoadFromFont( THEME->GetPathTo("Fonts","normal") );
m_textExplanation.SetXY( EXPLANATION_X, EXPLANATION_Y ); m_textExplanation.SetXY( EXPLANATION_X, EXPLANATION_Y );
m_textExplanation.SetText( EXPLANATION_TEXT ); m_textExplanation.SetText( EXPLANATION_TEXT );
@@ -55,6 +64,8 @@ ScreenEditMenu::ScreenEditMenu()
MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","edit menu music") ); MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","edit menu music") );
m_soundSelect.Load( THEME->GetPathTo("Sounds","menu start") ); m_soundSelect.Load( THEME->GetPathTo("Sounds","menu start") );
m_Menu.TweenOnScreenFromBlack( SM_None );
} }
@@ -63,11 +74,17 @@ ScreenEditMenu::~ScreenEditMenu()
LOG->Trace( "ScreenEditMenu::~ScreenEditMenu()" ); LOG->Trace( "ScreenEditMenu::~ScreenEditMenu()" );
} }
void ScreenEditMenu::DrawPrimitives()
{
m_Menu.DrawBottomLayer();
Screen::DrawPrimitives();
m_Menu.DrawTopLayer();
}
void ScreenEditMenu::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ) void ScreenEditMenu::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{ {
LOG->Trace( "ScreenEditMenu::Input()" ); LOG->Trace( "ScreenEditMenu::Input()" );
Screen::Input( DeviceI, type, GameI, MenuI, StyleI ); Screen::Input( DeviceI, type, GameI, MenuI, StyleI );
} }
@@ -121,8 +138,6 @@ void ScreenEditMenu::MenuRight( const PlayerNumber p, const InputEventType type
void ScreenEditMenu::MenuStart( const PlayerNumber p ) void ScreenEditMenu::MenuStart( const PlayerNumber p )
{ {
Selector.TweenOffScreenToBlack( SM_None, false );
MUSIC->Stop(); MUSIC->Stop();
GAMESTATE->m_pCurSong = Selector.GetSelectedSong(); GAMESTATE->m_pCurSong = Selector.GetSelectedSong();
@@ -134,12 +149,14 @@ void ScreenEditMenu::MenuStart( const PlayerNumber p )
m_soundSelect.PlayRandom(); m_soundSelect.PlayRandom();
m_Menu.TweenOffScreenToBlack( SM_None, false );
m_Fade.CloseWipingRight( SM_GoToNextState ); m_Fade.CloseWipingRight( SM_GoToNextState );
} }
void ScreenEditMenu::MenuBack( const PlayerNumber p ) void ScreenEditMenu::MenuBack( const PlayerNumber p )
{ {
Selector.TweenOffScreenToBlack( SM_None, true ); m_Menu.TweenOffScreenToBlack( SM_None, true );
MUSIC->Stop(); MUSIC->Stop();
+3
View File
@@ -21,6 +21,7 @@ public:
ScreenEditMenu(); ScreenEditMenu();
virtual ~ScreenEditMenu(); virtual ~ScreenEditMenu();
virtual void DrawPrimitives();
virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ); virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI );
virtual void HandleScreenMessage( const ScreenMessage SM ); virtual void HandleScreenMessage( const ScreenMessage SM );
@@ -37,6 +38,8 @@ private:
BitmapText m_textExplanation; BitmapText m_textExplanation;
MenuElements m_Menu;
TransitionFade m_Fade; TransitionFade m_Fade;
RandomSample m_soundSelect; RandomSample m_soundSelect;
+6 -5
View File
@@ -303,8 +303,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
m_Menu.Load( m_Menu.Load(
THEME->GetPathTo("Graphics","evaluation background"), THEME->GetPathTo("Graphics","evaluation background"),
THEME->GetPathTo("Graphics",m_ResultMode==RM_ARCADE_SUMMARY?"evaluation summary top edge":"evaluation top edge"), THEME->GetPathTo("Graphics",m_ResultMode==RM_ARCADE_SUMMARY?"evaluation summary top edge":"evaluation top edge"),
HELP_TEXT, HELP_TEXT, true, TIMER_SECONDS
false, true, TIMER_SECONDS
); );
this->AddSubActor( &m_Menu ); this->AddSubActor( &m_Menu );
@@ -360,13 +359,13 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
max_grade = max( max_grade, grade[p] ); max_grade = max( max_grade, grade[p] );
////////////////////////
// update persistent statistics
////////////////////////
bool bNewRecord[NUM_PLAYERS]; bool bNewRecord[NUM_PLAYERS];
for( p=0; p<NUM_PLAYERS; p++ ) for( p=0; p<NUM_PLAYERS; p++ )
bNewRecord[p] = false; bNewRecord[p] = false;
////////////////////////
// update persistent statistics
////////////////////////
for( p=0; p<NUM_PLAYERS; p++ ) for( p=0; p<NUM_PLAYERS; p++ )
{ {
if( !GAMESTATE->IsPlayerEnabled(p) ) if( !GAMESTATE->IsPlayerEnabled(p) )
@@ -661,6 +660,8 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
} }
m_Menu.TweenOnScreenFromBlack( SM_None ); m_Menu.TweenOnScreenFromBlack( SM_None );
MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","evaluation music") );
} }
+3 -2
View File
@@ -28,6 +28,8 @@ const ScreenMessage SM_GoToNextState = ScreenMessage(SM_User + 2);
const ScreenMessage SM_PlayersChosen = ScreenMessage(SM_User + 3); const ScreenMessage SM_PlayersChosen = ScreenMessage(SM_User + 3);
#define HELP_TEXT THEME->GetMetric("ScreenEz2SelectPlayer","HelpText")
#define TIMER_SECONDS THEME->GetMetricI("ScreenEz2SelectPlayer","TimerSeconds")
#define NEXT_SCREEN THEME->GetMetric("ScreenEz2SelectPlayer","NextScreen") #define NEXT_SCREEN THEME->GetMetric("ScreenEz2SelectPlayer","NextScreen")
@@ -83,8 +85,7 @@ ScreenEz2SelectPlayer::ScreenEz2SelectPlayer()
m_Menu.Load( m_Menu.Load(
THEME->GetPathTo("Graphics","select style background"), THEME->GetPathTo("Graphics","select style background"),
THEME->GetPathTo("Graphics","select style top edge"), THEME->GetPathTo("Graphics","select style top edge"),
ssprintf("Press %c on the pad you wish to play on", char(4) ), HELP_TEXT, true, TIMER_SECONDS
false, true, 40
); );
this->AddSubActor( &m_Menu ); this->AddSubActor( &m_Menu );
+5 -2
View File
@@ -28,6 +28,8 @@ a polish :)
/* Constants */ /* Constants */
#define HELP_TEXT THEME->GetMetric("ScreenEz2SelectStyle","HelpText")
#define TIMER_SECONDS THEME->GetMetricI("ScreenEz2SelectStyle","TimerSeconds")
#define NEXT_SCREEN THEME->GetMetric("ScreenEz2SelectStyle","NextScreen") #define NEXT_SCREEN THEME->GetMetric("ScreenEz2SelectStyle","NextScreen")
@@ -90,8 +92,7 @@ ScreenEz2SelectStyle::ScreenEz2SelectStyle()
m_Menu.Load( m_Menu.Load(
THEME->GetPathTo("Graphics","select style background"), THEME->GetPathTo("Graphics","select style background"),
THEME->GetPathTo("Graphics","select style top edge"), THEME->GetPathTo("Graphics","select style top edge"),
ssprintf("Press %c on the pad you wish to play on", char(4) ), HELP_TEXT, true, TIMER_SECONDS
false, true, 40
); );
this->AddSubActor( &m_Menu ); this->AddSubActor( &m_Menu );
@@ -99,6 +100,8 @@ ScreenEz2SelectStyle::ScreenEz2SelectStyle()
GAMESTATE->m_bPlayersCanJoin = true; GAMESTATE->m_bPlayersCanJoin = true;
MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","select style music") );
m_Menu.TweenOnScreenFromBlack( SM_None ); m_Menu.TweenOnScreenFromBlack( SM_None );
} }
+2 -2
View File
@@ -19,6 +19,7 @@
#include "ScreenManager.h" #include "ScreenManager.h"
#include "AnnouncerManager.h" #include "AnnouncerManager.h"
#include "GameState.h" #include "GameState.h"
#include "RageMusic.h"
const ScreenMessage SM_StartFadingOut = ScreenMessage(SM_User + 1); const ScreenMessage SM_StartFadingOut = ScreenMessage(SM_User + 1);
@@ -47,8 +48,7 @@ ScreenGameOver::ScreenGameOver()
m_sprGameOver.BeginTweeningQueued( 0.5f ); // fade to color m_sprGameOver.BeginTweeningQueued( 0.5f ); // fade to color
m_sprGameOver.SetTweenAddColor( D3DXCOLOR(1,1,1,0) ); m_sprGameOver.SetTweenAddColor( D3DXCOLOR(1,1,1,0) );
// BUGFIX by ANDY: Stage will now reset back to 0 when game ends. MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","game over music") );
GAMESTATE->m_iCurrentStageIndex = 0;
this->SendScreenMessage( SM_PlayAnnouncer, 0.5 ); this->SendScreenMessage( SM_PlayAnnouncer, 0.5 );
this->SendScreenMessage( SM_StartFadingOut, 5 ); this->SendScreenMessage( SM_StartFadingOut, 5 );
+3 -2
View File
@@ -196,6 +196,7 @@ ScreenGameplay::ScreenGameplay()
{ {
LOG->Trace( "ScreenGameplay::ScreenGameplay()" ); LOG->Trace( "ScreenGameplay::ScreenGameplay()" );
MUSIC->Stop();
GAMESTATE->ResetStageStatistics(); // clear values GAMESTATE->ResetStageStatistics(); // clear values
@@ -881,7 +882,7 @@ void ScreenGameplay::Update( float fDeltaTime )
// fPositionSeconds ahead // fPositionSeconds ahead
if( GAMESTATE->m_SongOptions.m_AssistType == SongOptions::ASSIST_TICK ) if( GAMESTATE->m_SongOptions.m_AssistType == SongOptions::ASSIST_TICK )
{ {
fPositionSeconds += (SOUND->GetPlayLatency()+0.015f) * m_soundMusic.GetPlaybackRate(); // HACK: Add 0.015 seconds to account for the fact that the middle of the tick sounds occurs 0.015 seconds into playing. fPositionSeconds += (SOUND->GetPlayLatency()+0.018f) * m_soundMusic.GetPlaybackRate(); // HACK: Add 0.015 seconds to account for the fact that the middle of the tick sounds occurs 0.015 seconds into playing.
GAMESTATE->m_pCurSong->GetBeatAndBPSFromElapsedTime( fPositionSeconds, fSongBeat, fBPS, bFreeze ); GAMESTATE->m_pCurSong->GetBeatAndBPSFromElapsedTime( fPositionSeconds, fSongBeat, fBPS, bFreeze );
int iRowNow = BeatToNoteRowNotRounded( fSongBeat ); int iRowNow = BeatToNoteRowNotRounded( fSongBeat );
@@ -1353,7 +1354,7 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
SCREENMAN->SendMessageToTopScreen( SM_HideCleared, 2.5 ); SCREENMAN->SendMessageToTopScreen( SM_HideCleared, 2.5 );
break; break;
case SM_HideCleared: case SM_HideCleared:
m_sprCleared.BeginTweening(1.0f); m_sprCleared.BeginTweening(0.7f);
m_sprCleared.SetTweenDiffuseColor( D3DXCOLOR(1,1,1,0) ); m_sprCleared.SetTweenDiffuseColor( D3DXCOLOR(1,1,1,0) );
SCREENMAN->SendMessageToTopScreen( SM_GoToStateAfterCleared, 1 ); SCREENMAN->SendMessageToTopScreen( SM_GoToStateAfterCleared, 1 );
break; break;
+2
View File
@@ -70,6 +70,8 @@ ScreenGraphicOptions::ScreenGraphicOptions() :
); );
UpdateRefreshRates(); UpdateRefreshRates();
m_Menu.StopTimer(); m_Menu.StopTimer();
MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","graphic options music") );
} }
void ScreenGraphicOptions::UpdateRefreshRates() void ScreenGraphicOptions::UpdateRefreshRates()
+3 -1
View File
@@ -36,7 +36,7 @@ ScreenHowToPlay::ScreenHowToPlay()
m_Menu.Load( m_Menu.Load(
THEME->GetPathTo("Graphics","How To Play Background"), THEME->GetPathTo("Graphics","How To Play Background"),
THEME->GetPathTo("Graphics","How To Play Top Edge"), THEME->GetPathTo("Graphics","How To Play Top Edge"),
HELP_TEXT, false, true, TIMER_SECONDS HELP_TEXT, true, TIMER_SECONDS
); );
m_Menu.TweenOnScreenFromMenu( SM_None ); m_Menu.TweenOnScreenFromMenu( SM_None );
this->AddSubActor( &m_Menu ); this->AddSubActor( &m_Menu );
@@ -63,6 +63,8 @@ ScreenHowToPlay::ScreenHowToPlay()
m_sprHowToPlay.BeginTweeningQueued( 0.4f ); // sleep m_sprHowToPlay.BeginTweeningQueued( 0.4f ); // sleep
m_sprHowToPlay.BeginTweeningQueued( 0.6f, Actor::TWEEN_BIAS_BEGIN ); m_sprHowToPlay.BeginTweeningQueued( 0.6f, Actor::TWEEN_BIAS_BEGIN );
m_sprHowToPlay.SetTweenX( CENTER_X ); m_sprHowToPlay.SetTweenX( CENTER_X );
MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","how to play music") );
} }
ScreenHowToPlay::~ScreenHowToPlay() ScreenHowToPlay::~ScreenHowToPlay()
+3 -3
View File
@@ -59,6 +59,7 @@ const CString CREDIT_LINES[] =
"PROGRAMMING:", "PROGRAMMING:",
"Chris Danford", "Chris Danford",
"Lord Frieza (Andrew Livy)", "Lord Frieza (Andrew Livy)",
"Glenn Maynard",
"Bruno Figueiredo", "Bruno Figueiredo",
"Dro Kulix (Peter S. May)", "Dro Kulix (Peter S. May)",
"Mantis (Ben Nordstrom)", "Mantis (Ben Nordstrom)",
@@ -170,11 +171,10 @@ ScreenMusicScroll::ScreenMusicScroll()
this->AddSubActor( &m_Fade ); this->AddSubActor( &m_Fade );
m_soundMusic.Load( THEME->GetPathTo("Sounds","music scroll music") );
m_soundMusic.Play( true );
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_MUSIC_SCROLL) ); SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_MUSIC_SCROLL) );
MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","music scroll music") );
m_Fade.OpenWipingRight(); m_Fade.OpenWipingRight();
} }
+4 -2
View File
@@ -21,6 +21,8 @@
#include "GameState.h" #include "GameState.h"
#define HELP_TEXT THEME->GetMetric("ScreenOptions","HelpText")
#define TIMER_SECONDS THEME->GetMetricI("ScreenOptions","TimerSeconds")
const float HEADER_X = CENTER_X; const float HEADER_X = CENTER_X;
const float HEADER_Y = 50; const float HEADER_Y = 50;
@@ -48,8 +50,7 @@ ScreenOptions::ScreenOptions( CString sBackgroundPath, CString sPagePath, CStrin
m_Menu.Load( m_Menu.Load(
sBackgroundPath, sBackgroundPath,
sTopEdgePath, sTopEdgePath,
ssprintf("%s %s to change line %s %s to select between options then press START", CString(char(3)), CString(char(4)), CString(char(1)), CString(char(2)) ), HELP_TEXT, true, TIMER_SECONDS
false, true, 40
); );
this->AddSubActor( &m_Menu ); this->AddSubActor( &m_Menu );
@@ -167,6 +168,7 @@ void ScreenOptions::InitOptionsText()
title.SetXY( LABELS_X, fY ); title.SetXY( LABELS_X, fY );
title.SetZoom( 0.7f ); title.SetZoom( 0.7f );
title.SetVertAlign( Actor::align_middle ); title.SetVertAlign( Actor::align_middle );
title.TurnShadowOff();
m_framePage.AddSubActor( &title ); m_framePage.AddSubActor( &title );
// init all text in this line and count the width of the line // init all text in this line and count the width of the line
+5 -5
View File
@@ -58,17 +58,17 @@ ScreenPrompt::ScreenPrompt( ScreenMessage SM_SendWhenDone, CString sText, bool b
if( m_bYesNoPrompt ) if( m_bYesNoPrompt )
{
m_textAnswer[0].SetText( "OK" );
m_textAnswer[0].SetX( PROMPT_X );
}
else
{ {
m_textAnswer[0].SetText( "NO" ); m_textAnswer[0].SetText( "NO" );
m_textAnswer[1].SetText( "YES" ); m_textAnswer[1].SetText( "YES" );
m_textAnswer[0].SetX( PROMPT_X+50 ); m_textAnswer[0].SetX( PROMPT_X+50 );
m_textAnswer[1].SetX( PROMPT_X-50 ); m_textAnswer[1].SetX( PROMPT_X-50 );
} }
else
{
m_textAnswer[0].SetText( "OK" );
m_textAnswer[0].SetX( PROMPT_X );
}
m_rectAnswerBox.SetXY( m_textAnswer[m_bAnswer].GetX(), m_textAnswer[m_bAnswer].GetY() ); m_rectAnswerBox.SetXY( m_textAnswer[m_bAnswer].GetX(), m_textAnswer[m_bAnswer].GetY() );
m_rectAnswerBox.SetZoomX( m_textAnswer[m_bAnswer].GetWidestLineWidthInSourcePixels()+10.0f ); m_rectAnswerBox.SetZoomX( m_textAnswer[m_bAnswer].GetWidestLineWidthInSourcePixels()+10.0f );
+2 -1
View File
@@ -82,7 +82,7 @@ ScreenSelectCourse::ScreenSelectCourse()
m_Menu.Load( m_Menu.Load(
THEME->GetPathTo("Graphics","select course background"), THEME->GetPathTo("Graphics","select course background"),
THEME->GetPathTo("Graphics","select course top edge"), THEME->GetPathTo("Graphics","select course top edge"),
HELP_TEXT, false, true, TIMER_SECONDS HELP_TEXT, true, TIMER_SECONDS
); );
this->AddSubActor( &m_Menu ); this->AddSubActor( &m_Menu );
@@ -139,6 +139,7 @@ ScreenSelectCourse::ScreenSelectCourse()
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_SELECT_COURSE_INTRO) ); SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_SELECT_COURSE_INTRO) );
MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","select course music") );
AfterCourseChange(); AfterCourseChange();
TweenOnScreen(); TweenOnScreen();
+1 -1
View File
@@ -137,7 +137,7 @@ ScreenSelectDifficulty::ScreenSelectDifficulty()
m_Menu.Load( m_Menu.Load(
THEME->GetPathTo("Graphics","select difficulty background"), THEME->GetPathTo("Graphics","select difficulty background"),
THEME->GetPathTo("Graphics","select difficulty top edge"), THEME->GetPathTo("Graphics","select difficulty top edge"),
HELP_TEXT, false, true, TIMER_SECONDS HELP_TEXT, true, TIMER_SECONDS
); );
this->AddSubActor( &m_Menu ); this->AddSubActor( &m_Menu );
+2
View File
@@ -71,6 +71,8 @@ ScreenSelectGame::ScreenSelectGame() :
g_SelectGameLines, g_SelectGameLines,
NUM_SELECT_GAME_LINES NUM_SELECT_GAME_LINES
); );
MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","select game music") );
} }
void ScreenSelectGame::ImportOptions() void ScreenSelectGame::ImportOptions()
+1 -2
View File
@@ -122,8 +122,7 @@ ScreenSelectGroup::ScreenSelectGroup()
m_Menu.Load( m_Menu.Load(
THEME->GetPathTo("Graphics","select group background") , THEME->GetPathTo("Graphics","select group background") ,
THEME->GetPathTo("Graphics","select group top edge"), THEME->GetPathTo("Graphics","select group top edge"),
HELP_TEXT, HELP_TEXT, true, TIMER_SECONDS
false, true, TIMER_SECONDS
); );
this->AddSubActor( &m_Menu ); this->AddSubActor( &m_Menu );
+6 -2
View File
@@ -142,7 +142,7 @@ ScreenSelectMusic::ScreenSelectMusic()
m_Menu.Load( m_Menu.Load(
THEME->GetPathTo("Graphics","select music background"), THEME->GetPathTo("Graphics","select music background"),
THEME->GetPathTo("Graphics","select music top edge"), THEME->GetPathTo("Graphics","select music top edge"),
HELP_TEXT, false, true, TIMER_SECONDS HELP_TEXT, true, TIMER_SECONDS
); );
this->AddSubActor( &m_Menu ); this->AddSubActor( &m_Menu );
@@ -825,7 +825,11 @@ void ScreenSelectMusic::PlayMusicSample()
Song* pSong = m_MusicWheel.GetSelectedSong(); Song* pSong = m_MusicWheel.GetSelectedSong();
if( pSong ) if( pSong )
MUSIC->LoadAndPlayIfNotAlready( pSong->GetMusicPath() ); {
MUSIC->Stop();
MUSIC->Load( pSong->GetMusicPath() );
MUSIC->Play( true, pSong->m_fMusicSampleStartSeconds, pSong->m_fMusicSampleLengthSeconds );
}
else else
MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","select music music") ); MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","select music music") );
} }
+1 -1
View File
@@ -88,7 +88,7 @@ ScreenSelectStyle::ScreenSelectStyle()
m_Menu.Load( m_Menu.Load(
THEME->GetPathTo("Graphics","select style background"), THEME->GetPathTo("Graphics","select style background"),
THEME->GetPathTo("Graphics","select style top edge"), THEME->GetPathTo("Graphics","select style top edge"),
HELP_TEXT, false, true, TIMER_SECONDS HELP_TEXT, true, TIMER_SECONDS
); );
this->AddSubActor( &m_Menu ); this->AddSubActor( &m_Menu );
+4 -2
View File
@@ -22,6 +22,9 @@
#include "GameState.h" #include "GameState.h"
#include "PrefsManager.h" #include "PrefsManager.h"
#define HELP_TEXT THEME->GetMetric("ScreenSelectStyle5th","HelpText")
#define TIMER_SECONDS THEME->GetMetricI("ScreenSelectStyle5th","TimerSeconds")
#define NEXT_SCREEN THEME->GetMetric("ScreenSelectStyle5th","NextScreen")
const CString DANCE_STYLES[] = { const CString DANCE_STYLES[] = {
"single", "single",
@@ -165,8 +168,7 @@ ScreenSelectStyle5th::ScreenSelectStyle5th()
m_Menu.Load( m_Menu.Load(
THEME->GetPathTo("Graphics","select style background"), THEME->GetPathTo("Graphics","select style background"),
THEME->GetPathTo("Graphics","select style top edge"), THEME->GetPathTo("Graphics","select style top edge"),
ssprintf("Use %c %c to select, then press START", char(1), char(2)), HELP_TEXT, true, TIMER_SECONDS
false, true, 40
); );
this->AddSubActor( &m_Menu ); this->AddSubActor( &m_Menu );
+1 -1
View File
@@ -174,7 +174,7 @@ ScreenStage::ScreenStage()
for( i=0; i<iNumChars; i++ ) for( i=0; i<iNumChars; i++ )
{ {
float fOffsetX = SCALE(i, 0, iNumChars-1, -(iNumChars-1)/2.0f*fFrameWidth, (iNumChars-1)/2.0f*fFrameWidth); float fOffsetX = SCALE((float)i, 0, iNumChars-1, -(iNumChars-1)/2.0f*fFrameWidth, (iNumChars-1)/2.0f*fFrameWidth);
m_sprNumbers[i].SetX( fCharsCenterX + fOffsetX ); m_sprNumbers[i].SetX( fCharsCenterX + fOffsetX );
} }
m_sprStage.SetX( fStageCenterX ); m_sprStage.SetX( fStageCenterX );
+1 -3
View File
@@ -60,10 +60,8 @@ const ScreenMessage SM_GoToDemonstration = ScreenMessage(SM_User+14);
ScreenTitleMenu::ScreenTitleMenu() ScreenTitleMenu::ScreenTitleMenu()
{ {
MUSIC->Stop();
LOG->Trace( "ScreenTitleMenu::ScreenTitleMenu()" ); LOG->Trace( "ScreenTitleMenu::ScreenTitleMenu()" );
// //
// I think it's better to do all the initialization here rather than have it scattered // I think it's better to do all the initialization here rather than have it scattered
// about in all the global singleton classes // about in all the global singleton classes
@@ -164,7 +162,7 @@ ScreenTitleMenu::ScreenTitleMenu()
m_TitleMenuChoice = CHOICE_GAME_START; m_TitleMenuChoice = CHOICE_GAME_START;
GainFocus( m_TitleMenuChoice ); GainFocus( m_TitleMenuChoice );
MUSIC->Stop(); MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","title menu music") );
this->SendScreenMessage( SM_PlayAttract, SECONDS_BETWEEN_ATTRACT ); this->SendScreenMessage( SM_PlayAttract, SECONDS_BETWEEN_ATTRACT );
this->SendScreenMessage( SM_FadeToDemonstration, SECONDS_BEFORE_DEMONSTRATION ); this->SendScreenMessage( SM_FadeToDemonstration, SECONDS_BEFORE_DEMONSTRATION );
-18
View File
@@ -114,17 +114,8 @@ SongSelector::SongSelector()
else else
OnGroupChange(); OnGroupChange();
m_Menu.Load(
THEME->GetPathTo("Graphics","edit background"),
THEME->GetPathTo("Graphics","edit top edge"),
ssprintf("%c %c change line %c %c change value START to continue", char(3), char(4), char(1), char(2) ),
false, false, 40
);
this->AddSubActor( &m_Menu );
m_soundChangeMusic.Load( THEME->GetPathTo("Sounds","select music change music") ); m_soundChangeMusic.Load( THEME->GetPathTo("Sounds","select music change music") );
m_Menu.TweenOnScreenFromBlack( SM_None );
} }
SongSelector::~SongSelector() SongSelector::~SongSelector()
@@ -134,9 +125,7 @@ SongSelector::~SongSelector()
void SongSelector::DrawPrimitives() void SongSelector::DrawPrimitives()
{ {
m_Menu.DrawBottomLayer();
ActorFrame::DrawPrimitives(); ActorFrame::DrawPrimitives();
m_Menu.DrawTopLayer();
} }
void SongSelector::Up() void SongSelector::Up()
@@ -288,15 +277,8 @@ void SongSelector::OnNotesChange()
m_iSelectedNotes = clamp( m_iSelectedNotes, 0, m_pNotess.GetSize()-1 ); m_iSelectedNotes = clamp( m_iSelectedNotes, 0, m_pNotess.GetSize()-1 );
if( GetSelectedNotes() == NULL ) if( GetSelectedNotes() == NULL )
{
m_textNotes.SetText( "(NEW)" ); m_textNotes.SetText( "(NEW)" );
}
else else
m_textNotes.SetText( GetSelectedNotes()->m_sDescription!="" ? GetSelectedNotes()->m_sDescription : "[no name]" ); m_textNotes.SetText( GetSelectedNotes()->m_sDescription!="" ? GetSelectedNotes()->m_sDescription : "[no name]" );
} }
void SongSelector::TweenOffScreenToBlack( ScreenMessage smSendWhenDone, bool bPlayBackSound )
{
m_Menu.TweenOffScreenToBlack( smSendWhenDone, bPlayBackSound );
}
-4
View File
@@ -35,8 +35,6 @@ public:
NotesType GetSelectedNotesType() { return m_NotesTypes[m_iSelectedNotesType]; }; NotesType GetSelectedNotesType() { return m_NotesTypes[m_iSelectedNotesType]; };
Notes* GetSelectedNotes() { return m_pNotess[m_iSelectedNotes]; }; Notes* GetSelectedNotes() { return m_pNotess[m_iSelectedNotes]; };
void TweenOffScreenToBlack( ScreenMessage smSendWhenDone, bool bPlayBackSound );
/* not used yet */ /* not used yet */
bool NewNotes; bool NewNotes;
void AllowNewNotes(bool NewNotes_=true) { NewNotes = NewNotes; } void AllowNewNotes(bool NewNotes_=true) { NewNotes = NewNotes; }
@@ -45,8 +43,6 @@ private:
enum SelectedRow { ROW_GROUP, ROW_SONG, ROW_NOTES_TYPE, ROW_STEPS, NUM_ROWS }; enum SelectedRow { ROW_GROUP, ROW_SONG, ROW_NOTES_TYPE, ROW_STEPS, NUM_ROWS };
SelectedRow m_SelectedRow; SelectedRow m_SelectedRow;
MenuElements m_Menu;
CStringArray m_sGroups; CStringArray m_sGroups;
int m_iSelectedGroup; // index into m_sGroups int m_iSelectedGroup; // index into m_sGroups
BitmapText m_textGroup; BitmapText m_textGroup;
-9
View File
@@ -1,27 +1,18 @@
Microsoft Visual Studio Solution File, Format Version 7.00 Microsoft Visual Studio Solution File, Format Version 7.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StepMania", "StepMania.vcproj", "{670745A6-106B-420D-A2A9-D4F89A23986E}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StepMania", "StepMania.vcproj", "{670745A6-106B-420D-A2A9-D4F89A23986E}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZipArchive", "smpackage\ZipArchive\ZipArchive.vcproj", "{2AF0D4D5-0984-4AD4-A2BD-402D4BE285CE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smpackage", "smpackage\smpackage.vcproj", "{775C9F19-F852-43AC-8563-D869C027722D}"
EndProject
Global Global
GlobalSection(SolutionConfiguration) = preSolution GlobalSection(SolutionConfiguration) = preSolution
ConfigName.0 = Debug ConfigName.0 = Debug
ConfigName.1 = Release ConfigName.1 = Release
EndGlobalSection EndGlobalSection
GlobalSection(ProjectDependencies) = postSolution GlobalSection(ProjectDependencies) = postSolution
{775C9F19-F852-43AC-8563-D869C027722D}.0 = {2AF0D4D5-0984-4AD4-A2BD-402D4BE285CE}
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution GlobalSection(ProjectConfiguration) = postSolution
{670745A6-106B-420D-A2A9-D4F89A23986E}.Debug.ActiveCfg = Debug|Win32 {670745A6-106B-420D-A2A9-D4F89A23986E}.Debug.ActiveCfg = Debug|Win32
{670745A6-106B-420D-A2A9-D4F89A23986E}.Debug.Build.0 = Debug|Win32 {670745A6-106B-420D-A2A9-D4F89A23986E}.Debug.Build.0 = Debug|Win32
{670745A6-106B-420D-A2A9-D4F89A23986E}.Release.ActiveCfg = Release|Win32 {670745A6-106B-420D-A2A9-D4F89A23986E}.Release.ActiveCfg = Release|Win32
{670745A6-106B-420D-A2A9-D4F89A23986E}.Release.Build.0 = Release|Win32 {670745A6-106B-420D-A2A9-D4F89A23986E}.Release.Build.0 = Release|Win32
{2AF0D4D5-0984-4AD4-A2BD-402D4BE285CE}.Debug.ActiveCfg = Debug|Win32
{2AF0D4D5-0984-4AD4-A2BD-402D4BE285CE}.Release.ActiveCfg = Release|Win32
{775C9F19-F852-43AC-8563-D869C027722D}.Debug.ActiveCfg = Debug|Win32
{775C9F19-F852-43AC-8563-D869C027722D}.Release.ActiveCfg = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection EndGlobalSection
+3 -1
View File
@@ -53,7 +53,7 @@ void ThemeManager::GetAllThemeNames( CStringArray& AddTo )
// strip out the folder called "CVS" // strip out the folder called "CVS"
for( int i=AddTo.GetSize()-1; i>=0; i-- ) for( int i=AddTo.GetSize()-1; i>=0; i-- )
if( 0 == stricmp( AddTo[i], "cvs" ) ) if( 0 == stricmp(AddTo[i],"cvs") )
AddTo.RemoveAt(i); AddTo.RemoveAt(i);
} }
@@ -61,6 +61,7 @@ void ThemeManager::GetThemeNamesForCurGame( CStringArray& AddTo )
{ {
GetAllThemeNames( AddTo ); GetAllThemeNames( AddTo );
/*
// strip out announcers that don't have the current game name in them // strip out announcers that don't have the current game name in them
CString sGameName = GAMESTATE->GetCurrentGameDef()->m_szName; CString sGameName = GAMESTATE->GetCurrentGameDef()->m_szName;
sGameName.MakeLower(); sGameName.MakeLower();
@@ -71,6 +72,7 @@ void ThemeManager::GetThemeNamesForCurGame( CStringArray& AddTo )
if( sLowercaseVer.Find(sGameName)==-1 ) if( sLowercaseVer.Find(sGameName)==-1 )
AddTo.RemoveAt(i); AddTo.RemoveAt(i);
} }
*/
} }
bool ThemeManager::DoesThemeExist( CString sThemeName ) bool ThemeManager::DoesThemeExist( CString sThemeName )
+39 -4
View File
@@ -6,25 +6,40 @@
Desc: See header. Desc: See header.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
*/ */
#include "RageUtil.h"
#include "TransitionKeepAlive.h" #include "TransitionKeepAlive.h"
#include "RageUtil.h"
#include "GameConstantsAndTypes.h" #include "GameConstantsAndTypes.h"
#include "PrefsManager.h" #include "PrefsManager.h"
#include "RageMusic.h"
#define STOP_MUSIC_ON_NEXT THEME->GetMetricB("TransitionKeepAlive","StopMusicOnNext")
#define KEEP_ALIVE_TYPE THEME->GetMetricI("TransitionKeepAlive","KeepAliveType")
enum KeepAliveType // for use with the metric above
{
KEEP_ALIVE_TYPE_MAX = 0,
KEEP_ALIVE_TYPE_5TH,
};
KeepAliveType g_KeepAliveType; // hack: This is just a cache so we don't have to read the ThemeMetric on every update
const float KEEP_ALIVE_FORWARD_TRANSITION_TIME = 0.8f; const float KEEP_ALIVE_FORWARD_TRANSITION_TIME = 0.8f;
const float KEEP_ALIVE_BACKWARD_TRANSITION_TIME = 0.4f; const float KEEP_ALIVE_BACKWARD_TRANSITION_TIME = 0.4f;
TransitionKeepAlive::TransitionKeepAlive() TransitionKeepAlive::TransitionKeepAlive()
{ {
g_KeepAliveType = (KeepAliveType)KEEP_ALIVE_TYPE;
m_sprLogo.Load( THEME->GetPathTo("Graphics","keep alive") ); m_sprLogo.Load( THEME->GetPathTo("Graphics","keep alive") );
m_sprLogo.SetXY( CENTER_X, CENTER_Y ); m_sprLogo.SetXY( CENTER_X, CENTER_Y );
m_rect.StretchTo( CRect(0,0,SCREEN_WIDTH,SCREEN_HEIGHT) );
} }
void TransitionKeepAlive::Update( float fDeltaTime ) void TransitionKeepAlive::Update( float fDeltaTime )
@@ -39,7 +54,10 @@ void TransitionKeepAlive::Update( float fDeltaTime )
void TransitionKeepAlive::DrawPrimitives() void TransitionKeepAlive::DrawPrimitives()
{ {
// draw keep alive graphic // draw keep alive graphic
switch( g_KeepAliveType )
{
case KEEP_ALIVE_TYPE_MAX:
{
float fPercentClosed = 1 - this->GetPercentageOpen(); float fPercentClosed = 1 - this->GetPercentageOpen();
fPercentClosed = min( 1, fPercentClosed*2 ); fPercentClosed = min( 1, fPercentClosed*2 );
const float fPercentColor = fPercentClosed; const float fPercentColor = fPercentClosed;
@@ -49,6 +67,20 @@ void TransitionKeepAlive::DrawPrimitives()
m_sprLogo.SetZoomY( fPercentClosed ); m_sprLogo.SetZoomY( fPercentClosed );
if( fPercentClosed > 0 ) if( fPercentClosed > 0 )
m_sprLogo.Draw(); m_sprLogo.Draw();
}
break;
case KEEP_ALIVE_TYPE_5TH:
{
float fPercentClosed = 1 - this->GetPercentageOpen();
m_sprLogo.SetDiffuseColor( D3DXCOLOR(1,1,1,fPercentClosed) );
m_sprLogo.Draw();
}
break;
default:
ASSERT(0);
break;
}
} }
@@ -61,6 +93,9 @@ void TransitionKeepAlive::OpenWipingRight( ScreenMessage send_when_done )
void TransitionKeepAlive::OpenWipingLeft( ScreenMessage send_when_done ) void TransitionKeepAlive::OpenWipingLeft( ScreenMessage send_when_done )
{ {
if( STOP_MUSIC_ON_NEXT )
MUSIC->Stop();
this->SetTransitionTime( KEEP_ALIVE_BACKWARD_TRANSITION_TIME ); this->SetTransitionTime( KEEP_ALIVE_BACKWARD_TRANSITION_TIME );
Transition::OpenWipingLeft( send_when_done ); Transition::OpenWipingLeft( send_when_done );