From 28a8a5a2ed5aa43f171532a8e74ffb3db5de8f82 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Tue, 2 Apr 2019 12:39:55 +0300 Subject: [PATCH] (99be2b970) Fixed submarine preview info text overlap --- .../BarotraumaClient/Source/Map/Submarine.cs | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/Barotrauma/BarotraumaClient/Source/Map/Submarine.cs b/Barotrauma/BarotraumaClient/Source/Map/Submarine.cs index bddd498b4..6041de872 100644 --- a/Barotrauma/BarotraumaClient/Source/Map/Submarine.cs +++ b/Barotrauma/BarotraumaClient/Source/Map/Submarine.cs @@ -301,32 +301,37 @@ namespace Barotrauma TextManager.Get("Unknown") : TextManager.Get("DimensionsFormat").Replace("[width]", ((int)(realWorldDimensions.X)).ToString()).Replace("[height]", ((int)(realWorldDimensions.Y)).ToString()); - var layoutGroup = new GUILayoutGroup(new RectTransform(new Vector2(0.5f, 0.5f), descriptionBox.Content.RectTransform) { RelativeOffset = new Vector2(0.0f, 0.05f) }); + new GUITextBlock(new RectTransform(new Vector2(1, 0), descriptionBox.Content.RectTransform), Name, font: GUI.LargeFont, wrap: true) { ForceUpperCase = true, CanBeFocused = false }; - new GUITextBlock(new RectTransform(new Vector2(1, 0), layoutGroup.RectTransform), Name, font: GUI.LargeFont, wrap: true) { ForceUpperCase = true }; - - new GUITextBlock(new RectTransform(new Vector2(1, 0), layoutGroup.RectTransform), + new GUITextBlock(new RectTransform(new Vector2(1, 0), descriptionBox.Content.RectTransform), $"{TextManager.Get("Dimensions")}: {dimensionsStr}", - font: GUI.Font, wrap: true); + font: GUI.Font, wrap: true) + { CanBeFocused = false }; - new GUITextBlock(new RectTransform(new Vector2(1, 0), layoutGroup.RectTransform), + new GUITextBlock(new RectTransform(new Vector2(1, 0), descriptionBox.Content.RectTransform), $"{TextManager.Get("RecommendedCrewSize")}: {(RecommendedCrewSizeMax == 0 ? TextManager.Get("Unknown") : RecommendedCrewSizeMin + " - " + RecommendedCrewSizeMax)}", - font: GUI.Font, wrap: true); + font: GUI.Font, wrap: true) + { CanBeFocused = false }; - new GUITextBlock(new RectTransform(new Vector2(1, 0), layoutGroup.RectTransform), + new GUITextBlock(new RectTransform(new Vector2(1, 0), descriptionBox.Content.RectTransform), $"{TextManager.Get("RecommendedCrewExperience")}: {(string.IsNullOrEmpty(RecommendedCrewExperience) ? TextManager.Get("unknown") : TextManager.Get(RecommendedCrewExperience))}", - font: GUI.Font, wrap: true); + font: GUI.Font, wrap: true) + { CanBeFocused = false }; - new GUITextBlock(new RectTransform(new Vector2(1, 0), layoutGroup.RectTransform), + new GUITextBlock(new RectTransform(new Vector2(1, 0), descriptionBox.Content.RectTransform), $"{TextManager.Get("RequiredContentPackages")}: {string.Join(", ", RequiredContentPackages)}", - font: GUI.Font, wrap: true); + font: GUI.Font, wrap: true) + { CanBeFocused = false }; + + //space + new GUIFrame(new RectTransform(new Vector2(1.0f, 0.05f), descriptionBox.Content.RectTransform), style: null); if (Description.Length != 0) { new GUITextBlock(new RectTransform(new Vector2(1, 0), descriptionBox.Content.RectTransform), TextManager.Get("SaveSubDialogDescription") + ":", font: GUI.Font, wrap: true) { CanBeFocused = false, ForceUpperCase = true }; } - new GUITextBlock(new RectTransform(new Vector2(1, 0), descriptionBox.Content.RectTransform, Anchor.TopLeft), Description, font: GUI.Font, wrap: true) + new GUITextBlock(new RectTransform(new Vector2(1, 0), descriptionBox.Content.RectTransform), Description, font: GUI.Font, wrap: true) { CanBeFocused = false };