From b3da8d35c0ae21a635c7af93bf22558945f096cb Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 16 Dec 2022 20:03:19 +0100 Subject: [PATCH] Ensure paragraphs display up-to-date versions of their text callbacks --- CHANGELOG.md | 1 + MLEM.Ui/Elements/Paragraph.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1948b3..a5ffb6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,7 @@ Improvements - Generified UiMarkdownParser by adding abstract UiParser - Multi-target net452, making MLEM compatible with MonoGame for consoles - Added trimming and AOT annotations and made MLEM.Ui trimmable +- Ensure paragraphs display up-to-date versions of their text callbacks Fixes - Fixed parents of elements that prevent spill not being notified properly diff --git a/MLEM.Ui/Elements/Paragraph.cs b/MLEM.Ui/Elements/Paragraph.cs index 833a481..9b47c02 100644 --- a/MLEM.Ui/Elements/Paragraph.cs +++ b/MLEM.Ui/Elements/Paragraph.cs @@ -149,6 +149,7 @@ namespace MLEM.Ui.Elements { /// public override void Draw(GameTime time, SpriteBatch batch, float alpha, SpriteBatchContext context) { + this.QueryTextCallback(); var pos = this.DisplayArea.Location + new Vector2(this.GetAlignmentOffset(), 0); var sc = this.TextScale * this.TextScaleMultiplier * this.Scale; var color = this.TextColor.OrDefault(Color.White) * alpha;