Handle selections that we have no matches for, so we don't assert

out in ScreenJukebox
This commit is contained in:
Glenn Maynard
2003-03-23 18:49:29 +00:00
parent b63cbeb75e
commit ee27f2b676
2 changed files with 15 additions and 0 deletions
+12
View File
@@ -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") );