Changes the SingularitySystem to use generic visualizers (#15057)
This commit is contained in:
@@ -82,22 +82,6 @@ public sealed class SingularityComponent : Component
|
||||
|
||||
#endregion Audio
|
||||
|
||||
#region Appearance
|
||||
|
||||
/// <summary>
|
||||
/// The sprite layer the singularity appearance is attached to.
|
||||
/// </summary>
|
||||
[DataField("layer")]
|
||||
public int Layer { get; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// The base sprite file and state of the singularity.
|
||||
/// </summary>
|
||||
[DataField("baseSprite")]
|
||||
public SpriteSpecifier.Rsi BaseSprite = new SpriteSpecifier.Rsi(new ResourcePath("Structures/Power/Generation/Singularity/singularity"), "singularity");
|
||||
|
||||
#endregion Appearance
|
||||
|
||||
#region Update Timing
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -126,7 +126,7 @@ public abstract class SharedSingularitySystem : EntitySystem
|
||||
|
||||
RaiseLocalEvent(uid, new SingularityLevelChangedEvent(singularity.Level, oldValue, singularity));
|
||||
if (singularity.Level <= 0)
|
||||
EntityManager.DeleteEntity(singularity.Owner);
|
||||
QueueDel(uid);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -366,7 +366,7 @@ public abstract class SharedSingularitySystem : EntitySystem
|
||||
/// <param name="args">The event arguments.</param>
|
||||
private void UpdateAppearance(EntityUid uid, AppearanceComponent comp, SingularityLevelChangedEvent args)
|
||||
{
|
||||
_visualizer.SetData(uid, SingularityVisuals.Level, args.NewValue, comp);
|
||||
_visualizer.SetData(uid, SingularityAppearanceKeys.Singularity, args.NewValue, comp);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
namespace Content.Shared.Singularity
|
||||
{
|
||||
[Serializable, NetSerializable]
|
||||
public enum SingularityVisuals
|
||||
public enum SingularityAppearanceKeys
|
||||
{
|
||||
Level
|
||||
Singularity
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user