standard enums for some preference types

This commit is contained in:
Glenn Maynard
2006-10-07 05:52:45 +00:00
parent 1bd59aef01
commit 0493bc75a9
8 changed files with 62 additions and 25 deletions
+3 -3
View File
@@ -1232,9 +1232,9 @@ bool GameState::ShowW1() const
{ {
switch( PREFSMAN->m_AllowW1 ) switch( PREFSMAN->m_AllowW1 )
{ {
case PrefsManager::ALLOW_W1_NEVER: return false; case ALLOW_W1_NEVER: return false;
case PrefsManager::ALLOW_W1_COURSES_ONLY: return IsCourseMode(); case ALLOW_W1_COURSES_ONLY: return IsCourseMode();
case PrefsManager::ALLOW_W1_EVERYWHERE: return true; case ALLOW_W1_EVERYWHERE: return true;
default: ASSERT(0); default: ASSERT(0);
} }
} }
+2 -2
View File
@@ -489,10 +489,10 @@ void MusicWheel::BuildWheelItemDatas( vector<WheelItemData *> &arrayWheelItemDat
switch( PREFSMAN->m_MusicWheelUsesSections ) switch( PREFSMAN->m_MusicWheelUsesSections )
{ {
case PrefsManager::NEVER: case MusicWheelUsesSections_NEVER:
bUseSections = false; bUseSections = false;
break; break;
case PrefsManager::ABC_ONLY: case MusicWheelUsesSections_ABC_ONLY:
if( so != SORT_TITLE && so != SORT_GROUP ) if( so != SORT_TITLE && so != SORT_GROUP )
bUseSections = false; bUseSections = false;
break; break;
+38 -2
View File
@@ -46,6 +46,42 @@ static const char *ScoreEventNames[] = {
XToString( ScoreEvent, NUM_ScoreEvent ); XToString( ScoreEvent, NUM_ScoreEvent );
static const char *MusicWheelUsesSectionsNames[] = {
"Never",
"Always",
"ABCOnly",
};
XToString2( MusicWheelUsesSections );
StringToX( MusicWheelUsesSections );
LuaXType( MusicWheelUsesSections );
static const char *AllowW1Names[] = {
"Never",
"CoursesOnly",
"Everywhere",
};
XToString2( AllowW1 );
StringToX( AllowW1 );
LuaXType( AllowW1 );
static const char *MaybeNames[] = {
"Ask",
"No",
"Yes",
};
XToString2( Maybe );
StringToX( Maybe );
LuaXType( Maybe );
static const char *GetRankingNameNames[] = {
"Off",
"On",
"List",
};
XToString2( GetRankingName );
StringToX( GetRankingName );
LuaXType( GetRankingName );
bool g_bAutoRestart = false; bool g_bAutoRestart = false;
#ifdef DEBUG #ifdef DEBUG
# define TRUE_IF_DEBUG true # define TRUE_IF_DEBUG true
@@ -238,7 +274,7 @@ PrefsManager::PrefsManager() :
m_bShowCaution ( "ShowCaution", true ), m_bShowCaution ( "ShowCaution", true ),
m_bShowNativeLanguage ( "ShowNativeLanguage", true ), m_bShowNativeLanguage ( "ShowNativeLanguage", true ),
m_bArcadeOptionsNavigation ( "ArcadeOptionsNavigation", false ), m_bArcadeOptionsNavigation ( "ArcadeOptionsNavigation", false ),
m_MusicWheelUsesSections ( "MusicWheelUsesSections", ALWAYS ), m_MusicWheelUsesSections ( "MusicWheelUsesSections", MusicWheelUsesSections_ALWAYS ),
m_iMusicWheelSwitchSpeed ( "MusicWheelSwitchSpeed", 10 ), m_iMusicWheelSwitchSpeed ( "MusicWheelSwitchSpeed", 10 ),
m_AllowW1 ( "AllowW1", ALLOW_W1_EVERYWHERE ), m_AllowW1 ( "AllowW1", ALLOW_W1_EVERYWHERE ),
m_bEventMode ( "EventMode", false ), m_bEventMode ( "EventMode", false ),
@@ -251,7 +287,7 @@ PrefsManager::PrefsManager() :
m_bPickExtraStage ( "PickExtraStage", false ), m_bPickExtraStage ( "PickExtraStage", false ),
m_bComboContinuesBetweenSongs ( "ComboContinuesBetweenSongs", false ), m_bComboContinuesBetweenSongs ( "ComboContinuesBetweenSongs", false ),
m_ShowSongOptions ( "ShowSongOptions", YES ), m_ShowSongOptions ( "ShowSongOptions", Maybe_YES ),
m_bDancePointsForOni ( "DancePointsForOni", false ), m_bDancePointsForOni ( "DancePointsForOni", false ),
m_bPercentageScoring ( "PercentageScoring", false ), m_bPercentageScoring ( "PercentageScoring", false ),
m_fMinPercentageForMachineSongHighScore ( "MinPercentageForMachineSongHighScore", 0.5f ), m_fMinPercentageForMachineSongHighScore ( "MinPercentageForMachineSongHighScore", 0.5f ),
+5 -4
View File
@@ -10,6 +10,11 @@ class IniFile;
const int MAX_SONGS_PER_PLAY = 7; const int MAX_SONGS_PER_PLAY = 7;
enum MusicWheelUsesSections { MusicWheelUsesSections_NEVER, MusicWheelUsesSections_ALWAYS, MusicWheelUsesSections_ABC_ONLY, NUM_MusicWheelUsesSections, MusicWheelUsesSections_Invalid };
enum AllowW1 { ALLOW_W1_NEVER, ALLOW_W1_COURSES_ONLY, ALLOW_W1_EVERYWHERE, NUM_AllowW1, AllowW1_Invalid };
enum Maybe { Maybe_ASK, Maybe_NO, Maybe_YES, NUM_Maybe, Maybe_Invalid };
enum GetRankingName { RANKING_OFF, RANKING_ON, RANKING_LIST, NUM_GetRankingName, GetRankingName_Invalid };
class PrefsManager class PrefsManager
{ {
public: public:
@@ -116,10 +121,8 @@ public:
Preference<bool> m_bShowCaution; Preference<bool> m_bShowCaution;
Preference<bool> m_bShowNativeLanguage; Preference<bool> m_bShowNativeLanguage;
Preference<bool> m_bArcadeOptionsNavigation; Preference<bool> m_bArcadeOptionsNavigation;
enum MusicWheelUsesSections { NEVER, ALWAYS, ABC_ONLY };
Preference<MusicWheelUsesSections,int> m_MusicWheelUsesSections; Preference<MusicWheelUsesSections,int> m_MusicWheelUsesSections;
Preference<int> m_iMusicWheelSwitchSpeed; Preference<int> m_iMusicWheelSwitchSpeed;
enum AllowW1 { ALLOW_W1_NEVER, ALLOW_W1_COURSES_ONLY, ALLOW_W1_EVERYWHERE };
Preference<AllowW1,int> m_AllowW1; Preference<AllowW1,int> m_AllowW1;
Preference<bool> m_bEventMode; Preference<bool> m_bEventMode;
Preference<int> m_iCoinsPerCredit; Preference<int> m_iCoinsPerCredit;
@@ -133,7 +136,6 @@ public:
Preference<bool> m_bDelayedCreditsReconcile; Preference<bool> m_bDelayedCreditsReconcile;
Preference<bool> m_bPickExtraStage; Preference<bool> m_bPickExtraStage;
Preference<bool> m_bComboContinuesBetweenSongs; Preference<bool> m_bComboContinuesBetweenSongs;
enum Maybe { ASK = -1, NO = 0, YES = 1 };
Preference<Maybe,int> m_ShowSongOptions; Preference<Maybe,int> m_ShowSongOptions;
Preference<bool> m_bDancePointsForOni; Preference<bool> m_bDancePointsForOni;
Preference<bool> m_bPercentageScoring; Preference<bool> m_bPercentageScoring;
@@ -192,7 +194,6 @@ public:
enum CourseSortOrders { COURSE_SORT_PREFERRED, COURSE_SORT_SONGS, COURSE_SORT_METER, COURSE_SORT_METER_SUM, COURSE_SORT_RANK, NUM_COURSE_SORT_ORDER }; enum CourseSortOrders { COURSE_SORT_PREFERRED, COURSE_SORT_SONGS, COURSE_SORT_METER, COURSE_SORT_METER_SUM, COURSE_SORT_RANK, NUM_COURSE_SORT_ORDER };
Preference<CourseSortOrders,int> m_CourseSortOrder; Preference<CourseSortOrders,int> m_CourseSortOrder;
Preference<bool> m_bSubSortByNumSteps; Preference<bool> m_bSubSortByNumSteps;
enum GetRankingName { RANKING_OFF, RANKING_ON, RANKING_LIST };
Preference<GetRankingName,int> m_GetRankingName; Preference<GetRankingName,int> m_GetRankingName;
enum ScoringType { SCORING_NEW, SCORING_OLD }; enum ScoringType { SCORING_NEW, SCORING_OLD };
+2 -2
View File
@@ -138,8 +138,8 @@ void ScreenNameEntry::Init()
bool IsOnRanking = ( (GAMESTATE->m_PlayMode == PLAY_MODE_NONSTOP || GAMESTATE->m_PlayMode == PLAY_MODE_ONI) bool IsOnRanking = ( (GAMESTATE->m_PlayMode == PLAY_MODE_NONSTOP || GAMESTATE->m_PlayMode == PLAY_MODE_ONI)
&& !(GAMESTATE->m_pCurCourse->IsRanking()) ); && !(GAMESTATE->m_pCurCourse->IsRanking()) );
if( PREFSMAN->m_GetRankingName == PrefsManager::RANKING_OFF || if( PREFSMAN->m_GetRankingName == RANKING_OFF ||
(PREFSMAN->m_GetRankingName == PrefsManager::RANKING_LIST && !IsOnRanking) ) (PREFSMAN->m_GetRankingName == RANKING_LIST && !IsOnRanking) )
{ {
// don't collect score due to ranking setting // don't collect score due to ranking setting
PostScreenMessage( SM_GoToNextScreen, 0 ); PostScreenMessage( SM_GoToNextScreen, 0 );
+8 -8
View File
@@ -305,7 +305,7 @@ static void DefaultNoteSkin( int &sel, bool ToSel, const ConfOption *pConfOption
static void WheelSections( int &sel, bool ToSel, const ConfOption *pConfOption ) static void WheelSections( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const PrefsManager::MusicWheelUsesSections mapping[] = { PrefsManager::NEVER, PrefsManager::ALWAYS, PrefsManager::ABC_ONLY }; const MusicWheelUsesSections mapping[] = { MusicWheelUsesSections_NEVER, MusicWheelUsesSections_ALWAYS, MusicWheelUsesSections_ABC_ONLY };
MoveMap( sel, pConfOption, ToSel, mapping, ARRAYLEN(mapping) ); MoveMap( sel, pConfOption, ToSel, mapping, ARRAYLEN(mapping) );
} }
@@ -348,9 +348,9 @@ static void MusicWheelSwitchSpeed( int &sel, bool ToSel, const ConfOption *pConf
} }
/* Gameplay options */ /* Gameplay options */
static void AllowW1( int &sel, bool ToSel, const ConfOption *pConfOption ) static void AllowW1M( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const PrefsManager::AllowW1 mapping[] = { PrefsManager::ALLOW_W1_NEVER, PrefsManager::ALLOW_W1_COURSES_ONLY, PrefsManager::ALLOW_W1_EVERYWHERE }; const AllowW1 mapping[] = { ALLOW_W1_NEVER, ALLOW_W1_COURSES_ONLY, ALLOW_W1_EVERYWHERE };
MoveMap( sel, pConfOption, ToSel, mapping, ARRAYLEN(mapping) ); MoveMap( sel, pConfOption, ToSel, mapping, ARRAYLEN(mapping) );
} }
@@ -421,13 +421,13 @@ LuaFunction( GetLifeDifficulty, GetLifeDifficulty() );
static void ShowSongOptions( int &sel, bool ToSel, const ConfOption *pConfOption ) static void ShowSongOptions( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const PrefsManager::Maybe mapping[] = { PrefsManager::NO,PrefsManager::YES,PrefsManager::ASK }; const Maybe mapping[] = { Maybe_NO, Maybe_YES, Maybe_ASK };
MoveMap( sel, pConfOption, ToSel, mapping, ARRAYLEN(mapping) ); MoveMap( sel, pConfOption, ToSel, mapping, ARRAYLEN(mapping) );
} }
static void GetRankingName( int &sel, bool ToSel, const ConfOption *pConfOption ) static void GetRankingNameM( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const PrefsManager::GetRankingName mapping[] = { PrefsManager::RANKING_OFF, PrefsManager::RANKING_ON, PrefsManager::RANKING_LIST }; const GetRankingName mapping[] = { RANKING_OFF, RANKING_ON, RANKING_LIST };
MoveMap( sel, pConfOption, ToSel, mapping, ARRAYLEN(mapping) ); MoveMap( sel, pConfOption, ToSel, mapping, ARRAYLEN(mapping) );
} }
@@ -632,7 +632,7 @@ static void InitializeConfOptions()
ADD( ConfOption( "Center1Player", MovePref, "Off","On" ) ); ADD( ConfOption( "Center1Player", MovePref, "Off","On" ) );
ADD( ConfOption( "HiddenSongs", MovePref, "Off","On" ) ); ADD( ConfOption( "HiddenSongs", MovePref, "Off","On" ) );
ADD( ConfOption( "EasterEggs", MovePref, "Off","On" ) ); ADD( ConfOption( "EasterEggs", MovePref, "Off","On" ) );
ADD( ConfOption( "AllowW1", AllowW1, "Never","Courses Only","Always" ) ); ADD( ConfOption( "AllowW1", AllowW1M, "Never","Courses Only","Always" ) );
ADD( ConfOption( "AllowExtraStage", MovePref, "Off","On" ) ); ADD( ConfOption( "AllowExtraStage", MovePref, "Off","On" ) );
ADD( ConfOption( "PickExtraStage", MovePref, "Off","On" ) ); ADD( ConfOption( "PickExtraStage", MovePref, "Off","On" ) );
ADD( ConfOption( "UseUnlockSystem", MovePref, "Off","On" ) ); ADD( ConfOption( "UseUnlockSystem", MovePref, "Off","On" ) );
@@ -655,7 +655,7 @@ static void InitializeConfOptions()
ADD( ConfOption( "CoinsPerCredit", CoinsPerCredit, "|1","|2","|3","|4","|5","|6","|7","|8","|9","|10","|11","|12","|13","|14","|15","|16" ) ); ADD( ConfOption( "CoinsPerCredit", CoinsPerCredit, "|1","|2","|3","|4","|5","|6","|7","|8","|9","|10","|11","|12","|13","|14","|15","|16" ) );
ADD( ConfOption( "Premium", PremiumM, "Off","Double for 1 Credit","Joint Premium" ) ); ADD( ConfOption( "Premium", PremiumM, "Off","Double for 1 Credit","Joint Premium" ) );
ADD( ConfOption( "ShowSongOptions", ShowSongOptions, "Hide","Show","Ask" ) ); ADD( ConfOption( "ShowSongOptions", ShowSongOptions, "Hide","Show","Ask" ) );
ADD( ConfOption( "GetRankingName", GetRankingName, "Off", "On", "Ranking Songs" ) ); ADD( ConfOption( "GetRankingName", GetRankingNameM, "Off", "On", "Ranking Songs" ) );
/* Graphic options */ /* Graphic options */
ADD( ConfOption( "Windowed", MovePref, "Full Screen", "Windowed" ) ); ADD( ConfOption( "Windowed", MovePref, "Full Screen", "Windowed" ) );
+3 -3
View File
@@ -31,11 +31,11 @@ void ScreenPlayerOptions::Init()
} }
m_bAskOptionsMessage = m_bAskOptionsMessage =
!GAMESTATE->IsEditing() && PREFSMAN->m_ShowSongOptions == PrefsManager::ASK; !GAMESTATE->IsEditing() && PREFSMAN->m_ShowSongOptions == Maybe_ASK;
/* If we're going to "press start for more options" or skipping options /* If we're going to "press start for more options" or skipping options
* entirely, we need a different fade out. XXX: this is a hack */ * entirely, we need a different fade out. XXX: this is a hack */
if( PREFSMAN->m_ShowSongOptions == PrefsManager::NO || GAMESTATE->IsEditing() ) if( PREFSMAN->m_ShowSongOptions == Maybe_NO || GAMESTATE->IsEditing() )
{ {
m_Out.Load( THEME->GetPathB("ScreenPlayerOptions","direct out") ); /* direct to stage */ m_Out.Load( THEME->GetPathB("ScreenPlayerOptions","direct out") ); /* direct to stage */
} }
@@ -53,7 +53,7 @@ void ScreenPlayerOptions::Init()
} }
m_bAcceptedChoices = false; m_bAcceptedChoices = false;
m_bGoToOptions = ( PREFSMAN->m_ShowSongOptions == PrefsManager::YES ); m_bGoToOptions = ( PREFSMAN->m_ShowSongOptions == Maybe_YES );
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("player options intro") ); SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("player options intro") );
+1 -1
View File
@@ -13,7 +13,7 @@ void ScreenSongOptions::Init()
/* Hack: If we're coming in from "press start for more options", we need a different /* Hack: If we're coming in from "press start for more options", we need a different
* fade in. */ * fade in. */
if(PREFSMAN->m_ShowSongOptions == PrefsManager::ASK) if( PREFSMAN->m_ShowSongOptions == Maybe_ASK )
{ {
m_In.Load( THEME->GetPathB("ScreenSongOptions","option in") ); m_In.Load( THEME->GetPathB("ScreenSongOptions","option in") );
m_In.StartTransitioning(); m_In.StartTransitioning();