Readd optional song menu.

Three options:
  yes, to go directly to it without asking.  This is faster for people who use
the song options menu frequently
  no, to skip it completely; probably useful for coin mode where the song
opts menu may be inappropriate
  ask, to ask, for people (like me) who use that menu very infrequently
but still want it available
This commit is contained in:
Glenn Maynard
2003-04-21 22:36:45 +00:00
parent 0a4afe592b
commit 5ad3b0b786
7 changed files with 98 additions and 11 deletions
+3 -3
View File
@@ -83,7 +83,7 @@ PrefsManager::PrefsManager()
m_bJointPremium = false; m_bJointPremium = false;
m_iBoostAppPriority = -1; m_iBoostAppPriority = -1;
m_iPolygonRadar = -1; m_iPolygonRadar = -1;
m_bShowSongOptions = true; m_ShowSongOptions = YES;
m_bDancePointsForOni = false; m_bDancePointsForOni = false;
m_bTimestamping = false; m_bTimestamping = false;
m_bShowLyrics = true; m_bShowLyrics = true;
@@ -181,7 +181,7 @@ void PrefsManager::ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame )
ini.GetValueB( "Options", "PickExtraStage", m_bPickExtraStage ); ini.GetValueB( "Options", "PickExtraStage", m_bPickExtraStage );
ini.GetValueF( "Options", "LongVerSeconds", m_fLongVerSongSeconds ); ini.GetValueF( "Options", "LongVerSeconds", m_fLongVerSongSeconds );
ini.GetValueF( "Options", "MarathonVerSeconds", m_fMarathonVerSongSeconds ); ini.GetValueF( "Options", "MarathonVerSeconds", m_fMarathonVerSongSeconds );
ini.GetValueB( "Options", "ShowSongOptions", m_bShowSongOptions ); ini.GetValueI( "Options", "ShowSongOptions", (int&)m_ShowSongOptions );
ini.GetValueB( "Options", "AllowSoftwareRenderer", m_bAllowSoftwareRenderer ); ini.GetValueB( "Options", "AllowSoftwareRenderer", m_bAllowSoftwareRenderer );
ini.GetValueB( "Options", "SoloSingle", m_bSoloSingle ); ini.GetValueB( "Options", "SoloSingle", m_bSoloSingle );
ini.GetValueB( "Options", "DancePointsForOni", m_bDancePointsForOni ); ini.GetValueB( "Options", "DancePointsForOni", m_bDancePointsForOni );
@@ -262,7 +262,7 @@ void PrefsManager::SaveGlobalPrefsToDisk()
ini.SetValueB( "Options", "PickExtraStage", m_bPickExtraStage ); ini.SetValueB( "Options", "PickExtraStage", m_bPickExtraStage );
ini.SetValueF( "Options", "LongVerSeconds", m_fLongVerSongSeconds ); ini.SetValueF( "Options", "LongVerSeconds", m_fLongVerSongSeconds );
ini.SetValueF( "Options", "MarathonVerSeconds", m_fMarathonVerSongSeconds ); ini.SetValueF( "Options", "MarathonVerSeconds", m_fMarathonVerSongSeconds );
ini.SetValueB( "Options", "ShowSongOptions", m_bShowSongOptions ); ini.SetValueI( "Options", "ShowSongOptions", m_ShowSongOptions );
ini.SetValueB( "Options", "AllowSoftwareRenderer", m_bAllowSoftwareRenderer ); ini.SetValueB( "Options", "AllowSoftwareRenderer", m_bAllowSoftwareRenderer );
ini.SetValueB( "Options", "SoloSingle", m_bSoloSingle ); ini.SetValueB( "Options", "SoloSingle", m_bSoloSingle );
ini.SetValueB( "Options", "DancePointsForOni", m_bDancePointsForOni ); ini.SetValueB( "Options", "DancePointsForOni", m_bDancePointsForOni );
+2 -1
View File
@@ -64,7 +64,8 @@ public:
bool m_bPickExtraStage; bool m_bPickExtraStage;
float m_fLongVerSongSeconds; float m_fLongVerSongSeconds;
float m_fMarathonVerSongSeconds; float m_fMarathonVerSongSeconds;
bool m_bShowSongOptions; enum Maybe { ASK = -1, NO = 0, YES = 1 };
Maybe m_ShowSongOptions;
bool m_bSoloSingle; bool m_bSoloSingle;
bool m_bDancePointsForOni; //DDR-Extreme style dance points instead of max2 percent bool m_bDancePointsForOni; //DDR-Extreme style dance points instead of max2 percent
bool m_bTimestamping; bool m_bTimestamping;
+16 -3
View File
@@ -49,7 +49,7 @@ OptionRow g_MachineOptionsLines[NUM_MACHINE_OPTIONS_LINES] = {
OptionRow( "Show\nStats", "OFF","ON" ), OptionRow( "Show\nStats", "OFF","ON" ),
OptionRow( "Coins Per\nCredit", "1","2","3","4","5","6","7","8" ), OptionRow( "Coins Per\nCredit", "1","2","3","4","5","6","7","8" ),
OptionRow( "Joint\nPremium", "OFF","ON" ), OptionRow( "Joint\nPremium", "OFF","ON" ),
OptionRow( "Song\nOptions", "HIDE","ALLOW" ), OptionRow( "Song\nOptions", "HIDE","SHOW","ASK" ),
}; };
ScreenMachineOptions::ScreenMachineOptions() : ScreenMachineOptions::ScreenMachineOptions() :
@@ -106,7 +106,13 @@ void ScreenMachineOptions::ImportOptions()
m_iSelectedOption[0][MO_SHOWSTATS] = PREFSMAN->m_bShowStats ? 1:0; m_iSelectedOption[0][MO_SHOWSTATS] = PREFSMAN->m_bShowStats ? 1:0;
m_iSelectedOption[0][MO_COINS_PER_CREDIT] = PREFSMAN->m_iCoinsPerCredit - 1; m_iSelectedOption[0][MO_COINS_PER_CREDIT] = PREFSMAN->m_iCoinsPerCredit - 1;
m_iSelectedOption[0][MO_JOINT_PREMIUM] = PREFSMAN->m_bJointPremium ? 1:0; m_iSelectedOption[0][MO_JOINT_PREMIUM] = PREFSMAN->m_bJointPremium ? 1:0;
m_iSelectedOption[0][MO_SHOW_SONG_OPTIONS] = PREFSMAN->m_bShowSongOptions ? 1:0; switch(PREFSMAN->m_ShowSongOptions)
{
case PrefsManager::YES: m_iSelectedOption[0][MO_SHOW_SONG_OPTIONS] = 1; break;
case PrefsManager::NO: m_iSelectedOption[0][MO_SHOW_SONG_OPTIONS] = 0; break;
case PrefsManager::ASK: m_iSelectedOption[0][MO_SHOW_SONG_OPTIONS] = 2; break;
default: ASSERT(0);
}
} }
void ScreenMachineOptions::ExportOptions() void ScreenMachineOptions::ExportOptions()
@@ -163,7 +169,14 @@ void ScreenMachineOptions::ExportOptions()
PREFSMAN->m_bShowStats = m_iSelectedOption[0][MO_SHOWSTATS] == 1; PREFSMAN->m_bShowStats = m_iSelectedOption[0][MO_SHOWSTATS] == 1;
PREFSMAN->m_iCoinsPerCredit = m_iSelectedOption[0][MO_COINS_PER_CREDIT] + 1; PREFSMAN->m_iCoinsPerCredit = m_iSelectedOption[0][MO_COINS_PER_CREDIT] + 1;
PREFSMAN->m_bJointPremium = m_iSelectedOption[0][MO_JOINT_PREMIUM] == 1; PREFSMAN->m_bJointPremium = m_iSelectedOption[0][MO_JOINT_PREMIUM] == 1;
PREFSMAN->m_bShowSongOptions = (bool&)m_iSelectedOption[0][MO_SHOW_SONG_OPTIONS];
switch(m_iSelectedOption[0][MO_SHOW_SONG_OPTIONS])
{
case 0: PREFSMAN->m_ShowSongOptions = PrefsManager::NO; break;
case 1: PREFSMAN->m_ShowSongOptions = PrefsManager::YES; break;
case 2: PREFSMAN->m_ShowSongOptions = PrefsManager::ASK; break;
default: ASSERT(0);
}
} }
void ScreenMachineOptions::GoToPrevState() void ScreenMachineOptions::GoToPrevState()
+58 -1
View File
@@ -19,6 +19,7 @@
#include "AnnouncerManager.h" #include "AnnouncerManager.h"
#include "NoteSkinManager.h" #include "NoteSkinManager.h"
#include "NoteFieldPositioning.h" #include "NoteFieldPositioning.h"
#include "ScreenSongOptions.h"
#define PREV_SCREEN( play_mode ) THEME->GetMetric ("ScreenPlayerOptions","PrevScreen"+Capitalize(PlayModeToString(play_mode))) #define PREV_SCREEN( play_mode ) THEME->GetMetric ("ScreenPlayerOptions","PrevScreen"+Capitalize(PlayModeToString(play_mode)))
#define NEXT_SCREEN( play_mode ) THEME->GetMetric ("ScreenPlayerOptions","NextScreen"+Capitalize(PlayModeToString(play_mode))) #define NEXT_SCREEN( play_mode ) THEME->GetMetric ("ScreenPlayerOptions","NextScreen"+Capitalize(PlayModeToString(play_mode)))
@@ -63,6 +64,23 @@ ScreenPlayerOptions::ScreenPlayerOptions() :
NUM_PLAYER_OPTIONS_LINES, NUM_PLAYER_OPTIONS_LINES,
true, false ); true, false );
/* If we're going to "press start for more options" or skipping options
* entirely, we need a different fade out. XXX: this is a hack */
if(PREFSMAN->m_ShowSongOptions == PrefsManager::NO)
m_Menu.m_Out.Load( THEME->GetPathToB("ScreenPlayerOptions direct out") ); /* direct to stage */
else if(PREFSMAN->m_ShowSongOptions == PrefsManager::ASK)
m_Menu.m_Out.Load( THEME->GetPathToB("ScreenPlayerOptions option out") ); /* optional song options */
m_sprOptionsMessage.Load( THEME->GetPathToG("ScreenPlayerOptions options") );
m_sprOptionsMessage.StopAnimating();
m_sprOptionsMessage.SetXY( CENTER_X, CENTER_Y );
m_sprOptionsMessage.SetZoom( 1 );
m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,0) );
//this->AddChild( &m_sprOptionsMessage ); // we have to draw this manually over the top of transitions
m_bAcceptedChoices = false;
m_bGoToOptions = ( PREFSMAN->m_ShowSongOptions == PrefsManager::YES );
SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("player options intro") ); SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("player options intro") );
} }
@@ -240,28 +258,67 @@ void ScreenPlayerOptions::GoToNextState()
{ {
if( GAMESTATE->m_bEditing ) if( GAMESTATE->m_bEditing )
SCREENMAN->PopTopScreen(); SCREENMAN->PopTopScreen();
else else if( m_bGoToOptions )
SCREENMAN->SetNewScreen( NEXT_SCREEN(GAMESTATE->m_PlayMode) ); SCREENMAN->SetNewScreen( NEXT_SCREEN(GAMESTATE->m_PlayMode) );
else
SCREENMAN->SetNewScreen( ScreenSongOptions::GetNextScreen() );
} }
void ScreenPlayerOptions::Update( float fDelta ) void ScreenPlayerOptions::Update( float fDelta )
{ {
ScreenOptions::Update( fDelta ); ScreenOptions::Update( fDelta );
m_sprOptionsMessage.Update( fDelta );
} }
void ScreenPlayerOptions::DrawPrimitives() void ScreenPlayerOptions::DrawPrimitives()
{ {
ScreenOptions::DrawPrimitives(); ScreenOptions::DrawPrimitives();
m_sprOptionsMessage.Draw();
} }
void ScreenPlayerOptions::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ) void ScreenPlayerOptions::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{ {
if( !GAMESTATE->m_bEditing &&
type == IET_FIRST_PRESS &&
!m_Menu.m_In.IsTransitioning() &&
MenuI.IsValid() &&
MenuI.button == MENU_BUTTON_START &&
PREFSMAN->m_ShowSongOptions == PrefsManager::ASK )
{
if( m_bAcceptedChoices && !m_bGoToOptions )
{
m_bGoToOptions = true;
m_sprOptionsMessage.SetState( 1 );
SOUNDMAN->PlayOnce( THEME->GetPathToS("Common start") );
}
}
ScreenOptions::Input( DeviceI, type, GameI, MenuI, StyleI ); ScreenOptions::Input( DeviceI, type, GameI, MenuI, StyleI );
} }
void ScreenPlayerOptions::HandleScreenMessage( const ScreenMessage SM ) void ScreenPlayerOptions::HandleScreenMessage( const ScreenMessage SM )
{ {
switch( SM )
{
case SM_BeginFadingOut: // when the user accepts the page of options
{
m_bAcceptedChoices = true;
float fShowSeconds = m_Menu.m_Out.GetLengthSeconds();
// show "hold START for options"
m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,0) );
m_sprOptionsMessage.BeginTweening( 0.15f ); // fade in
m_sprOptionsMessage.SetZoomY( 1 );
m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,1) );
m_sprOptionsMessage.BeginTweening( fShowSeconds-0.3f ); // sleep
m_sprOptionsMessage.BeginTweening( 0.15f ); // fade out
m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,0) );
m_sprOptionsMessage.SetZoomY( 0 );
}
break;
}
ScreenOptions::HandleScreenMessage( SM ); ScreenOptions::HandleScreenMessage( SM );
} }
+4
View File
@@ -31,6 +31,10 @@ private:
void GoToNextState(); void GoToNextState();
void GoToPrevState(); void GoToPrevState();
bool m_bAcceptedChoices;
bool m_bGoToOptions;
Sprite m_sprOptionsMessage;
}; };
+14 -3
View File
@@ -44,19 +44,30 @@ OptionRow g_SongOptionsLines[NUM_SONG_OPTIONS_LINES] = {
OptionRow( "Auto\nAdjust", "OFF", "ON" ), OptionRow( "Auto\nAdjust", "OFF", "ON" ),
}; };
/* Get the next screen we'll go to when finished. */
CString ScreenSongOptions::GetNextScreen()
{
return NEXT_SCREEN(GAMESTATE->m_PlayMode);
}
ScreenSongOptions::ScreenSongOptions() : ScreenSongOptions::ScreenSongOptions() :
ScreenOptions("ScreenSongOptions",true) ScreenOptions("ScreenSongOptions",true)
{ {
LOG->Trace( "ScreenSongOptions::ScreenSongOptions()" ); LOG->Trace( "ScreenSongOptions::ScreenSongOptions()" );
if( !PREFSMAN->m_bShowSongOptions )
SCREENMAN->SetNewScreen( NEXT_SCREEN(GAMESTATE->m_PlayMode) );
Init( INPUTMODE_BOTH, Init( INPUTMODE_BOTH,
g_SongOptionsLines, g_SongOptionsLines,
NUM_SONG_OPTIONS_LINES, NUM_SONG_OPTIONS_LINES,
false, false ); false, false );
/* If we're coming in from "press start for more options", we need a different
* fade in. XXX: this is a hack */
if(PREFSMAN->m_ShowSongOptions == PrefsManager::ASK)
{
m_Menu.m_In.Load( THEME->GetPathToB("ScreenSongOptions option in") );
m_Menu.m_In.StartTransitioning();
}
} }
void ScreenSongOptions::ImportOptions() void ScreenSongOptions::ImportOptions()
+1
View File
@@ -16,6 +16,7 @@ class ScreenSongOptions : public ScreenOptions
{ {
public: public:
ScreenSongOptions(); ScreenSongOptions();
static CString GetNextScreen();
private: private:
void ImportOptions(); void ImportOptions();