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

◆ GetDropInfo()

void Terraria.GameContent.UI.Elements.UIBestiaryInfoItemLine.GetDropInfo ( DropRateInfo dropRateInfo,
BestiaryUICollectionInfo uiinfo,
out string stackRange,
out string droprate )
inlineprotected

Definition at line 81 of file UIBestiaryInfoItemLine.cs.

82 {
83 if (dropRateInfo.stackMin != dropRateInfo.stackMax)
84 {
85 stackRange = $" ({dropRateInfo.stackMin}-{dropRateInfo.stackMax})";
86 }
87 else if (dropRateInfo.stackMin == 1)
88 {
89 stackRange = "";
90 }
91 else
92 {
93 stackRange = " (" + dropRateInfo.stackMin + ")";
94 }
95 string originalFormat = "P";
96 if ((double)dropRateInfo.dropRate < 0.001)
97 {
98 originalFormat = "P4";
99 }
100 if (dropRateInfo.dropRate != 1f)
101 {
102 droprate = Utils.PrettifyPercentDisplay(dropRateInfo.dropRate, originalFormat);
103 }
104 else
105 {
106 droprate = "100%";
107 }
108 if (uiinfo.UnlockState != BestiaryEntryUnlockState.CanShowDropsWithDropRates_4)
109 {
110 droprate = "???";
111 stackRange = "";
112 }
113 }

References Terraria.Utils.PrettifyPercentDisplay().

Referenced by Terraria.GameContent.UI.Elements.UIBestiaryInfoItemLine.UIBestiaryInfoItemLine().