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

◆ ProvideUIElement()

UIElement Terraria.GameContent.Bestiary.UnlockProgressDisplayBestiaryInfoElement.ProvideUIElement ( BestiaryUICollectionInfo info)
inline

Implements Terraria.GameContent.Bestiary.IBestiaryInfoElement.

Definition at line 22 of file UnlockProgressDisplayBestiaryInfoElement.cs.

23 {
24 UIElement uIElement = new UIPanel(Main.Assets.Request<Texture2D>("Images/UI/Bestiary/Stat_Panel", (AssetRequestMode)1), null, 12, 7)
25 {
26 Width = new StyleDimension(-11f, 1f),
27 Height = new StyleDimension(109f, 0f),
28 BackgroundColor = new Color(43, 56, 101),
29 BorderColor = Color.Transparent,
30 Left = new StyleDimension(3f, 0f)
31 };
32 uIElement.PaddingLeft = 4f;
33 uIElement.PaddingRight = 4f;
34 string arg = Utils.PrettifyPercentDisplay((float)info.UnlockState / 4f, "P2");
35 string text = $"{arg} Entry Collected";
36 string arg2 = Utils.PrettifyPercentDisplay(_progressReport.CompletionPercent, "P2");
37 string text2 = $"{arg2} Bestiary Collected";
38 int num = 8;
39 UIText uIText = new UIText(text, 0.8f)
40 {
41 HAlign = 0f,
42 VAlign = 0f,
44 Height = StyleDimension.FromPixelsAndPercent(0f, 1f),
45 IsWrapped = true,
46 PaddingTop = -num,
47 PaddingBottom = -num
48 };
49 UIText uIText2 = new UIText(text2, 0.8f)
50 {
51 HAlign = 0f,
52 VAlign = 0f,
54 Height = StyleDimension.FromPixelsAndPercent(0f, 1f),
55 IsWrapped = true,
56 PaddingTop = -num,
57 PaddingBottom = -num
58 };
59 _text1 = uIText;
60 _text2 = uIText2;
61 AddDynamicResize(uIElement, uIText);
62 uIElement.Append(uIText);
63 uIElement.Append(uIText2);
64 return uIElement;
65 }
void Append(UIElement element)
Definition UIElement.cs:166
static Color Transparent
Definition Color.cs:76
static StyleDimension FromPixelsAndPercent(float pixels, float percent)

References Terraria.GameContent.Bestiary.UnlockProgressDisplayBestiaryInfoElement._progressReport, Terraria.GameContent.Bestiary.UnlockProgressDisplayBestiaryInfoElement._text1, Terraria.GameContent.Bestiary.UnlockProgressDisplayBestiaryInfoElement._text2, Terraria.GameContent.Bestiary.UnlockProgressDisplayBestiaryInfoElement.AddDynamicResize(), Terraria.UI.UIElement.Append(), Terraria.Main.Assets, Microsoft.Xna.Framework.Graphics.Color, Terraria.GameContent.Bestiary.BestiaryUnlockProgressReport.CompletionPercent, Terraria.UI.StyleDimension.FromPixelsAndPercent(), Terraria.Utils.PrettifyPercentDisplay(), and Microsoft.Xna.Framework.Color.Transparent.