(f8525130a) Added: Objective tracking, UI changes.

This commit is contained in:
Joonas Rikkonen
2019-03-27 20:46:44 +02:00
parent a939cdef91
commit 474099732b
10 changed files with 322 additions and 56 deletions
@@ -50,6 +50,11 @@ namespace Barotrauma
get; private set;
}
public static Rectangle ObjectiveArea
{
get; private set;
}
public static Rectangle InventoryAreaLower
{
get; private set;
@@ -156,6 +161,11 @@ namespace Barotrauma
new Rectangle(Padding, CrewArea.Y, chatBoxWidth, chatBoxHeight) :
new Rectangle(GameMain.GraphicsWidth - Padding - chatBoxWidth, CrewArea.Y, chatBoxWidth, chatBoxHeight);
int objectiveAreaWidth = (int)(250 * GUI.Scale);
int objectiveAreaHeight = (int)(40 * GUI.Scale);
int objectiveAreaOffsetY = (int)(100 * GUI.Scale);
ObjectiveArea = new Rectangle(GameMain.GraphicsWidth - Padding - objectiveAreaWidth, CrewArea.Y + crewAreaHeight + objectiveAreaOffsetY, objectiveAreaWidth, objectiveAreaHeight);
int lowerAreaHeight = (int)Math.Min(GameMain.GraphicsHeight * 0.25f, 280);
InventoryAreaLower = new Rectangle(Padding, GameMain.GraphicsHeight - lowerAreaHeight, GameMain.GraphicsWidth - Padding * 2, lowerAreaHeight);
@@ -88,7 +88,7 @@ namespace Barotrauma
videoView = new GUICustomComponent(new RectTransform(new Point(width, height), videoFrame.RectTransform, Anchor.Center),
(spriteBatch, guiCustomComponent) => { DrawVideo(spriteBatch, guiCustomComponent.Rect); });
title = new GUITextBlock(new RectTransform(Point.Zero, textFrame.RectTransform, Anchor.TopCenter, Pivot.TopLeft) { AbsoluteOffset = new Point(-225, 10) }, string.Empty, font: GUI.VideoTitleFont, textColor: new Color(253, 174, 0), textAlignment: Alignment.Left);
title = new GUITextBlock(new RectTransform(Point.Zero, textFrame.RectTransform, Anchor.TopLeft, Pivot.TopLeft) { AbsoluteOffset = new Point(0, 10) }, string.Empty, font: GUI.VideoTitleFont, textColor: new Color(253, 174, 0), textAlignment: Alignment.Left);
textContent = new GUITextBlock(new RectTransform(new Vector2(1f, .8f), textFrame.RectTransform, Anchor.TopCenter, Pivot.TopCenter) { AbsoluteOffset = new Point(0, borderSize / 2 + titleHeight) }, string.Empty, font: GUI.Font, textAlignment: Alignment.TopLeft);
@@ -214,7 +214,7 @@ namespace Barotrauma
title.Text = TextManager.Get(contentId);
title.RectTransform.NonScaledSize += new Point(textSettings.Width, titleHeight);
if (textSettings.Text != string.Empty)
if (!string.IsNullOrEmpty(textSettings.Text))
{
textSettings.Text = ToolBox.WrapText(textSettings.Text, textSettings.Width, GUI.Font);
int wrappedHeight = textSettings.Text.Split('\n').Length * textHeight;