(e9f10995d) Merge branch 'bugreporterUI' into dev

This commit is contained in:
Joonas Rikkonen
2019-05-18 17:43:00 +03:00
parent 3a2310e547
commit 78b67de866
52 changed files with 428 additions and 223 deletions
+15 -2
View File
@@ -36,6 +36,16 @@ namespace Barotrauma
get { return (GameMain.GraphicsWidth / 1920.0f + GameMain.GraphicsHeight / 1080.0f) / 2.0f * GameSettings.HUDScale; }
}
public static float xScale
{
get { return GameMain.GraphicsWidth / 1920.0f * GameSettings.HUDScale; }
}
public static float yScale
{
get { return GameMain.GraphicsHeight / 1080.0f * GameSettings.HUDScale; }
}
public static GUIStyle Style;
private static Texture2D t;
@@ -386,8 +396,11 @@ namespace Barotrauma
{
MouseOn.DrawToolTip(spriteBatch);
}
Cursor.Draw(spriteBatch, PlayerInput.LatestMousePosition);
if (GameMain.WindowActive)
{
Cursor.Draw(spriteBatch, PlayerInput.LatestMousePosition, 0, Scale / 2f);
}
}
public static void DrawBackgroundSprite(SpriteBatch spriteBatch, Sprite backgroundSprite, float blurAmount = 1.0f, float aberrationStrength = 1.0f)
@@ -471,6 +471,8 @@ namespace Barotrauma
public static void DrawToolTip(SpriteBatch spriteBatch, string toolTip, Rectangle targetElement)
{
if (Tutorials.Tutorial.ContentRunning) return;
int width = (int)(400 * GUI.Scale);
int height = (int)(18 * GUI.Scale);
Point padding = new Point((int)(20 * GUI.Scale), (int)(7 * GUI.Scale));
@@ -91,7 +91,7 @@ namespace Barotrauma
}
InnerFrame.RectTransform.NonScaledSize =
new Point(InnerFrame.Rect.Width, (int)Math.Max(height / Content.RectTransform.RelativeSize.Y, height + 50));
new Point(InnerFrame.Rect.Width, (int)Math.Max(height / Content.RectTransform.RelativeSize.Y, height + (int)(50 * GUI.yScale)));
Content.RectTransform.NonScaledSize =
new Point(Content.Rect.Width, height);
}
@@ -99,7 +99,7 @@ namespace Barotrauma
Buttons = new List<GUIButton>(buttons.Length);
for (int i = 0; i < buttons.Length; i++)
{
var button = new GUIButton(new RectTransform(new Vector2(Math.Min(0.9f / buttons.Length, 0.5f), 1.0f), buttonContainer.RectTransform, maxSize: new Point(300, 35)), buttons[i], style: "GUIButtonLarge");
var button = new GUIButton(new RectTransform(new Vector2(Math.Min(0.9f / buttons.Length, 0.5f), 1.0f), buttonContainer.RectTransform), buttons[i], style: "GUIButtonLarge");
Buttons.Add(button);
}
@@ -339,7 +339,7 @@ namespace Barotrauma
Font.DrawString(spriteBatch,
Wrap ? wrappedText : text,
rect.Location.ToVector2() + textPos + TextOffset,
pos,
textColor * (textColor.A / 255.0f),
0.0f, origin, TextScale,
SpriteEffects.None, textDepth);
@@ -208,7 +208,7 @@ namespace Barotrauma
for (int i = 0; i < lines.Length; i++)
{
GUI.Font.DrawString(spriteBatch, lines[i],
new Vector2(GameMain.GraphicsWidth / 2.0f - GUI.Font.MeasureString(lines[i]).X / 2.0f, GameMain.GraphicsHeight * 0.78f + i * lineHeight), Color.White);
new Vector2((int)(GameMain.GraphicsWidth / 2.0f - GUI.Font.MeasureString(lines[i]).X / 2.0f), (int)(GameMain.GraphicsHeight * 0.78f + i * lineHeight)), Color.White);
}
}
@@ -242,6 +242,10 @@ namespace Barotrauma
if (hover && PlayerInput.LeftButtonClicked())
{
GameMain.Config.Language = language;
//reload tip in the selected language
selectedTip = TextManager.Get("LoadingScreenTip", true);
GameMain.Config.SetDefaultBindings(legacy: false);
GameMain.Config.CheckBindings(useDefaults: true);
WaitForLanguageSelection = false;
}
@@ -356,7 +356,7 @@ namespace Barotrauma
Point? minSize = null, maxSize = null;
if (element.Attribute("minsize") != null) minSize = element.GetAttributePoint("minsize", Point.Zero);
if (element.Attribute("maxsize") != null) maxSize = element.GetAttributePoint("maxsize", new Point(1000, 1000));
//if (element.Attribute("maxsize") != null) maxSize = element.GetAttributePoint("maxsize", new Point(1000, 1000));
RectTransform rectTransform;
if (element.Attribute("relativesize") != null)