58 MissionMainMenu missionMainMenu = MissionMainMenu.Cast(
GetGame().GetMission());
60 if (missionMainMenu && missionMainMenu.GetIntroScenePC())
62 #ifdef PLATFORM_WINDOWS
63 player = missionMainMenu.GetIntroScenePC().GetIntroCharacter().GetCharacterObj();
65 #ifdef PLATFORM_CONSOLE
66 player = missionMainMenu.GetIntroScenePC().GetIntroCharacter().GetCharacterObj();
84 if (total_distance > 0)
86 string distanceString;
88 float kilometers = total_distance * 0.001;
90 if ( kilometers >= 10 && !meters_only )
92 distanceString =
GetValueString(kilometers,
true) +
" #STR_distance_unit_abbrev_kilometer_0";
96 distanceString =
GetValueString(total_distance) +
" #STR_distance_unit_abbrev_meter_0";
99 return distanceString;
102 return "0" +
" #STR_distance_unit_abbrev_meter_0";
111 int total_value_int = total_value;
112 string number_str = total_value_int.ToString();
115 if ( total_value >= 1000 )
118 int first_length = number_str.
Length() % 3;
119 if ( first_length > 0 )
121 count = 3 - first_length;
124 for (
int i = 0; i < number_str.
Length(); ++i )
126 out_string += number_str.
Get( i );
138 out_string = number_str;
144 string total_value_str = total_value.
ToString();
145 int decimal_idx = total_value_str.
IndexOf(
"." );
147 if ( decimal_idx > -1 )
150 out_string += total_value_str.
Substring( decimal_idx, total_value_str.
Length() - decimal_idx );
const string STAT_INFECTED_KILLED
const string STAT_LONGEST_SURVIVOR_HIT
const string STAT_PLAYTIME
const string STAT_PLAYERS_KILLED
const string STAT_DISTANCE
struct that keeps Time relevant information for future formatting
proto string ToString(bool simple=true)
proto native CGame GetGame()
static proto float Round(float f)
Returns mathematical round of value.
proto native int Length()
Returns length of string.
proto string Get(int index)
Gets n-th character from string.
proto string Substring(int start, int len)
Substring of 'str' from 'start' position 'len' number of characters.
proto int TrimInPlace()
Removes leading and trailing whitespaces in string. Returns length.
proto native int IndexOf(string sample)
Finds 'sample' in 'str'. Returns -1 when not found.