add SaveModifiers code for PlayerOptions screen
This commit is contained in:
@@ -3073,6 +3073,7 @@ RandomVanish=
|
|||||||
// with other song select.
|
// with other song select.
|
||||||
SaveScreenshot=MenuLeft-MenuRight-Start
|
SaveScreenshot=MenuLeft-MenuRight-Start
|
||||||
CancelAllPlayerOptions=
|
CancelAllPlayerOptions=
|
||||||
|
SavePlayerOptions=
|
||||||
|
|
||||||
[GrooveRadar]
|
[GrooveRadar]
|
||||||
Label1OffsetX=0 // stream
|
Label1OffsetX=0 // stream
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ const CString g_sCodeNames[CodeDetector::NUM_CODES] = {
|
|||||||
"NextBannerGroup2",
|
"NextBannerGroup2",
|
||||||
"SaveScreenshot",
|
"SaveScreenshot",
|
||||||
"CancelAllPlayerOptions",
|
"CancelAllPlayerOptions",
|
||||||
|
"SavePlayerOptions",
|
||||||
};
|
};
|
||||||
|
|
||||||
CodeItem g_CodeItems[CodeDetector::NUM_CODES];
|
CodeItem g_CodeItems[CodeDetector::NUM_CODES];
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ public:
|
|||||||
CODE_BW_NEXT_GROUP2,
|
CODE_BW_NEXT_GROUP2,
|
||||||
CODE_SAVE_SCREENSHOT,
|
CODE_SAVE_SCREENSHOT,
|
||||||
CODE_CANCEL_ALL_PLAYER_OPTIONS,
|
CODE_CANCEL_ALL_PLAYER_OPTIONS,
|
||||||
|
CODE_SAVE_PLAYER_OPTIONS,
|
||||||
NUM_CODES // leave this at the end
|
NUM_CODES // leave this at the end
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -219,6 +219,8 @@ void ProfileManager::UnloadProfile( PlayerNumber pn )
|
|||||||
|
|
||||||
const Profile* ProfileManager::GetProfile( PlayerNumber pn ) const
|
const Profile* ProfileManager::GetProfile( PlayerNumber pn ) const
|
||||||
{
|
{
|
||||||
|
ASSERT( pn >= 0 && pn<NUM_PLAYERS );
|
||||||
|
|
||||||
if( m_sProfileDir[pn].empty() )
|
if( m_sProfileDir[pn].empty() )
|
||||||
return NULL;
|
return NULL;
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#include "ScreenSongOptions.h"
|
#include "ScreenSongOptions.h"
|
||||||
#include "PrefsManager.h"
|
#include "PrefsManager.h"
|
||||||
#include "CodeDetector.h"
|
#include "CodeDetector.h"
|
||||||
|
#include "ProfileManager.h"
|
||||||
|
|
||||||
|
|
||||||
#define PREV_SCREEN( play_mode ) THEME->GetMetric ("ScreenPlayerOptions","PrevScreen"+Capitalize(PlayModeToString(play_mode)))
|
#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") );
|
SOUND->PlayOnce( THEME->GetPathToS("ScreenPlayerOptions cancel all") );
|
||||||
GAMESTATE->m_PlayerOptions[MenuI.player].Init();
|
GAMESTATE->m_PlayerOptions[pn].Init();
|
||||||
GAMESTATE->m_PlayerOptions[MenuI.player].FromString( PREFSMAN->m_sDefaultModifiers );
|
GAMESTATE->m_PlayerOptions[pn].FromString( PREFSMAN->m_sDefaultModifiers );
|
||||||
this->ImportOptions();
|
this->ImportOptions();
|
||||||
this->PositionUnderlines();
|
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 );
|
ScreenOptionsMaster::Input( DeviceI, type, GameI, MenuI, StyleI );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user