2021-11-11 02:15:23 +13:00
|
|
|
using Content.Shared.Labels;
|
2020-12-08 11:56:10 +01:00
|
|
|
using JetBrains.Annotations;
|
2020-10-28 22:51:43 +00:00
|
|
|
using Robust.Client.GameObjects;
|
2021-11-22 23:22:59 -08:00
|
|
|
using Robust.Shared.GameObjects;
|
2021-12-05 18:09:01 +01:00
|
|
|
using Robust.Shared.IoC;
|
2020-10-28 22:51:43 +00:00
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Client.Morgue.Visualizers
|
2020-10-28 22:51:43 +00:00
|
|
|
{
|
2020-12-08 11:56:10 +01:00
|
|
|
[UsedImplicitly]
|
2020-10-28 22:51:43 +00:00
|
|
|
public sealed class BodyBagVisualizer : AppearanceVisualizer
|
|
|
|
|
{
|
|
|
|
|
public override void OnChangeData(AppearanceComponent component)
|
|
|
|
|
{
|
|
|
|
|
base.OnChangeData(component);
|
|
|
|
|
|
2021-12-05 18:09:01 +01:00
|
|
|
var entities = IoCManager.Resolve<IEntityManager>();
|
|
|
|
|
if (!entities.TryGetComponent(component.Owner, out ISpriteComponent? sprite))
|
2020-10-28 22:51:43 +00:00
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-11 02:15:23 +13:00
|
|
|
if (component.TryGetData(PaperLabelVisuals.HasLabel, out bool labelVal))
|
2020-10-28 22:51:43 +00:00
|
|
|
{
|
|
|
|
|
sprite.LayerSetVisible(BodyBagVisualLayers.Label, labelVal);
|
|
|
|
|
}
|
2021-12-29 15:57:20 +11:00
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
sprite.LayerSetVisible(BodyBagVisualLayers.Label, false);
|
|
|
|
|
}
|
2020-10-28 22:51:43 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-04 11:57:33 +01:00
|
|
|
public enum BodyBagVisualLayers : byte
|
2020-10-28 22:51:43 +00:00
|
|
|
{
|
|
|
|
|
Label,
|
|
|
|
|
}
|
|
|
|
|
}
|