Unstable v0.19.1.0

This commit is contained in:
Juan Pablo Arce
2022-08-19 13:59:08 -03:00
parent 6b55adcdd9
commit 1219615d64
192 changed files with 3875 additions and 2648 deletions
@@ -666,7 +666,7 @@ namespace Barotrauma
GUI.DrawRectangle(spriteBatch, new Rectangle((int)dPos.X, (int)dPos.Y, 256, 32), Color.White);
}
dPos.Y += 48;
GUI.DrawString(spriteBatch, dPos, $"Difficulty: {location.LevelData.Difficulty.FormatZeroDecimal()}", Color.White, Color.Black * 0.8f, 4, font: GUIStyle.SmallFont);
GUI.DrawString(spriteBatch, dPos, $"Difficulty: {location.LevelData.Difficulty.FormatSingleDecimal()}", Color.White, Color.Black * 0.8f, 4, font: GUIStyle.SmallFont);
}
}
}
@@ -981,7 +981,7 @@ namespace Barotrauma
Vector2 center = rectCenter + (connection.CenterPos + viewOffset) * zoom;
if (viewArea.Contains(center) && connection.Biome != null)
{
GUI.DrawString(spriteBatch, center, (connection.LevelData?.GenerationParams?.Identifier ?? connection.Biome.Identifier) + " (" + (int)connection.Difficulty + ")", Color.White);
GUI.DrawString(spriteBatch, center, (connection.LevelData?.GenerationParams?.Identifier ?? connection.Biome.Identifier) + " (" + connection.Difficulty.FormatSingleDecimal() + ")", Color.White);
}
}
@@ -21,6 +21,7 @@ namespace Barotrauma
private static float keyDelay;
public static Vector2 StartMovingPos => startMovingPos;
public static Vector2 SelectionPos => selectionPos;
public event Action<Rectangle> Resized;
@@ -128,7 +129,9 @@ namespace Barotrauma
return;
}
if (GUI.MouseOn != null || !PlayerInput.MouseInsideWindow)
if (startMovingPos == Vector2.Zero
&& selectionPos == Vector2.Zero
&& (GUI.MouseOn != null || !PlayerInput.MouseInsideWindow))
{
if (highlightedListBox == null ||
(GUI.MouseOn != highlightedListBox && !highlightedListBox.IsParentOf(GUI.MouseOn)))
@@ -738,15 +741,6 @@ namespace Barotrauma
/// </summary>
public static void DrawSelecting(SpriteBatch spriteBatch, Camera cam)
{
if (Screen.Selected is SubEditorScreen subEditor)
{
if (subEditor.IsMouseOnEditorGUI()) { return; }
}
else if (GUI.MouseOn != null)
{
return;
}
Vector2 position = PlayerInput.MousePosition;
position = cam.ScreenToWorld(position);
@@ -819,7 +813,7 @@ namespace Barotrauma
selectionPos = Vector2.Zero;
}
}
if (selectionPos != null && selectionPos != Vector2.Zero)
if (selectionPos != Vector2.Zero)
{
var (sizeX, sizeY) = selectionSize;
var (posX, posY) = selectionPos;
@@ -21,7 +21,7 @@ namespace Barotrauma
{
Vector2 position = Submarine.MouseToWorldGrid(cam, Submarine.MainSub);
if (PlayerInput.PrimaryMouseButtonHeld()) placePosition = position;
if (PlayerInput.PrimaryMouseButtonHeld() && GUI.MouseOn == null) placePosition = position;
}
else
{
@@ -39,7 +39,7 @@ namespace Barotrauma
newRect.Location -= MathUtils.ToPoint(Submarine.MainSub.Position);
}
if (PlayerInput.PrimaryMouseButtonReleased())
if (PlayerInput.PrimaryMouseButtonReleased() && GUI.MouseOn == null)
{
CreateInstance(newRect);
placePosition = Vector2.Zero;
@@ -27,7 +27,7 @@ namespace Barotrauma
if (placePosition == Vector2.Zero)
{
if (PlayerInput.PrimaryMouseButtonHeld())
if (PlayerInput.PrimaryMouseButtonClicked() && GUI.MouseOn == null)
placePosition = Submarine.MouseToWorldGrid(cam, Submarine.MainSub);
newRect.X = (int)position.X;