From 401a89e2951ae32acda90453a94e6b7a11287d01 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 26 Sep 2019 19:35:22 +0200 Subject: [PATCH] fixed paragraphs not having their hidden property initialized at startup --- MLEM.Ui/Elements/Paragraph.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MLEM.Ui/Elements/Paragraph.cs b/MLEM.Ui/Elements/Paragraph.cs index 380d880..4c2afe1 100644 --- a/MLEM.Ui/Elements/Paragraph.cs +++ b/MLEM.Ui/Elements/Paragraph.cs @@ -42,10 +42,14 @@ namespace MLEM.Ui.Elements { : this(anchor, width, "", centerText) { this.GetTextCallback = textCallback; this.Text = textCallback(this); + if (this.Text == null) + this.IsHidden = true; } public Paragraph(Anchor anchor, float width, string text, bool centerText = false) : base(anchor, new Vector2(width, 0)) { - this.text = text; + this.Text = text; + if (this.Text == null) + this.IsHidden = true; this.AutoAdjustWidth = centerText; this.CanBeSelected = false; this.CanBeMoused = false;