(7684c5e4e) Moved structure TextureScale and TextureOffset from the client project to shared. Excluding them from the server project caused them to reset when the server saves the sub in the multiplayer campaign.

This commit is contained in:
Joonas Rikkonen
2019-06-14 14:04:26 +03:00
parent 36149834ab
commit fd70f5107e
2 changed files with 25 additions and 32 deletions

View File

@@ -30,43 +30,14 @@ namespace Barotrauma
return HasBody ? ShowWalls : ShowStructures;;
}
}
// Only for testing in the debug build. Not saved.
protected Vector2 textureScale = Vector2.One;
[Editable(DecimalCount = 3, MinValueFloat = 0.01f, MaxValueFloat = 10f, ValueStep = 0.1f), Serialize("1.0, 1.0", false)]
public Vector2 TextureScale
{
get { return textureScale; }
set
{
textureScale = new Vector2(
MathHelper.Clamp(value.X, 0.01f, 10),
MathHelper.Clamp(value.Y, 0.01f, 10));
}
}
private string specialTag;
[Editable, Serialize("", true)]
public string SpecialTag
{
get { return specialTag; }
set { specialTag = value; }
}
// Only for testing in the debug build. Not saved.
#if DEBUG
[Editable, Serialize(true, false)]
#endif
public bool DrawTiled { get; protected set; } = true;
protected Vector2 textureOffset = Vector2.Zero;
[Editable(MinValueFloat = -1000f, MaxValueFloat = 1000f, ValueStep = 10f), Serialize("0.0, 0.0", true)]
public Vector2 TextureOffset
{
get { return textureOffset; }
set { textureOffset = value; }
}
}
partial void InitProjSpecific()
{

View File

@@ -183,6 +183,29 @@ namespace Barotrauma
}
}
protected Vector2 textureScale = Vector2.One;
[Editable(DecimalCount = 3, MinValueFloat = 0.01f, MaxValueFloat = 10f, ValueStep = 0.1f), Serialize("1.0, 1.0", false)]
public Vector2 TextureScale
{
get { return textureScale; }
set
{
textureScale = new Vector2(
MathHelper.Clamp(value.X, 0.01f, 10),
MathHelper.Clamp(value.Y, 0.01f, 10));
}
}
protected Vector2 textureOffset = Vector2.Zero;
[Editable(MinValueFloat = -1000f, MaxValueFloat = 1000f, ValueStep = 10f), Serialize("0.0, 0.0", true)]
public Vector2 TextureOffset
{
get { return textureOffset; }
set { textureOffset = value; }
}
private Rectangle defaultRect;
public override Rectangle Rect
@@ -296,9 +319,8 @@ namespace Barotrauma
defaultRect = rectangle;
rect = rectangle;
#if CLIENT
TextureScale = sp.TextureScale;
#endif
spriteColor = prefab.SpriteColor;
if (sp.IsHorizontal.HasValue)
{