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
+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 );
}