mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
remove SetLayerVisibility, doesnt work for some reason
This commit is contained in:
parent
9354abb024
commit
cf2a1ecd5d
1 changed files with 0 additions and 29 deletions
|
|
@ -1,29 +0,0 @@
|
|||
using System.Threading.Tasks;
|
||||
using Content.Shared.Construction;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Server.Construction.Completions
|
||||
{
|
||||
[DataDefinition]
|
||||
public class SetLayerVisibility : IGraphAction
|
||||
{
|
||||
[DataField("layer")] public int Layer { get; private set; } = 0;
|
||||
|
||||
[DataField("value")] public bool Value { get; private set; } = true;
|
||||
|
||||
public async Task PerformAction(IEntity entity, IEntity? user)
|
||||
{
|
||||
if (entity.Deleted) return;
|
||||
|
||||
if (!entity.TryGetComponent(out SpriteComponent? sprite)) return;
|
||||
|
||||
// That layer doesn't exist, we do nothing.
|
||||
if (sprite.LayerCount <= Layer) return;
|
||||
|
||||
sprite.LayerSetVisible(Layer, Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue