// string-related functions extend Class SWWMUtility { // bit ugly, but it works static void ThousandsStr( String &s, int col = Font.CR_UNDEFINED, String colstr = "" ) { if ( (col < Font.CR_UNDEFINED) || (col >= Font.NUM_TEXT_COLORS) ) ThrowAbortException("col parameter out of range, use colstr for non-standard font colors."); String nstr = s; s.Truncate(0); int len = nstr.CodePointCount(); int t = len; if ( nstr.Left(1) == "-" ) t++; for ( int i=0, pos=0; i 0 ) nstr = String.Format("%0*d",digits,n); else nstr = String.Format("%d",n); ThousandsStr(nstr,col,colstr); return nstr; } static void StripColor( String &str ) { int len = str.CodePointCount(); for ( int i=0, pos=0; i=0; i-- ) { int d = int(val/IntPow(10,i))%10; str.AppendCharacter(digs[d]); } return str; } static void ObscureText( String &str, int seed, bool alnum = false, bool minihud = false ) { int len = str.CodePointCount(); String newstr = ""; for ( int i=0, pos=0; i= 10 ) sd += 7; newstr.AppendCharacter(sd+48); } else if ( minihud ) { // exclude forward/backward slashes as they're wider int sd = abs(seed%93); if ( sd >= 15 ) sd++; if ( sd >= 60 ) sd++; newstr.AppendCharacter(sd+32); } else newstr.AppendCharacter((abs(seed)%95)+32); } str = newstr; } static void BeautifyClassName( String &str ) { String workstr = str; str.Truncate(0); workstr.Replace("_"," "); int len = workstr.CodePointCount(); for ( int i=0, pos=0; i