uppercase words in StepsType lua string values to match other types

This commit is contained in:
Chris Danford
2009-08-10 06:38:45 +00:00
parent 39f85d7f2b
commit e41eb2d03d
+15
View File
@@ -46,8 +46,23 @@ LuaXType( RadarCategory );
RString StepsTypeToString( StepsType st )
{
RString s = GAMEMAN->GetStepsTypeInfo( st ).szName; // "dance-single"
/* foo-bar -> Foo_Bar */
s.Replace('-','_');
bool bCapitalizeNextLetter = true;
for( int i=0; i<(int)s.length(); i++ )
{
if( bCapitalizeNextLetter )
{
s[i] = toupper(s[i]);
bCapitalizeNextLetter = false;
}
if( s[i] == '_' )
bCapitalizeNextLetter = true;
}
return s;
}
namespace StringConversion { template<> RString ToString<StepsType>( const StepsType &value ) { return StepsTypeToString(value); } }