From 922feeb10570f07aeb7ad336d93e0b2641ea4f4b Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 16 Mar 2003 07:29:58 +0000 Subject: [PATCH] Add sanity check that Style and PlayMode are set before selecting song --- stepmania/src/ScreenSelectMusic.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index d60c51dfa8..94f0772c0b 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -88,6 +88,14 @@ ScreenSelectMusic::ScreenSelectMusic() { LOG->Trace( "ScreenSelectMusic::ScreenSelectMusic()" ); + + if( GAMESTATE->m_CurStyle == STYLE_INVALID ) + RageException::Throw( "The Style has not been set. A theme must set the Style before loading ScreenSelectMusic." ); + + if( GAMESTATE->m_PlayMode == PLAY_MODE_INVALID ) + RageException::Throw( "The PlayMode has not been set. A theme must set the PlayMode before loading ScreenSelectMusic." ); + + CodeDetector::RefreshCacheItems(); GAMESTATE->m_SongOptions.m_FailType = PREFSMAN->m_DefaultFailType; @@ -142,9 +150,6 @@ ScreenSelectMusic::ScreenSelectMusic() m_GrooveRadar.SetXY( RADAR_X, RADAR_Y ); this->AddChild( &m_GrooveRadar ); -// m_OptionIcons.SetXY( OPTION_ICONS_X, OPTION_ICONS_Y ); -// this->AddChild( &m_OptionIcons ); - m_textSongOptions.LoadFromFont( THEME->GetPathTo("Fonts","normal") ); m_textSongOptions.SetXY( SONG_OPTIONS_X, SONG_OPTIONS_Y );