v1.5.7.0 (Summer Update)

This commit is contained in:
Regalis11
2024-06-18 16:49:51 +03:00
parent 4a63dacbce
commit 230d1b6e78
263 changed files with 7792 additions and 2845 deletions
@@ -15,7 +15,7 @@ namespace Barotrauma
public DeformableSprite DeformableSprite { get; private set; }
public Sprite ActiveSprite => Sprite ?? DeformableSprite.Sprite;
public ConditionalSprite(ContentXElement element, ISerializableEntity target, string file = "", bool lazyLoad = false)
public ConditionalSprite(ContentXElement element, ISerializableEntity target, string file = "", bool lazyLoad = false, float sourceRectScale = 1)
{
Target = target;
Exclusive = element.GetAttributeBool("exclusive", Exclusive);
@@ -28,10 +28,10 @@ namespace Barotrauma
conditionals.AddRange(PropertyConditional.FromXElement(subElement));
break;
case "sprite":
Sprite = new Sprite(subElement, file: file, lazyLoad: lazyLoad);
Sprite = new Sprite(subElement, file: file, lazyLoad: lazyLoad, sourceRectScale: sourceRectScale);
break;
case "deformablesprite":
DeformableSprite = new DeformableSprite(subElement, filePath: file, lazyLoad: lazyLoad);
DeformableSprite = new DeformableSprite(subElement, filePath: file, lazyLoad: lazyLoad, sourceRectScale: sourceRectScale);
break;
}
}
@@ -18,9 +18,9 @@ namespace Barotrauma
public Sprite Sprite { get; private set; }
public DeformableSprite(ContentXElement element, int? subdivisionsX = null, int? subdivisionsY = null, string filePath = "", bool lazyLoad = false, bool invert = false)
public DeformableSprite(ContentXElement element, int? subdivisionsX = null, int? subdivisionsY = null, string filePath = "", bool lazyLoad = false, bool invert = false, float sourceRectScale = 1)
{
Sprite = new Sprite(element, file: filePath, lazyLoad: lazyLoad);
Sprite = new Sprite(element, file: filePath, lazyLoad: lazyLoad, sourceRectScale: sourceRectScale);
InitProjSpecific(element, subdivisionsX, subdivisionsY, lazyLoad, invert);
}
@@ -107,7 +107,7 @@ namespace Barotrauma
static partial void AddToList(Sprite sprite);
public Sprite(ContentXElement element, string path = "", string file = "", bool lazyLoad = false)
public Sprite(ContentXElement element, string path = "", string file = "", bool lazyLoad = false, float sourceRectScale = 1)
{
if (element is null)
{
@@ -137,7 +137,7 @@ namespace Barotrauma
LoadTexture(ref sourceVector, ref shouldReturn);
}
if (shouldReturn) { return; }
sourceRect = new Rectangle((int)sourceVector.X, (int)sourceVector.Y, (int)sourceVector.Z, (int)sourceVector.W);
sourceRect = new Rectangle((int)(sourceVector.X * sourceRectScale), (int)(sourceVector.Y * sourceRectScale), (int)(sourceVector.Z * sourceRectScale), (int)(sourceVector.W * sourceRectScale));
size = SourceElement.GetAttributeVector2("size", Vector2.One);
RelativeSize = size;
size.X *= sourceRect.Width;