add background change controls for "baked random"

Shift+B to choose to choose a different baked random movie
add bgchange menu lines for "movie in group" and "movie in group and in genre"
This commit is contained in:
Chris Danford
2005-06-05 01:27:15 +00:00
parent 675440687f
commit 4e86ffe01d
5 changed files with 186 additions and 95 deletions
+13 -7
View File
@@ -173,7 +173,13 @@ void BackgroundUtil::GetGlobalBGAnimations( const Song *pSong, const CString &sM
StripCvs( vsPathsOut, vsNamesOut ); StripCvs( vsPathsOut, vsNamesOut );
} }
void BackgroundUtil::GetGlobalRandomMovies( const Song *pSong, const CString &sMatch, vector<CString> &vsPathsOut, vector<CString> &vsNamesOut ) void BackgroundUtil::GetGlobalRandomMovies(
const Song *pSong,
const CString &sMatch,
vector<CString> &vsPathsOut,
vector<CString> &vsNamesOut,
bool bTryInsideOfSongGroupAndGenreFirst,
bool bTryInsideOfSongGroupFirst )
{ {
vsPathsOut.clear(); vsPathsOut.clear();
vsNamesOut.clear(); vsNamesOut.clear();
@@ -193,12 +199,12 @@ void BackgroundUtil::GetGlobalRandomMovies( const Song *pSong, const CString &sM
// Search for the most appropriate background // Search for the most appropriate background
// //
{ {
set<CString> ssFilterToFileNames; set<CString> ssFileNameWhitelist;
if( pSong && !pSong->m_sGenre.empty() ) if( bTryInsideOfSongGroupAndGenreFirst && pSong && !pSong->m_sGenre.empty() )
GetFilterToFileNames( RANDOMMOVIES_DIR, pSong, ssFilterToFileNames ); GetFilterToFileNames( RANDOMMOVIES_DIR, pSong, ssFileNameWhitelist );
vector<CString> vsDirsToTry; vector<CString> vsDirsToTry;
if( pSong ) if( bTryInsideOfSongGroupFirst && pSong )
{ {
ASSERT( !pSong->m_sGroupName.empty() ); ASSERT( !pSong->m_sGroupName.empty() );
vsDirsToTry.push_back( RANDOMMOVIES_DIR+pSong->m_sGroupName+"/" ); vsDirsToTry.push_back( RANDOMMOVIES_DIR+pSong->m_sGroupName+"/" );
@@ -211,12 +217,12 @@ void BackgroundUtil::GetGlobalRandomMovies( const Song *pSong, const CString &sM
GetDirListing( *sDir+"*.mpg", vsPathsOut, false, true ); GetDirListing( *sDir+"*.mpg", vsPathsOut, false, true );
GetDirListing( *sDir+"*.mpeg", vsPathsOut, false, true ); GetDirListing( *sDir+"*.mpeg", vsPathsOut, false, true );
if( !ssFilterToFileNames.empty() ) if( !ssFileNameWhitelist.empty() )
{ {
for( unsigned i=0; i<vsPathsOut.size(); i++ ) for( unsigned i=0; i<vsPathsOut.size(); i++ )
{ {
CString sBasename = Basename( vsPathsOut[i] ); CString sBasename = Basename( vsPathsOut[i] );
bool bFound = ssFilterToFileNames.find(sBasename) != ssFilterToFileNames.end(); bool bFound = ssFileNameWhitelist.find(sBasename) != ssFileNameWhitelist.end();
if( !bFound ) if( !bFound )
{ {
vsPathsOut.erase( vsPathsOut.begin()+i ); vsPathsOut.erase( vsPathsOut.begin()+i );
+1 -2
View File
@@ -71,7 +71,6 @@ struct BackgroundChange
CString m_sTransition; CString m_sTransition;
}; };
namespace BackgroundUtil namespace BackgroundUtil
{ {
void SortBackgroundChangesArray( vector<BackgroundChange> &vBackgroundChanges ); void SortBackgroundChangesArray( vector<BackgroundChange> &vBackgroundChanges );
@@ -83,7 +82,7 @@ namespace BackgroundUtil
void GetSongMovies( const Song *pSong, const CString &sMatch, vector<CString> &vsPathsOut, vector<CString> &vsNamesOut ); void GetSongMovies( const Song *pSong, const CString &sMatch, vector<CString> &vsPathsOut, vector<CString> &vsNamesOut );
void GetSongBitmaps( const Song *pSong, const CString &sMatch, vector<CString> &vsPathsOut, vector<CString> &vsNamesOut ); void GetSongBitmaps( const Song *pSong, const CString &sMatch, vector<CString> &vsPathsOut, vector<CString> &vsNamesOut );
void GetGlobalBGAnimations( const Song *pSong, const CString &sMatch, vector<CString> &vsPathsOut, vector<CString> &vsNamesOut ); void GetGlobalBGAnimations( const Song *pSong, const CString &sMatch, vector<CString> &vsPathsOut, vector<CString> &vsNamesOut );
void GetGlobalRandomMovies( const Song *pSong, const CString &sMatch, vector<CString> &vsPathsOut, vector<CString> &vsNamesOut ); void GetGlobalRandomMovies( const Song *pSong, const CString &sMatch, vector<CString> &vsPathsOut, vector<CString> &vsNamesOut, bool bTryInsideOfSongGroupAndGenreFirst = true, bool bTryInsideOfSongGroupFirst = true );
}; };
+11 -10
View File
@@ -566,22 +566,23 @@ void NoteField::DrawPrimitives()
if( IS_ON_SCREEN(fLowestBeat) ) if( IS_ON_SCREEN(fLowestBeat) )
{ {
vector<CString> vs; vector<CString> vsBGChanges;
FOREACH_CONST( BackgroundLayer, viLowestIndex, i ) FOREACH_CONST( BackgroundLayer, viLowestIndex, i )
{ {
ASSERT( iter[*i] != GAMESTATE->m_pCurSong->GetBackgroundChanges(*i).end() ); ASSERT( iter[*i] != GAMESTATE->m_pCurSong->GetBackgroundChanges(*i).end() );
const BackgroundChange& change = *iter[*i]; const BackgroundChange& change = *iter[*i];
vs.push_back( ssprintf("%s%s%s%s%s%s", vector<CString> vsParts;
((*i!=0) ? ssprintf("%d: ",*i) : CString()).c_str(), if( *i!=0 ) vsParts.push_back( ssprintf("%d: ",*i) );
(!change.m_def.m_sFile1.empty() ? " "+change.m_def.m_sFile1 : CString()).c_str(), if( !change.m_def.m_sFile1.empty() ) vsParts.push_back( change.m_def.m_sFile1 );
(!change.m_def.m_sFile2.empty() ? " "+change.m_def.m_sFile2 : CString()).c_str(), if( !change.m_def.m_sFile2.empty() ) vsParts.push_back( change.m_def.m_sFile2 );
((change.m_fRate!=1.0f) ? ssprintf("%.2f%%",change.m_fRate*100) : CString()).c_str(), if( change.m_fRate!=1.0f ) vsParts.push_back( ssprintf("%.2f%%",change.m_fRate*100) );
(!change.m_sTransition.empty() ? " "+change.m_sTransition : CString()).c_str(), if( !change.m_sTransition.empty() ) vsParts.push_back( change.m_sTransition );
(!change.m_def.m_sEffect.empty() ? " "+change.m_def.m_sEffect : CString()).c_str() if( !change.m_def.m_sEffect.empty() ) vsParts.push_back( change.m_def.m_sEffect );
) );
vsBGChanges.push_back( join("\n",vsParts) );
} }
DrawBGChangeText( fLowestBeat, join("\n",vs) ); DrawBGChangeText( fLowestBeat, join("\n",vsBGChanges) );
} }
FOREACH_CONST( BackgroundLayer, viLowestIndex, i ) FOREACH_CONST( BackgroundLayer, viLowestIndex, i )
iter[*i]++; iter[*i]++;
+127 -48
View File
@@ -144,11 +144,14 @@ void ScreenEdit::InitEditMappings()
g_EditMappings.button[EDIT_BUTTON_OPEN_EDIT_MENU][0] = DeviceInput(DEVICE_KEYBOARD, KEY_ESC); g_EditMappings.button[EDIT_BUTTON_OPEN_EDIT_MENU][0] = DeviceInput(DEVICE_KEYBOARD, KEY_ESC);
g_EditMappings.button[EDIT_BUTTON_OPEN_AREA_MENU][0] = DeviceInput(DEVICE_KEYBOARD, KEY_ENTER); g_EditMappings.button[EDIT_BUTTON_OPEN_AREA_MENU][0] = DeviceInput(DEVICE_KEYBOARD, KEY_ENTER);
g_EditMappings.button[EDIT_BUTTON_OPEN_AREA_MENU][1] = DeviceInput(DEVICE_KEYBOARD, KEY_KP_ENTER);
g_EditMappings.button[EDIT_BUTTON_OPEN_BGA_MENU][0] = DeviceInput(DEVICE_KEYBOARD, KEY_Cb); g_EditMappings.button[EDIT_BUTTON_OPEN_BGA_MENU][0] = DeviceInput(DEVICE_KEYBOARD, KEY_Cb);
g_EditMappings.button[EDIT_BUTTON_OPEN_COURSE_MENU][0] = DeviceInput(DEVICE_KEYBOARD, KEY_Cc); g_EditMappings.button[EDIT_BUTTON_OPEN_COURSE_MENU][0] = DeviceInput(DEVICE_KEYBOARD, KEY_Cc);
g_EditMappings.button[EDIT_BUTTON_OPEN_INPUT_HELP][0] = DeviceInput(DEVICE_KEYBOARD, KEY_F1); g_EditMappings.button[EDIT_BUTTON_OPEN_INPUT_HELP][0] = DeviceInput(DEVICE_KEYBOARD, KEY_F1);
g_EditMappings.button[EDIT_BUTTON_NEW_BAKED_RANDOM_FILE_FOR_BGCHANGE][0] = DeviceInput(DEVICE_KEYBOARD, KEY_Cb);
g_EditMappings.hold[EDIT_BUTTON_NEW_BAKED_RANDOM_FILE_FOR_BGCHANGE][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT);
g_EditMappings.hold[EDIT_BUTTON_NEW_BAKED_RANDOM_FILE_FOR_BGCHANGE][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT);
g_EditMappings.button[EDIT_BUTTON_PLAY_FROM_START][0] = DeviceInput(DEVICE_KEYBOARD, KEY_Cp); g_EditMappings.button[EDIT_BUTTON_PLAY_FROM_START][0] = DeviceInput(DEVICE_KEYBOARD, KEY_Cp);
g_EditMappings.hold[EDIT_BUTTON_PLAY_FROM_START][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL); g_EditMappings.hold[EDIT_BUTTON_PLAY_FROM_START][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL);
g_EditMappings.hold[EDIT_BUTTON_PLAY_FROM_START][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RCTRL); g_EditMappings.hold[EDIT_BUTTON_PLAY_FROM_START][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RCTRL);
@@ -441,48 +444,74 @@ static Menu g_SongInformation(
MenuRow( ScreenEdit::artist_transliteration, "Artist transliteration", true, EDIT_MODE_PRACTICE, 0, NULL ) MenuRow( ScreenEdit::artist_transliteration, "Artist transliteration", true, EDIT_MODE_PRACTICE, 0, NULL )
); );
enum { none, pick_random, song_bganimation, song_movie, song_bitmap, global_bganimation, global_movie }; enum { song_bganimation, song_movie, song_bitmap, global_bganimation, global_movie, global_movie_song_group, global_movie_song_group_and_genre, dynamic_random, baked_random, none };
static bool EnabledIfSet1SB(); static bool EnabledIfSet1SongBGAnimation();
static bool EnabledIfSet1SM(); static bool EnabledIfSet1SongMovie();
static bool EnabledIfSet1SI(); static bool EnabledIfSet1SongBitmap();
static bool EnabledIfSet1GB(); static bool EnabledIfSet1GlobalBGAnimation();
static bool EnabledIfSet1GM(); static bool EnabledIfSet1GlobalMovie();
static bool EnabledIfSet2SB(); static bool EnabledIfSet1GlobalMovieSongGroup();
static bool EnabledIfSet2SM(); static bool EnabledIfSet1GlobalMovieSongGroupAndGenre();
static bool EnabledIfSet2SI(); static bool EnabledIfSet2SongBGAnimation();
static bool EnabledIfSet2GB(); static bool EnabledIfSet2SongMovie();
static bool EnabledIfSet2GM(); static bool EnabledIfSet2SongBitmap();
static bool EnabledIfSet2GlobalBGAnimation();
static bool EnabledIfSet2GlobalMovie();
static bool EnabledIfSet2GlobalMovieSongGroup();
static bool EnabledIfSet2GlobalMovieSongGroupAndGenre();
static Menu g_BackgroundChange( static Menu g_BackgroundChange(
"ScreenMiniMenuBackgroundChange", "ScreenMiniMenuBackgroundChange",
MenuRow( ScreenEdit::layer, "Layer", true, EDIT_MODE_FULL, 0, "0","1" ), MenuRow( ScreenEdit::layer, "Layer", true, EDIT_MODE_FULL, 0, "0","1" ),
MenuRow( ScreenEdit::rate, "Rate", true, EDIT_MODE_FULL, 10, "0%","10%","20%","30%","40%","50%","60%","70%","80%","90%","100%","120%","140%","160%","180%","200%" ), MenuRow( ScreenEdit::rate, "Rate", true, EDIT_MODE_FULL, 10, "0%","10%","20%","30%","40%","50%","60%","70%","80%","90%","100%","120%","140%","160%","180%","200%" ),
MenuRow( ScreenEdit::transition, "Transition", true, EDIT_MODE_FULL, 0, NULL ), MenuRow( ScreenEdit::transition, "Transition", true, EDIT_MODE_FULL, 0, NULL ),
MenuRow( ScreenEdit::effect, "Force Effect", true, EDIT_MODE_FULL, 0, NULL ), MenuRow( ScreenEdit::effect, "Force Effect", true, EDIT_MODE_FULL, 0, NULL ),
MenuRow( ScreenEdit::file1_type, "File1 Type", true, EDIT_MODE_FULL, 0, "None", "Random", "Song BGAnimation", "Song Movie", "Song Bitmap", "Global BGAnimation", "Global Movie" ), MenuRow( ScreenEdit::file1_type, "File1 Type", true, EDIT_MODE_FULL, 0, "Song BGAnimation", "Song Movie", "Song Bitmap", "Global BGAnimation", "Global Movie", "Global Movie from Song Group", "Global Movie from Song Group and Genre", "Dynamic Random", "Baked Random", "None" ),
MenuRow( ScreenEdit::file1_song_bganimation, "File1 Song BGAnimation", EnabledIfSet1SB,EDIT_MODE_FULL, 0, NULL ), MenuRow( ScreenEdit::file1_song_bganimation, "File1 Song BGAnimation", EnabledIfSet1SongBGAnimation, EDIT_MODE_FULL, 0, NULL ),
MenuRow( ScreenEdit::file1_song_movie, "File1 Song Movie", EnabledIfSet1SM,EDIT_MODE_FULL, 0, NULL ), MenuRow( ScreenEdit::file1_song_movie, "File1 Song Movie", EnabledIfSet1SongMovie, EDIT_MODE_FULL, 0, NULL ),
MenuRow( ScreenEdit::file1_song_still, "File1 Song Still", EnabledIfSet1SI,EDIT_MODE_FULL, 0, NULL ), MenuRow( ScreenEdit::file1_song_still, "File1 Song Still", EnabledIfSet1SongBitmap, EDIT_MODE_FULL, 0, NULL ),
MenuRow( ScreenEdit::file1_global_bganimation, "File1 Global BGAnimation", EnabledIfSet1GB,EDIT_MODE_FULL, 0, NULL ), MenuRow( ScreenEdit::file1_global_bganimation, "File1 Global BGAnimation", EnabledIfSet1GlobalBGAnimation, EDIT_MODE_FULL, 0, NULL ),
MenuRow( ScreenEdit::file1_global_random_movie, "File1 Global Movie", EnabledIfSet1GM,EDIT_MODE_FULL, 0, NULL ), MenuRow( ScreenEdit::file1_global_movie, "File1 Global Movie", EnabledIfSet1GlobalMovie, EDIT_MODE_FULL, 0, NULL ),
MenuRow( ScreenEdit::file2_type, "File2 Type", true, EDIT_MODE_FULL, 0, "None", "Random", "Song BGAnimation", "Song Movie", "Song Bitmap", "Global BGAnimation", "Global Movie" ), MenuRow( ScreenEdit::file1_global_movie_song_group, "File1 Global Movie (Group)", EnabledIfSet1GlobalMovieSongGroup, EDIT_MODE_FULL, 0, NULL ),
MenuRow( ScreenEdit::file2_song_bganimation, "File2 Song BGAnimation", EnabledIfSet2SB,EDIT_MODE_FULL, 0, NULL ), MenuRow( ScreenEdit::file1_global_movie_song_group_and_genre, "File1 Global Movie (Group + Genre)", EnabledIfSet1GlobalMovieSongGroupAndGenre, EDIT_MODE_FULL, 0, NULL ),
MenuRow( ScreenEdit::file2_song_movie, "File2 Song Movie", EnabledIfSet2SM,EDIT_MODE_FULL, 0, NULL ), MenuRow( ScreenEdit::file2_type, "File2 Type", true, EDIT_MODE_FULL, 0, "Song BGAnimation", "Song Movie", "Song Bitmap", "Global BGAnimation", "Global Movie", "Global Movie from Song Group", "Global Movie from Song Group and Genre", "Dynamic Random", "Baked Random", "None" ),
MenuRow( ScreenEdit::file2_song_still, "File2 Song Still", EnabledIfSet2SI,EDIT_MODE_FULL, 0, NULL ), MenuRow( ScreenEdit::file2_song_bganimation, "File2 Song BGAnimation", EnabledIfSet2SongBGAnimation, EDIT_MODE_FULL, 0, NULL ),
MenuRow( ScreenEdit::file2_global_bganimation, "File2 Global BGAnimation", EnabledIfSet2GB,EDIT_MODE_FULL, 0, NULL ), MenuRow( ScreenEdit::file2_song_movie, "File2 Song Movie", EnabledIfSet2SongMovie, EDIT_MODE_FULL, 0, NULL ),
MenuRow( ScreenEdit::file2_global_random_movie, "File2 Global Movie", EnabledIfSet2GM,EDIT_MODE_FULL, 0, NULL ), MenuRow( ScreenEdit::file2_song_still, "File2 Song Still", EnabledIfSet2SongBitmap, EDIT_MODE_FULL, 0, NULL ),
MenuRow( ScreenEdit::file2_global_bganimation, "File2 Global BGAnimation", EnabledIfSet2GlobalBGAnimation, EDIT_MODE_FULL, 0, NULL ),
MenuRow( ScreenEdit::file2_global_movie, "File2 Global Movie", EnabledIfSet2GlobalMovie, EDIT_MODE_FULL, 0, NULL ),
MenuRow( ScreenEdit::file2_global_movie_song_group, "File2 Global Movie (Group)", EnabledIfSet2GlobalMovieSongGroup, EDIT_MODE_FULL, 0, NULL ),
MenuRow( ScreenEdit::file2_global_movie_song_group_and_genre, "File2 Global Movie (Group + Genre)", EnabledIfSet2GlobalMovieSongGroupAndGenre, EDIT_MODE_FULL, 0, NULL ),
MenuRow( ScreenEdit::delete_change, "Remove Change", true, EDIT_MODE_FULL, 0, NULL ) MenuRow( ScreenEdit::delete_change, "Remove Change", true, EDIT_MODE_FULL, 0, NULL )
); );
static bool EnabledIfSet1SB() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file1_type] == song_bganimation && !g_BackgroundChange.rows[ScreenEdit::file1_song_bganimation].choices.empty(); } static bool EnabledIfSet1SongBGAnimation() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file1_type] == song_bganimation && !g_BackgroundChange.rows[ScreenEdit::file1_song_bganimation].choices.empty(); }
static bool EnabledIfSet1SM() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file1_type] == song_movie && !g_BackgroundChange.rows[ScreenEdit::file1_song_movie].choices.empty(); } static bool EnabledIfSet1SongMovie() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file1_type] == song_movie && !g_BackgroundChange.rows[ScreenEdit::file1_song_movie].choices.empty(); }
static bool EnabledIfSet1SI() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file1_type] == song_bitmap && !g_BackgroundChange.rows[ScreenEdit::file1_song_still].choices.empty(); } static bool EnabledIfSet1SongBitmap() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file1_type] == song_bitmap && !g_BackgroundChange.rows[ScreenEdit::file1_song_still].choices.empty(); }
static bool EnabledIfSet1GB() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file1_type] == global_bganimation && !g_BackgroundChange.rows[ScreenEdit::file1_global_random_movie].choices.empty(); } static bool EnabledIfSet1GlobalBGAnimation() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file1_type] == global_bganimation && !g_BackgroundChange.rows[ScreenEdit::file1_global_bganimation].choices.empty(); }
static bool EnabledIfSet1GM() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file1_type] == global_movie && !g_BackgroundChange.rows[ScreenEdit::file1_global_bganimation].choices.empty(); } static bool EnabledIfSet1GlobalMovie() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file1_type] == global_movie && !g_BackgroundChange.rows[ScreenEdit::file1_global_movie].choices.empty(); }
static bool EnabledIfSet2SB() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file2_type] == song_bganimation && !g_BackgroundChange.rows[ScreenEdit::file2_song_bganimation].choices.empty(); } static bool EnabledIfSet1GlobalMovieSongGroup() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file1_type] == global_movie_song_group && !g_BackgroundChange.rows[ScreenEdit::file1_global_movie_song_group].choices.empty(); }
static bool EnabledIfSet2SM() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file2_type] == song_movie && !g_BackgroundChange.rows[ScreenEdit::file2_song_movie].choices.empty(); } static bool EnabledIfSet1GlobalMovieSongGroupAndGenre() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file1_type] == global_movie_song_group_and_genre && !g_BackgroundChange.rows[ScreenEdit::file1_global_movie_song_group_and_genre].choices.empty(); }
static bool EnabledIfSet2SI() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file2_type] == song_bitmap && !g_BackgroundChange.rows[ScreenEdit::file2_song_still].choices.empty(); } static bool EnabledIfSet2SongBGAnimation() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file2_type] == song_bganimation && !g_BackgroundChange.rows[ScreenEdit::file2_song_bganimation].choices.empty(); }
static bool EnabledIfSet2GB() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file2_type] == global_bganimation && !g_BackgroundChange.rows[ScreenEdit::file2_global_bganimation].choices.empty(); } static bool EnabledIfSet2SongMovie() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file2_type] == song_movie && !g_BackgroundChange.rows[ScreenEdit::file2_song_movie].choices.empty(); }
static bool EnabledIfSet2GM() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file2_type] == global_movie && !g_BackgroundChange.rows[ScreenEdit::file2_global_bganimation].choices.empty(); } static bool EnabledIfSet2SongBitmap() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file2_type] == song_bitmap && !g_BackgroundChange.rows[ScreenEdit::file2_song_still].choices.empty(); }
static bool EnabledIfSet2GlobalBGAnimation() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file2_type] == global_bganimation && !g_BackgroundChange.rows[ScreenEdit::file2_global_bganimation].choices.empty(); }
static bool EnabledIfSet2GlobalMovie() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file2_type] == global_movie && !g_BackgroundChange.rows[ScreenEdit::file2_global_movie].choices.empty(); }
static bool EnabledIfSet2GlobalMovieSongGroup() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file2_type] == global_movie_song_group && !g_BackgroundChange.rows[ScreenEdit::file2_global_movie_song_group].choices.empty(); }
static bool EnabledIfSet2GlobalMovieSongGroupAndGenre() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file2_type] == global_movie_song_group_and_genre && !g_BackgroundChange.rows[ScreenEdit::file2_global_movie_song_group_and_genre].choices.empty(); }
static CString GetOneBakedRandomFile( Song *pSong )
{
vector<CString> vsPathsOut;
vector<CString> vsNamesOut;
BackgroundUtil::GetGlobalRandomMovies(
pSong,
"",
vsPathsOut,
vsNamesOut );
if( !vsNamesOut.empty() )
return vsNamesOut[rand()%vsNamesOut.size()];
else
return "";
}
static Menu g_Prefs( static Menu g_Prefs(
"ScreenMiniMenuPreferences", "ScreenMiniMenuPreferences",
@@ -1366,6 +1395,39 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
SCREENMAN->MiniMenu( &g_CourseMode, SM_BackFromCourseModeMenu ); SCREENMAN->MiniMenu( &g_CourseMode, SM_BackFromCourseModeMenu );
break; break;
} }
case EDIT_BUTTON_NEW_BAKED_RANDOM_FILE_FOR_BGCHANGE:
{
if( GetOneBakedRandomFile(m_pSong).empty() )
{
SCREENMAN->PlayInvalidSound();
SCREENMAN->SystemMessage( "No backgrounds available" );
}
else
{
bool bAlreadyBGChangeHere = false;
BackgroundLayer iLayer = BACKGROUND_LAYER_1;
BackgroundChange bgChange;
bgChange.m_fStartBeat = GAMESTATE->m_fSongBeat;
FOREACH_BackgroundLayer( l )
{
FOREACH( BackgroundChange, m_pSong->GetBackgroundChanges(l), bgc )
{
if( bgc->m_fStartBeat == GAMESTATE->m_fSongBeat )
{
bAlreadyBGChangeHere = true;
iLayer = l;
bgChange = *bgc;
m_pSong->GetBackgroundChanges(iLayer).erase( bgc );
}
}
}
bgChange.m_def.m_sFile1 = GetOneBakedRandomFile( m_pSong );
m_pSong->AddBackgroundChange( iLayer, bgChange );
m_soundMarker.Play();
}
}
break;
case EDIT_BUTTON_PLAY_FROM_START: case EDIT_BUTTON_PLAY_FROM_START:
HandleMainMenuChoice( play_whole_song ); HandleMainMenuChoice( play_whole_song );
break; break;
@@ -2066,15 +2128,19 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector<int> &iAns
BackgroundUtil::GetSongBGAnimations( m_pSong, "", vThrowAway, g_BackgroundChange.rows[file1_song_bganimation].choices ); BackgroundUtil::GetSongBGAnimations( m_pSong, "", vThrowAway, g_BackgroundChange.rows[file1_song_bganimation].choices );
BackgroundUtil::GetSongMovies( m_pSong, "", vThrowAway, g_BackgroundChange.rows[file1_song_movie].choices ); BackgroundUtil::GetSongMovies( m_pSong, "", vThrowAway, g_BackgroundChange.rows[file1_song_movie].choices );
BackgroundUtil::GetSongBitmaps( m_pSong, "", vThrowAway, g_BackgroundChange.rows[file1_song_still].choices ); BackgroundUtil::GetSongBitmaps( m_pSong, "", vThrowAway, g_BackgroundChange.rows[file1_song_still].choices );
BackgroundUtil::GetGlobalBGAnimations( NULL, "", vThrowAway, g_BackgroundChange.rows[file1_global_bganimation].choices ); // NULL to get all background files BackgroundUtil::GetGlobalBGAnimations( m_pSong, "", vThrowAway, g_BackgroundChange.rows[file1_global_bganimation].choices ); // NULL to get all background files
BackgroundUtil::GetGlobalRandomMovies( NULL, "", vThrowAway, g_BackgroundChange.rows[file1_global_random_movie].choices ); // NULL to get all background files BackgroundUtil::GetGlobalRandomMovies( m_pSong, "", vThrowAway, g_BackgroundChange.rows[file1_global_movie].choices, false, false ); // all backgrounds
BackgroundUtil::GetGlobalRandomMovies( m_pSong, "", vThrowAway, g_BackgroundChange.rows[file1_global_movie_song_group].choices, false, true ); // song group's backgrounds
BackgroundUtil::GetGlobalRandomMovies( m_pSong, "", vThrowAway, g_BackgroundChange.rows[file1_global_movie_song_group_and_genre].choices, true, true ); // song group and genre's backgrounds
g_BackgroundChange.rows[file2_type].choices = g_BackgroundChange.rows[file1_type].choices; g_BackgroundChange.rows[file2_type].choices = g_BackgroundChange.rows[file1_type].choices;
g_BackgroundChange.rows[file2_song_bganimation].choices = g_BackgroundChange.rows[file1_song_bganimation].choices; g_BackgroundChange.rows[file2_song_bganimation].choices = g_BackgroundChange.rows[file1_song_bganimation].choices;
g_BackgroundChange.rows[file2_song_movie].choices = g_BackgroundChange.rows[file1_song_movie].choices; g_BackgroundChange.rows[file2_song_movie].choices = g_BackgroundChange.rows[file1_song_movie].choices;
g_BackgroundChange.rows[file2_song_still].choices = g_BackgroundChange.rows[file1_song_still].choices; g_BackgroundChange.rows[file2_song_still].choices = g_BackgroundChange.rows[file1_song_still].choices;
g_BackgroundChange.rows[file2_global_random_movie].choices = g_BackgroundChange.rows[file1_global_random_movie].choices;
g_BackgroundChange.rows[file2_global_bganimation].choices = g_BackgroundChange.rows[file1_global_bganimation].choices; g_BackgroundChange.rows[file2_global_bganimation].choices = g_BackgroundChange.rows[file1_global_bganimation].choices;
g_BackgroundChange.rows[file2_global_movie].choices = g_BackgroundChange.rows[file1_global_movie].choices;
g_BackgroundChange.rows[file2_global_movie_song_group].choices = g_BackgroundChange.rows[file1_global_movie_song_group].choices;
g_BackgroundChange.rows[file2_global_movie_song_group_and_genre].choices= g_BackgroundChange.rows[file1_global_movie_song_group_and_genre].choices;
// //
@@ -2102,13 +2168,17 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector<int> &iAns
FILL_ENABLED( file1_song_bganimation ); FILL_ENABLED( file1_song_bganimation );
FILL_ENABLED( file1_song_movie ); FILL_ENABLED( file1_song_movie );
FILL_ENABLED( file1_song_still ); FILL_ENABLED( file1_song_still );
FILL_ENABLED( file1_global_random_movie );
FILL_ENABLED( file1_global_bganimation ); FILL_ENABLED( file1_global_bganimation );
FILL_ENABLED( file1_global_movie );
FILL_ENABLED( file1_global_movie_song_group );
FILL_ENABLED( file1_global_movie_song_group_and_genre );
FILL_ENABLED( file2_song_bganimation ); FILL_ENABLED( file2_song_bganimation );
FILL_ENABLED( file2_song_movie ); FILL_ENABLED( file2_song_movie );
FILL_ENABLED( file2_song_still ); FILL_ENABLED( file2_song_still );
FILL_ENABLED( file2_global_random_movie );
FILL_ENABLED( file2_global_bganimation ); FILL_ENABLED( file2_global_bganimation );
FILL_ENABLED( file2_global_movie );
FILL_ENABLED( file2_global_movie_song_group );
FILL_ENABLED( file2_global_movie_song_group_and_genre );
#undef FILL_ENABLED #undef FILL_ENABLED
g_BackgroundChange.rows[delete_change].bEnabled = bAlreadyBGChangeHere; g_BackgroundChange.rows[delete_change].bEnabled = bAlreadyBGChangeHere;
@@ -2119,20 +2189,23 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector<int> &iAns
g_BackgroundChange.rows[transition]. SetDefaultChoiceIfPresent( bgChange.m_sTransition ); g_BackgroundChange.rows[transition]. SetDefaultChoiceIfPresent( bgChange.m_sTransition );
g_BackgroundChange.rows[effect]. SetDefaultChoiceIfPresent( bgChange.m_def.m_sEffect ); g_BackgroundChange.rows[effect]. SetDefaultChoiceIfPresent( bgChange.m_def.m_sEffect );
g_BackgroundChange.rows[file1_type].iDefaultChoice = none; g_BackgroundChange.rows[file1_type].iDefaultChoice = none;
if( bgChange.m_def.m_sFile1 == RANDOM_BACKGROUND_FILE ) g_BackgroundChange.rows[file1_type].iDefaultChoice = pick_random; if( bgChange.m_def.m_sFile1 == RANDOM_BACKGROUND_FILE ) g_BackgroundChange.rows[file1_type].iDefaultChoice = dynamic_random;
if( g_BackgroundChange.rows[file1_song_bganimation]. SetDefaultChoiceIfPresent( bgChange.m_def.m_sFile1 ) ) g_BackgroundChange.rows[file1_type].iDefaultChoice = song_bganimation; if( g_BackgroundChange.rows[file1_song_bganimation]. SetDefaultChoiceIfPresent( bgChange.m_def.m_sFile1 ) ) g_BackgroundChange.rows[file1_type].iDefaultChoice = song_bganimation;
if( g_BackgroundChange.rows[file1_song_movie]. SetDefaultChoiceIfPresent( bgChange.m_def.m_sFile1 ) ) g_BackgroundChange.rows[file1_type].iDefaultChoice = song_movie; if( g_BackgroundChange.rows[file1_song_movie]. SetDefaultChoiceIfPresent( bgChange.m_def.m_sFile1 ) ) g_BackgroundChange.rows[file1_type].iDefaultChoice = song_movie;
if( g_BackgroundChange.rows[file1_song_still]. SetDefaultChoiceIfPresent( bgChange.m_def.m_sFile1 ) ) g_BackgroundChange.rows[file1_type].iDefaultChoice = song_bitmap; if( g_BackgroundChange.rows[file1_song_still]. SetDefaultChoiceIfPresent( bgChange.m_def.m_sFile1 ) ) g_BackgroundChange.rows[file1_type].iDefaultChoice = song_bitmap;
if( g_BackgroundChange.rows[file1_global_bganimation]. SetDefaultChoiceIfPresent( bgChange.m_def.m_sFile1 ) ) g_BackgroundChange.rows[file1_type].iDefaultChoice = global_bganimation; if( g_BackgroundChange.rows[file1_global_bganimation]. SetDefaultChoiceIfPresent( bgChange.m_def.m_sFile1 ) ) g_BackgroundChange.rows[file1_type].iDefaultChoice = global_bganimation;
if( g_BackgroundChange.rows[file1_global_random_movie]. SetDefaultChoiceIfPresent( bgChange.m_def.m_sFile1 ) ) g_BackgroundChange.rows[file1_type].iDefaultChoice = global_movie; if( g_BackgroundChange.rows[file1_global_movie]. SetDefaultChoiceIfPresent( bgChange.m_def.m_sFile1 ) ) g_BackgroundChange.rows[file1_type].iDefaultChoice = global_movie;
if( g_BackgroundChange.rows[file1_global_movie_song_group]. SetDefaultChoiceIfPresent( bgChange.m_def.m_sFile1 ) ) g_BackgroundChange.rows[file1_type].iDefaultChoice = global_movie_song_group;
if( g_BackgroundChange.rows[file1_global_movie_song_group_and_genre]. SetDefaultChoiceIfPresent( bgChange.m_def.m_sFile1 ) ) g_BackgroundChange.rows[file1_type].iDefaultChoice = global_movie_song_group_and_genre;
g_BackgroundChange.rows[file2_type].iDefaultChoice = none; g_BackgroundChange.rows[file2_type].iDefaultChoice = none;
if( bgChange.m_def.m_sFile2 == RANDOM_BACKGROUND_FILE ) g_BackgroundChange.rows[file2_type].iDefaultChoice = pick_random; if( bgChange.m_def.m_sFile2 == RANDOM_BACKGROUND_FILE ) g_BackgroundChange.rows[file2_type].iDefaultChoice = dynamic_random;
if( g_BackgroundChange.rows[file2_song_bganimation]. SetDefaultChoiceIfPresent( bgChange.m_def.m_sFile2 ) ) g_BackgroundChange.rows[file2_type].iDefaultChoice = song_bganimation; if( g_BackgroundChange.rows[file2_song_bganimation]. SetDefaultChoiceIfPresent( bgChange.m_def.m_sFile2 ) ) g_BackgroundChange.rows[file2_type].iDefaultChoice = song_bganimation;
if( g_BackgroundChange.rows[file2_song_movie]. SetDefaultChoiceIfPresent( bgChange.m_def.m_sFile2 ) ) g_BackgroundChange.rows[file2_type].iDefaultChoice = song_movie; if( g_BackgroundChange.rows[file2_song_movie]. SetDefaultChoiceIfPresent( bgChange.m_def.m_sFile2 ) ) g_BackgroundChange.rows[file2_type].iDefaultChoice = song_movie;
if( g_BackgroundChange.rows[file2_song_still]. SetDefaultChoiceIfPresent( bgChange.m_def.m_sFile2 ) ) g_BackgroundChange.rows[file2_type].iDefaultChoice = song_bitmap; if( g_BackgroundChange.rows[file2_song_still]. SetDefaultChoiceIfPresent( bgChange.m_def.m_sFile2 ) ) g_BackgroundChange.rows[file2_type].iDefaultChoice = song_bitmap;
if( g_BackgroundChange.rows[file2_global_bganimation]. SetDefaultChoiceIfPresent( bgChange.m_def.m_sFile2 ) ) g_BackgroundChange.rows[file2_type].iDefaultChoice = global_bganimation; if( g_BackgroundChange.rows[file2_global_bganimation]. SetDefaultChoiceIfPresent( bgChange.m_def.m_sFile2 ) ) g_BackgroundChange.rows[file2_type].iDefaultChoice = global_bganimation;
if( g_BackgroundChange.rows[file2_global_random_movie]. SetDefaultChoiceIfPresent( bgChange.m_def.m_sFile2 ) ) g_BackgroundChange.rows[file2_type].iDefaultChoice = global_movie; if( g_BackgroundChange.rows[file2_global_movie]. SetDefaultChoiceIfPresent( bgChange.m_def.m_sFile2 ) ) g_BackgroundChange.rows[file2_type].iDefaultChoice = global_movie;
if( g_BackgroundChange.rows[file2_global_movie_song_group]. SetDefaultChoiceIfPresent( bgChange.m_def.m_sFile2 ) ) g_BackgroundChange.rows[file2_type].iDefaultChoice = global_movie_song_group;
if( g_BackgroundChange.rows[file2_global_movie_song_group_and_genre]. SetDefaultChoiceIfPresent( bgChange.m_def.m_sFile2 ) ) g_BackgroundChange.rows[file2_type].iDefaultChoice = global_movie_song_group_and_genre;
SCREENMAN->MiniMenu( &g_BackgroundChange, SM_BackFromBGChange ); SCREENMAN->MiniMenu( &g_BackgroundChange, SM_BackFromBGChange );
} }
@@ -2668,14 +2741,17 @@ void ScreenEdit::HandleBGChangeChoice( BGChangeChoice c, const vector<int> &iAns
{ {
default: ASSERT(0); default: ASSERT(0);
case none: newChange.m_def.m_sFile1 = ""; break; case none: newChange.m_def.m_sFile1 = ""; break;
case pick_random: newChange.m_def.m_sFile1 = RANDOM_BACKGROUND_FILE; break; case dynamic_random: newChange.m_def.m_sFile1 = RANDOM_BACKGROUND_FILE; break;
case baked_random: newChange.m_def.m_sFile1 = GetOneBakedRandomFile( m_pSong ); break;
case song_bganimation: case song_bganimation:
case song_movie: case song_movie:
case song_bitmap: case song_bitmap:
case global_bganimation: case global_bganimation:
case global_movie: case global_movie:
case global_movie_song_group:
case global_movie_song_group_and_genre:
{ {
BGChangeChoice row1 = (BGChangeChoice)(file1_song_bganimation + iAnswers[file1_type]-2); BGChangeChoice row1 = (BGChangeChoice)(file1_song_bganimation + iAnswers[file1_type]);
newChange.m_def.m_sFile1 = g_BackgroundChange.rows[row1].choices[iAnswers[row1]]; newChange.m_def.m_sFile1 = g_BackgroundChange.rows[row1].choices[iAnswers[row1]];
} }
break; break;
@@ -2684,14 +2760,17 @@ void ScreenEdit::HandleBGChangeChoice( BGChangeChoice c, const vector<int> &iAns
{ {
default: ASSERT(0); default: ASSERT(0);
case none: newChange.m_def.m_sFile2 = ""; break; case none: newChange.m_def.m_sFile2 = ""; break;
case pick_random: newChange.m_def.m_sFile2 = RANDOM_BACKGROUND_FILE; break; case dynamic_random: newChange.m_def.m_sFile2 = RANDOM_BACKGROUND_FILE; break;
case baked_random: newChange.m_def.m_sFile2 = GetOneBakedRandomFile( m_pSong ); break;
case song_bganimation: case song_bganimation:
case song_movie: case song_movie:
case song_bitmap: case song_bitmap:
case global_bganimation: case global_bganimation:
case global_movie: case global_movie:
case global_movie_song_group:
case global_movie_song_group_and_genre:
{ {
BGChangeChoice row2 = (BGChangeChoice)(file2_song_bganimation + iAnswers[file2_type]-2); BGChangeChoice row2 = (BGChangeChoice)(file2_song_bganimation + iAnswers[file2_type]);
newChange.m_def.m_sFile2 = g_BackgroundChange.rows[row2].choices[iAnswers[row2]]; newChange.m_def.m_sFile2 = g_BackgroundChange.rows[row2].choices[iAnswers[row2]];
} }
break; break;
+8 -2
View File
@@ -63,6 +63,8 @@ enum EditButton
EDIT_BUTTON_OPEN_COURSE_MENU, EDIT_BUTTON_OPEN_COURSE_MENU,
EDIT_BUTTON_OPEN_INPUT_HELP, EDIT_BUTTON_OPEN_INPUT_HELP,
EDIT_BUTTON_NEW_BAKED_RANDOM_FILE_FOR_BGCHANGE,
EDIT_BUTTON_PLAY_FROM_START, EDIT_BUTTON_PLAY_FROM_START,
EDIT_BUTTON_PLAY_FROM_CURSOR, EDIT_BUTTON_PLAY_FROM_CURSOR,
EDIT_BUTTON_PLAY_SELECTION, EDIT_BUTTON_PLAY_SELECTION,
@@ -373,13 +375,17 @@ public:
file1_song_movie, file1_song_movie,
file1_song_still, file1_song_still,
file1_global_bganimation, file1_global_bganimation,
file1_global_random_movie, file1_global_movie,
file1_global_movie_song_group,
file1_global_movie_song_group_and_genre,
file2_type, file2_type,
file2_song_bganimation, file2_song_bganimation,
file2_song_movie, file2_song_movie,
file2_song_still, file2_song_still,
file2_global_bganimation, file2_global_bganimation,
file2_global_random_movie, file2_global_movie,
file2_global_movie_song_group,
file2_global_movie_song_group_and_genre,
delete_change, delete_change,
NUM_BGCHANGE_CHOICES NUM_BGCHANGE_CHOICES
}; };