From e8f3886d2c63ea3cf079befb46c908af3a985321 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Mon, 23 Feb 2004 07:44:57 +0000 Subject: [PATCH] add "CancelAll" code for PlayerOptions screen --- stepmania/Themes/default/metrics.ini | 1 + stepmania/src/CodeDetector.cpp | 3 ++- stepmania/src/CodeDetector.h | 1 + stepmania/src/ScreenPlayerOptions.cpp | 10 ++++++++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index b679e3b157..baf045da16 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -3072,6 +3072,7 @@ RandomVanish= // next banner group is used only in the banner song select, doesnt interfere // with other song select. SaveScreenshot=MenuLeft-MenuRight-Start +CancelAllPlayerOptions= [GrooveRadar] Label1OffsetX=0 // stream diff --git a/stepmania/src/CodeDetector.cpp b/stepmania/src/CodeDetector.cpp index 60366347ec..e693dec5ba 100644 --- a/stepmania/src/CodeDetector.cpp +++ b/stepmania/src/CodeDetector.cpp @@ -62,7 +62,8 @@ const CString g_sCodeNames[CodeDetector::NUM_CODES] = { "NextGame2", "NextBannerGroup", "NextBannerGroup2", - "SaveScreenshot" + "SaveScreenshot", + "CancelAllPlayerOptions", }; CodeItem g_CodeItems[CodeDetector::NUM_CODES]; diff --git a/stepmania/src/CodeDetector.h b/stepmania/src/CodeDetector.h index 868c9b68bc..e5e73be36d 100644 --- a/stepmania/src/CodeDetector.h +++ b/stepmania/src/CodeDetector.h @@ -75,6 +75,7 @@ public: CODE_BW_NEXT_GROUP, CODE_BW_NEXT_GROUP2, CODE_SAVE_SCREENSHOT, + CODE_CANCEL_ALL_PLAYER_OPTIONS, NUM_CODES // leave this at the end }; diff --git a/stepmania/src/ScreenPlayerOptions.cpp b/stepmania/src/ScreenPlayerOptions.cpp index de24cb9caa..f046355cde 100644 --- a/stepmania/src/ScreenPlayerOptions.cpp +++ b/stepmania/src/ScreenPlayerOptions.cpp @@ -17,6 +17,7 @@ #include "RageSounds.h" #include "ScreenSongOptions.h" #include "PrefsManager.h" +#include "CodeDetector.h" #define PREV_SCREEN( play_mode ) THEME->GetMetric ("ScreenPlayerOptions","PrevScreen"+Capitalize(PlayModeToString(play_mode))) @@ -108,6 +109,15 @@ void ScreenPlayerOptions::Input( const DeviceInput& DeviceI, const InputEventTyp } } + if( CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_CANCEL_ALL) ) + { + SOUND->PlayOnce( THEME->GetPathToS("ScreenPlayerOptions cancel all") ); + GAMESTATE->m_PlayerOptions[MenuI.player].Init(); + GAMESTATE->m_PlayerOptions[MenuI.player].FromString( PREFSMAN->m_sDefaultModifiers ); + this->ImportOptions(); + this->PositionUnderlines(); + } + ScreenOptionsMaster::Input( DeviceI, type, GameI, MenuI, StyleI ); }