uppercase words in StepsType lua string values to match other types
This commit is contained in:
@@ -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); } }
|
||||
|
||||
Reference in New Issue
Block a user