Release 1.9.7.0 - Summer Update 2025

This commit is contained in:
Regalis11
2025-06-17 16:38:11 +03:00
parent 22227f13e5
commit ea5a2bc693
297 changed files with 7344 additions and 2421 deletions
@@ -47,9 +47,8 @@ namespace Barotrauma
public readonly List<MapEntity> linkedTo = new List<MapEntity>();
protected bool flippedX, flippedY;
public bool FlippedX { get { return flippedX; } }
public bool FlippedY { get { return flippedY; } }
public bool FlippedX { get; protected set; }
public bool FlippedY { get; protected set; }
public bool ShouldBeSaved = true;
@@ -91,6 +90,16 @@ namespace Barotrauma
}
}
public virtual float RotationRad { get; protected set; }
/// <summary>
/// Rotation taking into account flipping: if the entity is flipped on either axis, the rotation is negated
/// (but not if it's flipped on both axes, two flips is essentially double negation).
/// </summary>
public float RotationRadWithFlipping => FlippedX ^ FlippedY ? -RotationRad : RotationRad;
public float RotationWithFlipping => MathHelper.ToDegrees(RotationRadWithFlipping);
public virtual Rectangle Rect
{
get { return rect; }
@@ -697,9 +706,10 @@ namespace Barotrauma
/// Flip the entity horizontally
/// </summary>
/// <param name="relativeToSub">Should the entity be flipped across the y-axis of the sub it's inside</param>
public virtual void FlipX(bool relativeToSub)
/// <param name="force">Forces the item to be flipped even if it's configured not to be flippable.</param>
public virtual void FlipX(bool relativeToSub, bool force = false)
{
flippedX = !flippedX;
FlippedX = !FlippedX;
if (!relativeToSub || Submarine == null) { return; }
Vector2 relative = WorldPosition - Submarine.WorldPosition;
@@ -711,9 +721,10 @@ namespace Barotrauma
/// Flip the entity vertically
/// </summary>
/// <param name="relativeToSub">Should the entity be flipped across the x-axis of the sub it's inside</param>
public virtual void FlipY(bool relativeToSub)
/// <param name="force">Forces the item to be flipped even if it's configured not to be flippable.</param>
public virtual void FlipY(bool relativeToSub, bool force = false)
{
flippedY = !flippedY;
FlippedY = !FlippedY;
if (!relativeToSub || Submarine == null) { return; }
Vector2 relative = WorldPosition - Submarine.WorldPosition;