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

◆ ValueToName() [2/2]

static string Terraria.PopupText.ValueToName ( long coinValue)
inlinestatic

Definition at line 460 of file PopupText.cs.

461 {
462 int num = 0;
463 int num2 = 0;
464 int num3 = 0;
465 int num4 = 0;
466 string text = "";
467 long num5 = coinValue;
468 while (num5 > 0)
469 {
470 if (num5 >= 1000000)
471 {
472 num5 -= 1000000;
473 num++;
474 }
475 else if (num5 >= 10000)
476 {
477 num5 -= 10000;
478 num2++;
479 }
480 else if (num5 >= 100)
481 {
482 num5 -= 100;
483 num3++;
484 }
485 else if (num5 >= 1)
486 {
487 num5--;
488 num4++;
489 }
490 }
491 text = "";
492 if (num > 0)
493 {
494 text = text + num + string.Format(" {0} ", Language.GetTextValue("Currency.Platinum"));
495 }
496 if (num2 > 0)
497 {
498 text = text + num2 + string.Format(" {0} ", Language.GetTextValue("Currency.Gold"));
499 }
500 if (num3 > 0)
501 {
502 text = text + num3 + string.Format(" {0} ", Language.GetTextValue("Currency.Silver"));
503 }
504 if (num4 > 0)
505 {
506 text = text + num4 + string.Format(" {0} ", Language.GetTextValue("Currency.Copper"));
507 }
508 if (text.Length > 1)
509 {
510 text = text.Substring(0, text.Length - 1);
511 }
512 return text;
513 }
static string GetTextValue(string key)
Definition Language.cs:15

References Terraria.PopupText.coinValue, Terraria.Localization.Language.GetTextValue(), and System.text.

Referenced by Terraria.PopupText.NewText().