Add SeectMenuChangesDifficulty. Instead of crashing when the PlayMode is not set, revert to PLAY_MODE_REGULAR.
This commit is contained in:
@@ -77,6 +77,7 @@ void ScreenSelectMusic::Init()
|
|||||||
MODE_MENU_AVAILABLE.Load( m_sName, "ModeMenuAvailable" );
|
MODE_MENU_AVAILABLE.Load( m_sName, "ModeMenuAvailable" );
|
||||||
USE_OPTIONS_LIST.Load( m_sName, "UseOptionsList" );
|
USE_OPTIONS_LIST.Load( m_sName, "UseOptionsList" );
|
||||||
USE_PLAYER_SELECT_MENU.Load( m_sName, "UsePlayerSelectMenu" );
|
USE_PLAYER_SELECT_MENU.Load( m_sName, "UsePlayerSelectMenu" );
|
||||||
|
SELECT_MENU_CHANGES_DIFFICULTY.Load( m_sName, "SelectMenuChangesDifficulty" );
|
||||||
TWO_PART_SELECTION.Load( m_sName, "TwoPartSelection" );
|
TWO_PART_SELECTION.Load( m_sName, "TwoPartSelection" );
|
||||||
|
|
||||||
m_GameButtonPreviousSong = INPUTMAPPER->GetInputScheme()->ButtonNameToIndex( THEME->GetMetric(m_sName,"PreviousSongButton") );
|
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." );
|
RageException::Throw( "The Style has not been set. A theme must set the Style before loading ScreenSelectMusic." );
|
||||||
|
|
||||||
if( GAMESTATE->m_PlayMode == PlayMode_Invalid )
|
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 )
|
FOREACH_ENUM( PlayerNumber, pn )
|
||||||
{
|
{
|
||||||
if( GAMESTATE->IsHumanPlayer(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 )
|
if( SELECT_MENU_AVAILABLE && input.MenuI == GAME_BUTTON_SELECT && input.type != IET_REPEAT )
|
||||||
UpdateSelectButton( input.pn, input.type == IET_FIRST_PRESS );
|
UpdateSelectButton( input.pn, input.type == IET_FIRST_PRESS );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if( SELECT_MENU_AVAILABLE && m_bSelectIsDown[input.pn] )
|
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 )
|
switch( input.MenuI )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ protected:
|
|||||||
ThemeMetric<bool> MODE_MENU_AVAILABLE;
|
ThemeMetric<bool> MODE_MENU_AVAILABLE;
|
||||||
ThemeMetric<bool> USE_OPTIONS_LIST;
|
ThemeMetric<bool> USE_OPTIONS_LIST;
|
||||||
ThemeMetric<bool> USE_PLAYER_SELECT_MENU;
|
ThemeMetric<bool> USE_PLAYER_SELECT_MENU;
|
||||||
|
ThemeMetric<bool> SELECT_MENU_CHANGES_DIFFICULTY;
|
||||||
ThemeMetric<bool> TWO_PART_SELECTION;
|
ThemeMetric<bool> TWO_PART_SELECTION;
|
||||||
|
|
||||||
bool CanChangeSong() const { return m_SelectionState == SelectionState_SelectingSong; }
|
bool CanChangeSong() const { return m_SelectionState == SelectionState_SelectingSong; }
|
||||||
|
|||||||
Reference in New Issue
Block a user