Unstable 1.8.4.0

This commit is contained in:
Markus Isberg
2025-03-12 12:56:27 +00:00
parent a4c3e868e4
commit a4a3427e4e
627 changed files with 29860 additions and 10018 deletions
@@ -8,6 +8,7 @@ namespace Barotrauma.Particles
{
class ParticleEmitterProperties : ISerializableEntity
{
private const float MinValue = int.MinValue,
MaxValue = int.MaxValue;
@@ -98,8 +99,11 @@ namespace Barotrauma.Particles
[Editable, Serialize(1f, IsPropertySaveable.Yes)]
public float LifeTimeMultiplier { get; set; }
[Editable, Serialize(false, IsPropertySaveable.Yes)]
public bool DrawOnTop { get; set; }
[Editable, Serialize(false, IsPropertySaveable.Yes, description: "Should the particle be drawn as a tracer (a line from a weapon to the point it hit)? Only supported on hitscan projectiles and repair tools. Defaults to true on hitscan projectiles.")]
public bool UseTracerPoints { get; set; }
[Editable, Serialize(ParticleDrawOrder.Default, IsPropertySaveable.Yes)]
public ParticleDrawOrder DrawOrder { get; set; }
[Serialize(0f, IsPropertySaveable.Yes)]
public float Angle
@@ -127,6 +131,12 @@ namespace Barotrauma.Particles
public ParticleEmitterProperties(XElement element)
{
SerializableProperties = SerializableProperty.DeserializeProperties(this, element);
//backwards compatibility
if (element.GetAttributeBool("drawontop", false))
{
DrawOrder = ParticleDrawOrder.Foreground;
}
}
}
@@ -215,7 +225,9 @@ namespace Barotrauma.Particles
position += dir * Rand.Range(Prefab.Properties.DistanceMin, Prefab.Properties.DistanceMax);
}
var particle = GameMain.ParticleManager.CreateParticle(particlePrefab, position, velocity, particleRotation, hullGuess, particlePrefab.DrawOnTop || Prefab.DrawOnTop, lifeTimeMultiplier: Prefab.Properties.LifeTimeMultiplier, tracerPoints: tracerPoints);
var particle = GameMain.ParticleManager.CreateParticle(particlePrefab, position, velocity, particleRotation, hullGuess,
particlePrefab.DrawOrder != ParticleDrawOrder.Default ? particlePrefab.DrawOrder : Prefab.DrawOrder,
lifeTimeMultiplier: Prefab.Properties.LifeTimeMultiplier, tracerPoints: Prefab.Properties.UseTracerPoints ? tracerPoints : null);
if (particle != null)
{
@@ -286,7 +298,9 @@ namespace Barotrauma.Particles
public readonly ContentPackage? ContentPackage;
public bool DrawOnTop => Properties.DrawOnTop || ParticlePrefab is { DrawOnTop: true };
public ParticleDrawOrder DrawOrder => Properties.DrawOrder != ParticleDrawOrder.Default ?
Properties.DrawOrder :
(ParticlePrefab?.DrawOrder ?? ParticleDrawOrder.Default);
public ParticleEmitterPrefab(ContentXElement element)
{