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