From ee27f2b67679e94192cc5a9c9b900e72e5854950 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 23 Mar 2003 18:49:29 +0000 Subject: [PATCH] Handle selections that we have no matches for, so we don't assert out in ScreenJukebox --- stepmania/src/ScreenJukeboxMenu.cpp | 12 ++++++++++++ stepmania/src/ScreenJukeboxMenu.h | 3 +++ 2 files changed, 15 insertions(+) diff --git a/stepmania/src/ScreenJukeboxMenu.cpp b/stepmania/src/ScreenJukeboxMenu.cpp index e36ee96c37..68ca5143e4 100644 --- a/stepmania/src/ScreenJukeboxMenu.cpp +++ b/stepmania/src/ScreenJukeboxMenu.cpp @@ -21,6 +21,7 @@ #include "GameState.h" #include "RageSoundManager.h" #include "ThemeManager.h" +#include "ScreenJukebox.h" // @@ -52,6 +53,8 @@ ScreenJukeboxMenu::ScreenJukeboxMenu() m_textExplanation.SetZoom( 0.7f ); this->AddChild( &m_textExplanation ); + m_soundInvalid.Load( THEME->GetPathTo("Sounds","Common invalid") ); + SOUNDMAN->PlayMusic( THEME->GetPathTo("Sounds","ScreenJukeboxMenu music") ); } @@ -124,6 +127,15 @@ void ScreenJukeboxMenu::MenuStart( PlayerNumber pn ) GAMESTATE->m_PreferredDifficulty[p] = dc; GAMESTATE->m_bJukeboxUsesModifiers = bModifiers; + if(!ScreenJukebox::SetSong()) + { + /* No songs are available for the selected style, group, and difficulty. */ + + m_soundInvalid.Play(); + SCREENMAN->SystemMessage( "No songs available with these settings" ); + return; + } + SOUNDMAN->StopMusic(); SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","Common start") ); diff --git a/stepmania/src/ScreenJukeboxMenu.h b/stepmania/src/ScreenJukeboxMenu.h index 1839856c48..5ad19b97f3 100644 --- a/stepmania/src/ScreenJukeboxMenu.h +++ b/stepmania/src/ScreenJukeboxMenu.h @@ -13,6 +13,7 @@ #include "JukeboxMenu.h" #include "BitmapText.h" #include "MenuElements.h" +#include "RageSound.h" class ScreenJukeboxMenu : public Screen @@ -39,6 +40,8 @@ private: BitmapText m_textExplanation; MenuElements m_Menu; + + RageSound m_soundInvalid; };