From 1cd2532f9e3b57035039061894df4d7a2f48e901 Mon Sep 17 00:00:00 2001 From: Charles Lohr Date: Mon, 8 Nov 2004 05:24:43 +0000 Subject: [PATCH] Feature: If there is a course named exactly the current theme name, then take songs from it for demo and jukebox. --- stepmania/src/ScreenJukebox.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/stepmania/src/ScreenJukebox.cpp b/stepmania/src/ScreenJukebox.cpp index 8a7ab3fcfa..3f8b56aafe 100644 --- a/stepmania/src/ScreenJukebox.cpp +++ b/stepmania/src/ScreenJukebox.cpp @@ -12,6 +12,8 @@ #include "ScreenAttract.h" #include "RageUtil.h" #include "UnlockSystem.h" +#include "Course.h" +#include "ThemeManager.h" // HACK: This belongs in ScreenDemonstration #define DIFFICULTIES_TO_SHOW THEME->GetMetric ("ScreenDemonstration","DifficultiesToShow") @@ -22,10 +24,20 @@ const ScreenMessage SM_NotesEnded = ScreenMessage(SM_User+10); // MUST be sam bool ScreenJukebox::SetSong( bool bDemonstration ) { vector vSongs; - if( GAMESTATE->m_sPreferredGroup == GROUP_ALL_MUSIC ) - SONGMAN->GetSongs( vSongs ); - else - SONGMAN->GetSongs( vSongs, GAMESTATE->m_sPreferredGroup ); + + //Check to see if there is a theme-course + //I.E. If there is a course called exactly the theme name, + //then we pick a song from this course. + Course * tCourse = SONGMAN->GetCourseFromName( THEME->GetCurThemeName() ); + if( tCourse != NULL ) + for ( int i = 0; i < tCourse->m_entries.size(); i++ ) + vSongs.push_back( tCourse->m_entries[i].pSong ); + + if ( vSongs.size() == 0 ) + if( GAMESTATE->m_sPreferredGroup == GROUP_ALL_MUSIC ) + SONGMAN->GetSongs( vSongs ); + else + SONGMAN->GetSongs( vSongs, GAMESTATE->m_sPreferredGroup ); // // Calculate what difficulties to show