Remove SpriteChange construction action (#15887)

This commit is contained in:
Leon Friedrich 2023-04-29 20:58:15 +12:00 committed by GitHub
parent 447f08b10a
commit ce153a7986
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 40 deletions

View File

@ -1,30 +0,0 @@
using Content.Shared.Construction;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Shared.Utility;
namespace Content.Server.Construction.Completions
{
[UsedImplicitly]
[DataDefinition]
public sealed class SpriteChange : IGraphAction
{
[DataField("layer")] public int Layer { get; private set; } = 0;
[DataField("specifier")] public SpriteSpecifier? SpriteSpecifier { get; private set; } = SpriteSpecifier.Invalid;
public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager)
{
if (SpriteSpecifier == null || SpriteSpecifier == SpriteSpecifier.Invalid)
return;
if (!entityManager.TryGetComponent(uid, out SpriteComponent? sprite))
return;
// That layer doesn't exist, we do nothing.
if (sprite.LayerCount <= Layer)
return;
sprite.LayerSetSprite(Layer, SpriteSpecifier);
}
}
}

View File

@ -15,11 +15,6 @@
- node: girder
entity: Girder
actions:
- !type:SpriteChange
specifier:
sprite: /Textures/Structures/Walls/solid.rsi
state: wall_girder
edges:
- to: start
completed:

View File

@ -11,11 +11,6 @@
doAfter: 1
- node: frame
entity: DisposalMachineFrame
actions:
- !type:SpriteChange
specifier:
sprite: /Textures/Structures/Piping/high_pressure_machine_frame.rsi
state: frame
edges:
- to: start
completed: