From 81290aa9952a56dd5e7a5393413e603c59c07659 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Mon, 14 Mar 2005 20:16:39 +0000 Subject: [PATCH] fix "100%" not stripped if there's a leading speed --- stepmania/src/PlayerOptions.cpp | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/stepmania/src/PlayerOptions.cpp b/stepmania/src/PlayerOptions.cpp index ae0311eafe..1918169841 100644 --- a/stepmania/src/PlayerOptions.cpp +++ b/stepmania/src/PlayerOptions.cpp @@ -571,21 +571,6 @@ bool PlayerOptions::IsEasierForCourseAndTrail( Course* pCourse, Trail* pTrail ) CString PlayerOptions::ThemeMod( CString sOneMod ) { - // Strip out the approach speed token - if( !sOneMod.empty() && sOneMod[0]=='*' ) - { - int iPos = sOneMod.Find(' '); - if( iPos != -1 ) - sOneMod.erase( sOneMod.begin(), sOneMod.begin()+iPos+1 ); - } - - // Strip out "100% " -#define PERCENT_100 "100% " - if( !strncmp( sOneMod, PERCENT_100, sizeof(PERCENT_100)) ) - { - sOneMod.erase( sOneMod.begin(), sOneMod.begin()+sizeof(PERCENT_100) ); - } - // Change all token to first letter capitalized, rest lowercase CStringArray asTokens; split( sOneMod, " ", asTokens ); @@ -595,6 +580,14 @@ CString PlayerOptions::ThemeMod( CString sOneMod ) *s = Capitalize( *s ); } + // Strip the approach speed token, if any + if( asTokens[0][0] == '*' ) + asTokens.erase( asTokens.begin() ); + + // Strip "100%", if any + if( asTokens[0] == "100%" ) + asTokens.erase( asTokens.begin() ); + /* Theme the mod name (the last string). Allow this to not exist, since * characters might use modifiers that don't exist in the theme. */ if( THEME->HasMetric( "OptionNames", asTokens.back() ) )