From 01dcb2a8b7b30126d066331aeca131d6b4b30d01 Mon Sep 17 00:00:00 2001 From: Colby Klein Date: Fri, 11 Jul 2008 13:06:37 +0000 Subject: [PATCH] Add SeectMenuChangesDifficulty. Instead of crashing when the PlayMode is not set, revert to PLAY_MODE_REGULAR. --- stepmania/src/ScreenSelectMusic.cpp | 12 +++++++----- stepmania/src/ScreenSelectMusic.h | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index 2e8f73dfac..0f67df2cf8 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -77,6 +77,7 @@ void ScreenSelectMusic::Init() MODE_MENU_AVAILABLE.Load( m_sName, "ModeMenuAvailable" ); USE_OPTIONS_LIST.Load( m_sName, "UseOptionsList" ); USE_PLAYER_SELECT_MENU.Load( m_sName, "UsePlayerSelectMenu" ); + SELECT_MENU_CHANGES_DIFFICULTY.Load( m_sName, "SelectMenuChangesDifficulty" ); TWO_PART_SELECTION.Load( m_sName, "TwoPartSelection" ); m_GameButtonPreviousSong = INPUTMAPPER->GetInputScheme()->ButtonNameToIndex( THEME->GetMetric(m_sName,"PreviousSongButton") ); @@ -193,8 +194,11 @@ void ScreenSelectMusic::BeginScreen() RageException::Throw( "The Style has not been set. A theme must set the Style before loading ScreenSelectMusic." ); if( GAMESTATE->m_PlayMode == PlayMode_Invalid ) - RageException::Throw( "The PlayMode has not been set. A theme must set the PlayMode before loading ScreenSelectMusic." ); - + { + /* Instead of crashing here, let's just set the PlayMode to regular */ + GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR ); + LOG->Trace( "PlayMode not set, setting as regular." ); + } FOREACH_ENUM( PlayerNumber, pn ) { if( GAMESTATE->IsHumanPlayer(pn) ) @@ -437,11 +441,9 @@ void ScreenSelectMusic::Input( const InputEventPlus &input ) if( SELECT_MENU_AVAILABLE && input.MenuI == GAME_BUTTON_SELECT && input.type != IET_REPEAT ) UpdateSelectButton( input.pn, input.type == IET_FIRST_PRESS ); - - if( SELECT_MENU_AVAILABLE && m_bSelectIsDown[input.pn] ) { - if( input.type == IET_FIRST_PRESS ) + if( input.type == IET_FIRST_PRESS && SELECT_MENU_CHANGES_DIFFICULTY ) { switch( input.MenuI ) { diff --git a/stepmania/src/ScreenSelectMusic.h b/stepmania/src/ScreenSelectMusic.h index 48f80220e8..9c7a18bc1d 100644 --- a/stepmania/src/ScreenSelectMusic.h +++ b/stepmania/src/ScreenSelectMusic.h @@ -83,6 +83,7 @@ protected: ThemeMetric MODE_MENU_AVAILABLE; ThemeMetric USE_OPTIONS_LIST; ThemeMetric USE_PLAYER_SELECT_MENU; + ThemeMetric SELECT_MENU_CHANGES_DIFFICULTY; ThemeMetric TWO_PART_SELECTION; bool CanChangeSong() const { return m_SelectionState == SelectionState_SelectingSong; }