Add the note skin pref back in, to change the default skin persistently.
Disable the EX pref; wait to add this until the screen is ready (though it might be better to just make it a metric).
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "ThemeManager.h"
|
||||
#include "RageUtil.h"
|
||||
#include "SongManager.h"
|
||||
#include "NoteSkinManager.h"
|
||||
|
||||
|
||||
GameState* GAMESTATE = NULL; // global and accessable from anywhere in our program
|
||||
@@ -44,7 +45,9 @@ GameState::GameState()
|
||||
{
|
||||
m_CurGame = GAME_DANCE;
|
||||
m_iCoins = 0;
|
||||
Reset();
|
||||
/* Don't reset yet; let the first screen do it, so we can
|
||||
* use PREFSMAN. */
|
||||
// Reset();
|
||||
|
||||
ResetLastRanking();
|
||||
}
|
||||
@@ -87,6 +90,8 @@ void GameState::Reset()
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
m_PlayerOptions[p] = PlayerOptions();
|
||||
m_SongOptions = SongOptions();
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
NOTESKIN->SwitchNoteSkin( PlayerNumber(p), PREFSMAN->m_sDefaultNoteSkin );
|
||||
}
|
||||
|
||||
void GameState::ResetLastRanking()
|
||||
|
||||
@@ -102,6 +102,8 @@ PrefsManager::PrefsManager()
|
||||
m_sSoundDrivers = DEFAULT_SOUND_DRIVER_LIST;
|
||||
m_fSoundVolume = DEFAULT_SOUND_VOLUME;
|
||||
|
||||
m_sDefaultNoteSkin = "default";
|
||||
|
||||
ReadGlobalPrefsFromDisk( true );
|
||||
}
|
||||
|
||||
@@ -273,16 +275,22 @@ void PrefsManager::ReadGamePrefsFromDisk()
|
||||
ini.SetPath( "GamePrefs.ini" );
|
||||
ini.ReadFile(); // it's OK if this fails
|
||||
|
||||
CString sAnnouncer = sGameName, sTheme = sGameName;//, sNoteSkin = sGameName;
|
||||
CString sAnnouncer = sGameName, sTheme = sGameName, sNoteSkin = sGameName;
|
||||
|
||||
// if these calls fail, the three strings will keep the initial values set above.
|
||||
ini.GetValue( sGameName, "Announcer", sAnnouncer );
|
||||
ini.GetValue( sGameName, "Theme", sTheme );
|
||||
// ini.GetValue( sGameName, "NoteSkin", sNoteSkin );
|
||||
ini.GetValue( sGameName, "NoteSkin", sNoteSkin );
|
||||
|
||||
// it's OK to call these functions with names that don't exist.
|
||||
ANNOUNCER->SwitchAnnouncer( sAnnouncer );
|
||||
THEME->SwitchTheme( sTheme );
|
||||
|
||||
if(NOTESKIN->DoesNoteSkinExist(sNoteSkin))
|
||||
m_sDefaultNoteSkin = sNoteSkin;
|
||||
else
|
||||
m_sDefaultNoteSkin = "default";
|
||||
|
||||
// NOTESKIN->SwitchNoteSkin( sNoteSkin );
|
||||
}
|
||||
|
||||
@@ -299,6 +307,7 @@ void PrefsManager::SaveGamePrefsToDisk()
|
||||
ini.SetValue( sGameName, "Announcer", ANNOUNCER->GetCurAnnouncerName() );
|
||||
ini.SetValue( sGameName, "Theme", THEME->GetCurThemeName() );
|
||||
// ini.SetValue( sGameName, "NoteSkin", NOTESKIN->GetCurNoteSkinName() );
|
||||
ini.SetValue( sGameName, "NoteSkin", m_sDefaultNoteSkin );
|
||||
|
||||
ini.WriteFile();
|
||||
}
|
||||
|
||||
@@ -83,6 +83,9 @@ public:
|
||||
CString m_sSoundDrivers;
|
||||
float m_fSoundVolume;
|
||||
|
||||
/* Game-specific prefs: */
|
||||
CString m_sDefaultNoteSkin;
|
||||
|
||||
void ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame );
|
||||
void SaveGlobalPrefsToDisk();
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
enum {
|
||||
AO_ANNOUNCER = 0,
|
||||
AO_THEME,
|
||||
AO_DIFF_SELECT,
|
||||
// AO_SKIN,
|
||||
// AO_DIFF_SELECT,
|
||||
AO_SKIN,
|
||||
AO_INSTRUCTIONS,
|
||||
AO_CAUTION,
|
||||
AO_SELECT_GROUP,
|
||||
@@ -42,8 +42,8 @@ enum {
|
||||
OptionRowData g_AppearanceOptionsLines[NUM_APPEARANCE_OPTIONS_LINES] = {
|
||||
{ "Announcer", 1, {"OFF"} }, // fill this in on ImportOptions()
|
||||
{ "Theme", 0, {""} }, // fill this in on ImportOptions()
|
||||
{ "Difficulty\nSelect", 2, {"DDR Extreme", "Normal"} },
|
||||
// { "Note\nSkin", 0, {""} }, // fill this in on ImportOptions()
|
||||
// { "Difficulty\nSelect", 2, {"DDR Extreme", "Normal"} },
|
||||
{ "Note\nSkin", 0, {""} }, // fill this in on ImportOptions()
|
||||
{ "How To\nPlay", 2, {"SKIP","SHOW"} },
|
||||
{ "Caution", 2, {"SKIP","SHOW"} },
|
||||
{ "Song\nGroup", 2, {"ALL MUSIC","CHOOSE"} },
|
||||
@@ -133,9 +133,33 @@ void ScreenAppearanceOptions::ImportOptions()
|
||||
if( m_iSelectedOption[0][AO_THEME] == -1 )
|
||||
m_iSelectedOption[0][AO_THEME] = 0;
|
||||
|
||||
//
|
||||
// fill in skin names
|
||||
//
|
||||
CStringArray arraySkinNames;
|
||||
NOTESKIN->GetNoteSkinNames( arraySkinNames );
|
||||
|
||||
m_OptionRowData[AO_SKIN].iNumOptions = arraySkinNames.size();
|
||||
|
||||
for( i=0; i<arraySkinNames.size(); i++ )
|
||||
strcpy( m_OptionRowData[AO_SKIN].szOptionsText[i], arraySkinNames[i] );
|
||||
|
||||
// highlight currently selected skin
|
||||
m_iSelectedOption[0][AO_SKIN] = -1;
|
||||
for( i=0; i<m_OptionRowData[AO_SKIN].iNumOptions; i++ )
|
||||
{
|
||||
if( 0==stricmp(m_OptionRowData[AO_SKIN].szOptionsText[i], PREFSMAN->m_sDefaultNoteSkin) )
|
||||
{
|
||||
m_iSelectedOption[0][AO_SKIN] = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( m_iSelectedOption[0][AO_SKIN] == -1 )
|
||||
m_iSelectedOption[0][AO_SKIN] = 0;
|
||||
|
||||
m_iSelectedOption[0][AO_INSTRUCTIONS] = PREFSMAN->m_bInstructions? 1:0;
|
||||
m_iSelectedOption[0][AO_CAUTION] = PREFSMAN->m_bShowDontDie? 1:0;
|
||||
m_iSelectedOption[0][AO_DIFF_SELECT] = PREFSMAN->m_bDDRExtremeDifficultySelect? 1:0;
|
||||
// m_iSelectedOption[0][AO_DIFF_SELECT] = PREFSMAN->m_bDDRExtremeDifficultySelect? 1:0;
|
||||
m_iSelectedOption[0][AO_SELECT_GROUP] = PREFSMAN->m_bShowSelectGroup? 1:0;
|
||||
m_iSelectedOption[0][AO_WHEEL_SECTIONS] = (int)PREFSMAN->m_MusicWheelUsesSections;
|
||||
m_iSelectedOption[0][AO_SHOW_TRANSLATIONS] = PREFSMAN->m_bShowTranslations;
|
||||
@@ -156,7 +180,11 @@ void ScreenAppearanceOptions::ExportOptions()
|
||||
CString sNewTheme = m_OptionRowData[AO_THEME].szOptionsText[iSelectedTheme];
|
||||
THEME->SwitchTheme( sNewTheme );
|
||||
|
||||
PREFSMAN->m_bDDRExtremeDifficultySelect = !!m_iSelectedOption[0][AO_DIFF_SELECT];
|
||||
int iSelectedSkin = m_iSelectedOption[0][AO_SKIN];
|
||||
CString sNewSkin = m_OptionRowData[AO_SKIN].szOptionsText[iSelectedSkin];
|
||||
|
||||
PREFSMAN->m_sDefaultNoteSkin = sNewSkin;
|
||||
// PREFSMAN->m_bDDRExtremeDifficultySelect = !!m_iSelectedOption[0][AO_DIFF_SELECT];
|
||||
PREFSMAN->m_bInstructions = !!m_iSelectedOption[0][AO_INSTRUCTIONS];
|
||||
PREFSMAN->m_bShowDontDie = !!m_iSelectedOption[0][AO_CAUTION];
|
||||
PREFSMAN->m_bShowSelectGroup = !!m_iSelectedOption[0][AO_SELECT_GROUP];
|
||||
|
||||
Reference in New Issue
Block a user