From 11e5aeb8b9237f0c8b5e0c821f2bee93d3465fe2 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Thu, 1 Dec 2005 19:27:33 +0000 Subject: [PATCH] use | marker for "don't theme this choice" --- stepmania/src/OptionRow.cpp | 11 +++++++- stepmania/src/OptionRowHandler.cpp | 2 ++ stepmania/src/ScreenOptionsMasterPrefs.cpp | 32 +++++++++++----------- stepmania/src/ScreenOptionsMasterPrefs.h | 3 ++ 4 files changed, 31 insertions(+), 17 deletions(-) diff --git a/stepmania/src/OptionRow.cpp b/stepmania/src/OptionRow.cpp index 0ee66be404..20863caecc 100644 --- a/stepmania/src/OptionRow.cpp +++ b/stepmania/src/OptionRow.cpp @@ -35,11 +35,20 @@ void OptionRow::PrepareItemText( CString &s ) const return; bool bTheme = false; - // HACK: Always theme the NEXT_ROW and EXIT items, even if metrics says not to theme. + // HACK: Always theme the NEXT_ROW and EXIT items. if( s == NEXT_ROW_NAME ) bTheme = true; if( s == EXIT_NAME ) bTheme = true; if( m_RowDef.m_bAllowThemeItems ) bTheme = true; + // Items beginning with a pipe mean "don't theme". + // This allows us to disable theming on a per-choice basis for choice names that are just a number + // and don't need to be localized. + if( s[0] == '|' ) + { + s.erase( s.begin() ); + bTheme = false; + } + if( bTheme ) s = CommonMetrics::ThemeOptionItem( s, false ); if( m_pParentType->CAPITALIZE_ALL_OPTION_NAMES ) diff --git a/stepmania/src/OptionRowHandler.cpp b/stepmania/src/OptionRowHandler.cpp index 16a0980299..1e5ed9b7f8 100644 --- a/stepmania/src/OptionRowHandler.cpp +++ b/stepmania/src/OptionRowHandler.cpp @@ -844,6 +844,8 @@ public: opt = pConfOption; opt->MakeOptionsList( defOut.m_vsChoices ); + defOut.m_bAllowThemeItems = opt->m_bAllowThemeItems; + defOut.m_sName = opt->name; } virtual void ImportOption( const OptionRowDefinition &def, const vector &vpns, vector vbSelectedOut[NUM_PLAYERS] ) const diff --git a/stepmania/src/ScreenOptionsMasterPrefs.cpp b/stepmania/src/ScreenOptionsMasterPrefs.cpp index 8e4876ff97..0e9d9d4362 100644 --- a/stepmania/src/ScreenOptionsMasterPrefs.cpp +++ b/stepmania/src/ScreenOptionsMasterPrefs.cpp @@ -539,7 +539,7 @@ static void InitializeConfOptions() ADD( ConfOption( "DancePointsForOni", MovePref, "Percent","Dance Points") ); ADD( ConfOption( "ShowSelectGroup", MovePref, "All Music","Choose") ); ADD( ConfOption( "MusicWheelUsesSections", WheelSections, "Never","Always","Title Only") ); - ADD( ConfOption( "CourseSortOrder", MovePref, "# Songs","Average Feet","Total Feet","Ranking") ); + ADD( ConfOption( "CourseSortOrder", MovePref, "Num Songs","Average Feet","Total Feet","Ranking") ); ADD( ConfOption( "MoveRandomToEnd", MovePref, "No","Yes") ); ADD( ConfOption( "ShowNativeLanguage", MovePref, "Romanization","Native Language") ); ADD( ConfOption( "ShowLyrics", MovePref, "Hide","Show") ); @@ -553,13 +553,13 @@ static void InitializeConfOptions() /* Background options */ ADD( ConfOption( "RandomBackgroundMode", MovePref, "Off","Animations","Random Movies" ) ); - ADD( ConfOption( "BGBrightness", BGBrightness, "0%","10%","20%","30%","40%","50%","60%","70%","80%","90%","100%" ) ); - ADD( ConfOption( "BGBrightnessNoZero", BGBrightnessNoZero, "10%","20%","30%","40%","50%","60%","70%","80%","90%","100%" ) ); + ADD( ConfOption( "BGBrightness", BGBrightness, "|0%","|10%","|20%","|30%","|40%","|50%","|60%","|70%","|80%","|90%","|100%" ) ); + ADD( ConfOption( "BGBrightnessNoZero", BGBrightnessNoZero, "|10%","|20%","|30%","|40%","|50%","|60%","|70%","|80%","|90%","|100%" ) ); ADD( ConfOption( "BGBrightnessOrStatic", BGBrightnessOrStatic,"Disabled","Dim","Bright" ) ); ADD( ConfOption( "ShowDanger", MovePref, "Hide","Show" ) ); ADD( ConfOption( "ShowDancingCharacters", MovePref, "Default to Off","Default to Random","Select" ) ); ADD( ConfOption( "ShowBeginnerHelper", MovePref, "Off","On" ) ); - ADD( ConfOption( "NumBackgrounds", NumBackgrounds, "5","10","15","20" ) ); + ADD( ConfOption( "NumBackgrounds", NumBackgrounds, "|5","|10","|15","|20" ) ); /* Input options */ ADD( ConfOption( "AutoMapOnJoyChange", MovePref, "Off","On (recommended)" ) ); @@ -582,18 +582,18 @@ static void InitializeConfOptions() ADD( ConfOption( "MenuTimer", MovePref, "Off","On" ) ); ADD( ConfOption( "CoinMode", CoinModeM, "Home","Pay","Free Play" ) ); ADD( ConfOption( "CoinModeNoHome", CoinModeNoHome, "Pay","Free Play" ) ); - ADD( ConfOption( "SongsPerPlay", SongsPerPlay, "1","2","3","4","5" ) ); - ADD( ConfOption( "SongsPerPlayOrEvent", SongsPerPlayOrEventMode, "1","2","3","4","5","Event" ) ); + ADD( ConfOption( "SongsPerPlay", SongsPerPlay, "|1","|2","|3","|4","|5" ) ); + ADD( ConfOption( "SongsPerPlayOrEvent", SongsPerPlayOrEventMode, "|1","|2","|3","|4","|5","Event" ) ); ADD( ConfOption( "EventMode", MovePref, "Off","On" ) ); ADD( ConfOption( "ScoringType", MovePref, "New","Old" ) ); - ADD( ConfOption( "TimingWindowScale", TimingWindowScale, "1","2","3","4","5","6","7","8","Justice" ) ); - ADD( ConfOption( "LifeDifficulty", LifeDifficulty, "1","2","3","4","5","6","7" ) ); - ADD( ConfOption( "ProgressiveLifebar", MovePref, "Off","1","2","3","4","5","6","7","8") ); - ADD( ConfOption( "ProgressiveStageLifebar", MovePref, "Off","1","2","3","4","5","6","7","8","Insanity") ); - ADD( ConfOption( "ProgressiveNonstopLifebar", MovePref, "Off","1","2","3","4","5","6","7","8","Insanity") ); + ADD( ConfOption( "TimingWindowScale", TimingWindowScale, "|1","|2","|3","|4","|5","|6","|7","|8","Justice" ) ); + ADD( ConfOption( "LifeDifficulty", LifeDifficulty, "|1","|2","|3","|4","|5","|6","|7" ) ); + ADD( ConfOption( "ProgressiveLifebar", MovePref, "Off","|1","|2","|3","|4","|5","|6","|7","|8") ); + ADD( ConfOption( "ProgressiveStageLifebar", MovePref, "Off","|1","|2","|3","|4","|5","|6","|7","|8","Insanity") ); + ADD( ConfOption( "ProgressiveNonstopLifebar", MovePref, "Off","|1","|2","|3","|4","|5","|6","|7","|8","Insanity") ); ADD( ConfOption( "DefaultFailType", DefaultFailType, "Immediate","End of Song","Off" ) ); ADD( ConfOption( "DefaultFailTypeNoOff", DefaultFailType, "Immediate","End of Song" ) ); - 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( "ShowSongOptions", ShowSongOptions, "Hide","Show","Ask" ) ); ADD( ConfOption( "GetRankingName", GetRankingName, "Off", "On", "Ranking Songs" ) ); @@ -603,11 +603,11 @@ static void InitializeConfOptions() g_ConfOptions.back().m_iEffects = OPT_APPLY_GRAPHICS; ADD( ConfOption( "DisplayResolution", DisplayResolutionM, DisplayResolutionChoices ) ); g_ConfOptions.back().m_iEffects = OPT_APPLY_GRAPHICS | OPT_APPLY_ASPECT_RATIO; - ADD( ConfOption( "DisplayAspectRatio", DisplayAspectRatio, "Auto","3:4","1:1","4:3","16:10","16:9","8:3" ) ); + ADD( ConfOption( "DisplayAspectRatio", DisplayAspectRatio, "Auto","|3:4","|1:1","|4:3","|16:10","|16:9","|8:3" ) ); g_ConfOptions.back().m_iEffects = OPT_APPLY_ASPECT_RATIO; ADD( ConfOption( "DisplayColorDepth", DisplayColorDepth, "16bit","32bit" ) ); g_ConfOptions.back().m_iEffects = OPT_APPLY_GRAPHICS; - ADD( ConfOption( "MaxTextureResolution", MaxTextureResolution,"256","512","1024","2048" ) ); + ADD( ConfOption( "MaxTextureResolution", MaxTextureResolution,"|256","|512","|1024","|2048" ) ); g_ConfOptions.back().m_iEffects = OPT_APPLY_GRAPHICS; ADD( ConfOption( "TextureColorDepth", TextureColorDepth, "16bit","32bit" ) ); g_ConfOptions.back().m_iEffects = OPT_APPLY_GRAPHICS; @@ -617,7 +617,7 @@ static void InitializeConfOptions() ADD( ConfOption( "CelShadeModels", MovePref, "Off","On" ) ); ADD( ConfOption( "SmoothLines", MovePref, "Off","On" ) ); g_ConfOptions.back().m_iEffects = OPT_APPLY_GRAPHICS; - ADD( ConfOption( "RefreshRate", RefreshRate, "Default","60","70","72","75","80","85","90","100","120","150" ) ); + ADD( ConfOption( "RefreshRate", RefreshRate, "Default","|60","|70","|72","|75","|80","|85","|90","|100","|120","|150" ) ); g_ConfOptions.back().m_iEffects = OPT_APPLY_GRAPHICS; ADD( ConfOption( "Vsync", MovePref, "No", "Yes" ) ); g_ConfOptions.back().m_iEffects = OPT_APPLY_GRAPHICS; @@ -627,7 +627,7 @@ static void InitializeConfOptions() /* Sound options */ ADD( ConfOption( "SoundResampleQuality", MovePref, "Fast","Normal","High Quality" ) ); ADD( ConfOption( "AttractSoundFrequency", MovePref, "Never","Always","2 Times","3 Times","4 Times","5 Times" ) ); - ADD( ConfOption( "SoundVolume", SoundVolume, "Silent","10%","20%","30%","40%","50%","60%","70%","80%","90%","100%" ) ); + ADD( ConfOption( "SoundVolume", SoundVolume, "Silent","|10%","|20%","|30%","|40%","|50%","|60%","|70%","|80%","|90%","|100%" ) ); g_ConfOptions.back().m_iEffects = OPT_APPLY_SOUND; { ConfOption c( "GlobalOffsetSeconds", GlobalOffsetSeconds ); diff --git a/stepmania/src/ScreenOptionsMasterPrefs.h b/stepmania/src/ScreenOptionsMasterPrefs.h index 552e20b66e..1a3471d218 100644 --- a/stepmania/src/ScreenOptionsMasterPrefs.h +++ b/stepmania/src/ScreenOptionsMasterPrefs.h @@ -20,6 +20,7 @@ struct ConfOption typedef void (*MoveData_t)( int &sel, bool ToSel, const ConfOption *pConfOption ); MoveData_t MoveData; int m_iEffects; + bool m_bAllowThemeItems; /* For dynamic options, update the options. Since this changes the available * options, this may invalidate the offsets returned by Get() and Put(). */ @@ -40,6 +41,7 @@ struct ConfOption MoveData = m; MakeOptionsListCB = NULL; m_iEffects = 0; + m_bAllowThemeItems = true; #define PUSH( c ) if(c) names.push_back(c); PUSH(c0);PUSH(c1);PUSH(c2);PUSH(c3);PUSH(c4);PUSH(c5);PUSH(c6);PUSH(c7);PUSH(c8);PUSH(c9);PUSH(c10);PUSH(c11);PUSH(c12);PUSH(c13);PUSH(c14);PUSH(c15);PUSH(c16);PUSH(c17);PUSH(c18);PUSH(c19); } @@ -53,6 +55,7 @@ struct ConfOption MoveData = m; MakeOptionsListCB = lst; m_iEffects = 0; + m_bAllowThemeItems = false; // don't theme dynamic choices }