diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index baf045da16..71d1fbd556 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -3073,6 +3073,7 @@ RandomVanish= // with other song select. SaveScreenshot=MenuLeft-MenuRight-Start CancelAllPlayerOptions= +SavePlayerOptions= [GrooveRadar] Label1OffsetX=0 // stream diff --git a/stepmania/src/CodeDetector.cpp b/stepmania/src/CodeDetector.cpp index e693dec5ba..94501c8d3f 100644 --- a/stepmania/src/CodeDetector.cpp +++ b/stepmania/src/CodeDetector.cpp @@ -64,6 +64,7 @@ const CString g_sCodeNames[CodeDetector::NUM_CODES] = { "NextBannerGroup2", "SaveScreenshot", "CancelAllPlayerOptions", + "SavePlayerOptions", }; CodeItem g_CodeItems[CodeDetector::NUM_CODES]; diff --git a/stepmania/src/CodeDetector.h b/stepmania/src/CodeDetector.h index e5e73be36d..051821f834 100644 --- a/stepmania/src/CodeDetector.h +++ b/stepmania/src/CodeDetector.h @@ -76,6 +76,7 @@ public: CODE_BW_NEXT_GROUP2, CODE_SAVE_SCREENSHOT, CODE_CANCEL_ALL_PLAYER_OPTIONS, + CODE_SAVE_PLAYER_OPTIONS, NUM_CODES // leave this at the end }; diff --git a/stepmania/src/ProfileManager.cpp b/stepmania/src/ProfileManager.cpp index 00db447c4d..decaa9c95d 100644 --- a/stepmania/src/ProfileManager.cpp +++ b/stepmania/src/ProfileManager.cpp @@ -219,6 +219,8 @@ void ProfileManager::UnloadProfile( PlayerNumber pn ) const Profile* ProfileManager::GetProfile( PlayerNumber pn ) const { + ASSERT( pn >= 0 && pnGetMetric ("ScreenPlayerOptions","PrevScreen"+Capitalize(PlayModeToString(play_mode))) @@ -109,15 +110,29 @@ void ScreenPlayerOptions::Input( const DeviceInput& DeviceI, const InputEventTyp } } - if( CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_CANCEL_ALL) ) + PlayerNumber pn = StyleI.player; + + if( CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_CANCEL_ALL_PLAYER_OPTIONS) ) { SOUND->PlayOnce( THEME->GetPathToS("ScreenPlayerOptions cancel all") ); - GAMESTATE->m_PlayerOptions[MenuI.player].Init(); - GAMESTATE->m_PlayerOptions[MenuI.player].FromString( PREFSMAN->m_sDefaultModifiers ); + GAMESTATE->m_PlayerOptions[pn].Init(); + GAMESTATE->m_PlayerOptions[pn].FromString( PREFSMAN->m_sDefaultModifiers ); this->ImportOptions(); this->PositionUnderlines(); } + if( CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_SAVE_PLAYER_OPTIONS) ) + { + if( PROFILEMAN->IsUsingProfile(pn) ) + { + SOUND->PlayOnce( THEME->GetPathToS("ScreenPlayerOptions save") ); + this->ExportOptions(); + Profile* pProfile = PROFILEMAN->GetProfile(pn); + pProfile->m_bUsingProfileDefaultModifiers = true; + pProfile->m_sDefaultModifiers = GAMESTATE->m_PlayerOptions[pn].GetString(); + } + } + ScreenOptionsMaster::Input( DeviceI, type, GameI, MenuI, StyleI ); }