TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ LocalizedDuration()

static string Terraria.Lang.LocalizedDuration ( TimeSpan time,
bool abbreviated,
bool showAllAvailableUnits )
inlinestatic

Definition at line 1167 of file Lang.cs.

1168 {
1169 string text = "";
1171 if (time.Days > 0)
1172 {
1173 int num = time.Days;
1174 if (!showAllAvailableUnits && time > TimeSpan.FromDays(1.0))
1175 {
1176 num++;
1177 }
1178 text = text + num + (abbreviated ? (" " + Language.GetTextValue("Misc.ShortDays")) : ((num == 1) ? " day" : " days"));
1180 {
1181 return text;
1182 }
1183 text += " ";
1184 }
1185 if (time.Hours > 0)
1186 {
1187 int num2 = time.Hours;
1188 if (!showAllAvailableUnits && time > TimeSpan.FromHours(1.0))
1189 {
1190 num2++;
1191 }
1192 text = text + num2 + (abbreviated ? (" " + Language.GetTextValue("Misc.ShortHours")) : ((num2 == 1) ? " hour" : " hours"));
1194 {
1195 return text;
1196 }
1197 text += " ";
1198 }
1199 if (time.Minutes > 0)
1200 {
1201 int num3 = time.Minutes;
1202 if (!showAllAvailableUnits && time > TimeSpan.FromMinutes(1.0))
1203 {
1204 num3++;
1205 }
1206 text = text + num3 + (abbreviated ? (" " + Language.GetTextValue("Misc.ShortMinutes")) : ((num3 == 1) ? " minute" : " minutes"));
1208 {
1209 return text;
1210 }
1211 text += " ";
1212 }
1213 return text + time.Seconds + (abbreviated ? (" " + Language.GetTextValue("Misc.ShortSeconds")) : ((time.Seconds == 1) ? " second" : " seconds"));
1214 }
static GameCulture FromCultureName(CultureName name)
static string GetTextValue(string key)
Retrieves the text value for a specified localization key. The text returned will be for the currentl...
Definition Language.cs:35
Contains methods to access or retrieve localization values. The Localization Guideteaches more about ...
Definition Language.cs:12

References Terraria.Localization.GameCulture.FromCultureName(), and Terraria.Localization.Language.GetTextValue().

Referenced by Terraria.Main.DrawBuffIcon(), and Terraria.Main.DrawMap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: