From 4c3307d37e323cd9c937d72a5e5fcac3c72c5828 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Wed, 1 Feb 2023 00:43:40 +0700 Subject: [PATCH] UI stuff --- UI/InvasionProgressUI.cs | 2 +- UI/ModeIndicator/ModeIndicatorUI.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/UI/InvasionProgressUI.cs b/UI/InvasionProgressUI.cs index 988daa4002..468a20bbbb 100644 --- a/UI/InvasionProgressUI.cs +++ b/UI/InvasionProgressUI.cs @@ -65,7 +65,7 @@ namespace CalamityMod.UI } public virtual void Draw(SpriteBatch spriteBatch) { - if (!IsActive) + if (!IsActive || Main.invasionProgressMode == 0) return; int barOffsetY = 0; diff --git a/UI/ModeIndicator/ModeIndicatorUI.cs b/UI/ModeIndicator/ModeIndicatorUI.cs index 4eae8f9e0f..2e8c74f53e 100644 --- a/UI/ModeIndicator/ModeIndicatorUI.cs +++ b/UI/ModeIndicator/ModeIndicatorUI.cs @@ -172,7 +172,7 @@ namespace CalamityMod.UI.ModeIndicator //Get a "regexed" size which matches the text properly. //Indeed, there is some scuffery in the code that makes it so that chat tags still get accounted as extra size, so we have to use 2 different values //One for the displacement, which is the improper size vanilla uses, and another for the actual visual size, which is the one the textbox will use - int numLines = Regex.Matches(textToDisplay, "\n").Count; //It's inconsistent. Adding one by default makes some textboxes too large, not adding one can make some too small + int numLines = 1 + Regex.Matches(textToDisplay, "\n").Count; //It's inconsistent. Adding one by default makes some textboxes too large, not adding one can make some too small string heightCalculator = string.Concat(Enumerable.Repeat("mis nuevos los gatos \n", numLines)); Vector2 regexedBoxSize = new Vector2(ChatManager.GetStringSize(MouseText.Value, textToDisplay, Vector2.One).X, ChatManager.GetStringSize(MouseText.Value, heightCalculator, Vector2.One).Y);