(bf212a41f) v0.9.2.0 pre-release test version

This commit is contained in:
Joonas Rikkonen
2019-07-27 21:06:07 +03:00
parent afa2137bd2
commit 0f63da27b2
154 changed files with 3959 additions and 1428 deletions
@@ -278,7 +278,7 @@ namespace Barotrauma
Color.White, Color.Black * 0.5f, 0, SmallFont);
DrawString(spriteBatch, new Vector2(10, 40),
"Bodies: " + GameMain.World.BodyList.Count + " (" + GameMain.World.BodyList.FindAll(b => b.Awake && b.Enabled).Count + " awake)",
$"Bodies: {GameMain.World.BodyList.Count} ({GameMain.World.BodyList.FindAll(b => b.Awake && b.Enabled).Count} awake, {GameMain.World.BodyList.FindAll(b => b.Awake && b.BodyType == FarseerPhysics.Dynamics.BodyType.Dynamic && b.Enabled).Count} dynamic)",
Color.White, Color.Black * 0.5f, 0, SmallFont);
if (Screen.Selected.Cam != null)
@@ -1040,6 +1040,8 @@ namespace Barotrauma
public static Texture2D CreateRectangle(int width, int height)
{
width = Math.Max(width, 1);
height = Math.Max(height, 1);
Color[] data = new Color[width * height];
for (int i = 0; i < data.Length; i++)
@@ -1057,7 +1059,6 @@ namespace Barotrauma
TrySetArray(data, (height - 1) * width + x, Color.White);
}
Texture2D texture = null;
CrossThread.RequestExecutionOnMainThread(() =>
{
@@ -178,25 +178,27 @@ namespace Barotrauma
}
else if (DrawLoadingText)
{
string loadText = "";
if (LoadState == 100.0f)
if (TextManager.Initialized)
{
loadText = TextManager.Get("PressAnyKey");
}
else
{
loadText = TextManager.Get("Loading");
if (LoadState != null)
string loadText;
if (LoadState == 100.0f)
{
loadText += " " + (int)LoadState + " %";
loadText = TextManager.Get("PressAnyKey");
}
else
{
loadText = TextManager.Get("Loading");
if (LoadState != null)
{
loadText += " " + (int)LoadState + " %";
}
}
if (GUI.LargeFont != null)
{
GUI.LargeFont.DrawString(spriteBatch, loadText.ToUpper(),
new Vector2(GameMain.GraphicsWidth / 2.0f - GUI.LargeFont.MeasureString(loadText).X / 2.0f, GameMain.GraphicsHeight * 0.7f),
Color.White);
}
}
if (GUI.LargeFont != null)
{
GUI.LargeFont.DrawString(spriteBatch, loadText.ToUpper(),
new Vector2(GameMain.GraphicsWidth / 2.0f - GUI.LargeFont.MeasureString(loadText).X / 2.0f, GameMain.GraphicsHeight * 0.7f),
Color.White);
}
if (GUI.Font != null && selectedTip != null)
@@ -58,6 +58,8 @@ namespace Barotrauma
public event Action<SpriteBatch, float> PreDraw;
public event Action<SpriteBatch, float> PostDraw;
public bool RequireMouseOn = true;
public Action refresh;
public object data;
@@ -109,7 +111,7 @@ namespace Barotrauma
{
PreUpdate?.Invoke(deltaTime);
if (!enabled) { return; }
if (IsMouseOver)
if (IsMouseOver || (!RequireMouseOn && selectedWidgets.Contains(this) && PlayerInput.LeftButtonHeld()))
{
Hovered?.Invoke();
if ((multiselect && !selectedWidgets.Contains(this)) || selectedWidgets.None())