add SaveModifiers code for PlayerOptions screen

This commit is contained in:
Chris Danford
2004-02-23 08:16:40 +00:00
parent 9e3437e9f7
commit e183e3b706
5 changed files with 23 additions and 3 deletions
+1
View File
@@ -3073,6 +3073,7 @@ RandomVanish=
// with other song select.
SaveScreenshot=MenuLeft-MenuRight-Start
CancelAllPlayerOptions=
SavePlayerOptions=
[GrooveRadar]
Label1OffsetX=0 // stream
+1
View File
@@ -64,6 +64,7 @@ const CString g_sCodeNames[CodeDetector::NUM_CODES] = {
"NextBannerGroup2",
"SaveScreenshot",
"CancelAllPlayerOptions",
"SavePlayerOptions",
};
CodeItem g_CodeItems[CodeDetector::NUM_CODES];
+1
View File
@@ -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
};
+2
View File
@@ -219,6 +219,8 @@ void ProfileManager::UnloadProfile( PlayerNumber pn )
const Profile* ProfileManager::GetProfile( PlayerNumber pn ) const
{
ASSERT( pn >= 0 && pn<NUM_PLAYERS );
if( m_sProfileDir[pn].empty() )
return NULL;
else
+18 -3
View File
@@ -18,6 +18,7 @@
#include "ScreenSongOptions.h"
#include "PrefsManager.h"
#include "CodeDetector.h"
#include "ProfileManager.h"
#define PREV_SCREEN( play_mode ) THEME->GetMetric ("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 );
}