Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ItemDropBestiaryInfoElement.cs
Go to the documentation of this file.
3using Terraria.ID;
4using Terraria.UI;
5
7
9{
11
13 {
14 _droprateInfo = info;
15 }
16
18 {
19 bool flag = ShouldShowItem(ref _droprateInfo);
20 if (info.UnlockState < BestiaryEntryUnlockState.CanShowStats_2)
21 {
22 flag = false;
23 }
24 if (!flag)
25 {
26 return null;
27 }
28 return new UIBestiaryInfoItemLine(_droprateInfo, info);
29 }
30
31 private static bool ShouldShowItem(ref DropRateInfo dropRateInfo)
32 {
33 bool result = true;
34 if (dropRateInfo.conditions != null && dropRateInfo.conditions.Count > 0)
35 {
36 for (int i = 0; i < dropRateInfo.conditions.Count; i++)
37 {
38 if (!dropRateInfo.conditions[i].CanShowItemDropInUI())
39 {
40 result = false;
41 break;
42 }
43 }
44 }
45 return result;
46 }
47
49 {
50 bool flag = ShouldShowItem(ref _droprateInfo);
51 if (info.UnlockState < BestiaryEntryUnlockState.CanShowStats_2)
52 {
53 flag = false;
54 }
55 if (!flag)
56 {
57 return null;
58 }
60 }
61}
virtual UIElement ProvideUIElement(BestiaryUICollectionInfo info)
static Dictionary< int, Item > ItemsByType