mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* First impl. of appearance TryGetData cleanup * Handful of fixes * DamageVisuals: fix HandleDamage call, inheritdoc * bunch of unused AppearanceSystem instances * Handful more unused appearance systems, inheritdoc * JetpackSystem: Ent<T> * cleanup roundup, more Ent<T> * a few lingering AppearanceSystem.TryGetData calls * more lingering AppearanceData access * Remove unnecessary inheritdoc * once again, with feeling
49 lines
1.3 KiB
C#
49 lines
1.3 KiB
C#
using Content.Shared.Delivery;
|
|
using Content.Shared.StatusIcon;
|
|
using Robust.Client.GameObjects;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Client.Delivery;
|
|
|
|
public sealed partial class DeliveryVisualizerSystem : VisualizerSystem<DeliveryComponent>
|
|
{
|
|
private static readonly ProtoId<JobIconPrototype> UnknownIcon = "JobIconUnknown";
|
|
|
|
protected override void OnAppearanceChange(EntityUid uid, DeliveryComponent component, ref AppearanceChangeEvent args)
|
|
{
|
|
if (args.Sprite == null)
|
|
return;
|
|
|
|
args.TryGetData<string>(DeliveryVisuals.JobIcon, out var job);
|
|
|
|
if (string.IsNullOrEmpty(job))
|
|
job = UnknownIcon;
|
|
|
|
if (!ProtoMan.TryIndex<JobIconPrototype>(job, out var icon))
|
|
{
|
|
SpriteSystem.LayerSetTexture((uid, args.Sprite), DeliveryVisualLayers.JobStamp, SpriteSystem.Frame0(ProtoMan.Index(UnknownIcon).Icon));
|
|
return;
|
|
}
|
|
|
|
SpriteSystem.LayerSetTexture((uid, args.Sprite), DeliveryVisualLayers.JobStamp, SpriteSystem.Frame0(icon.Icon));
|
|
}
|
|
}
|
|
|
|
public enum DeliveryVisualLayers : byte
|
|
{
|
|
Icon,
|
|
Lock,
|
|
FragileStamp,
|
|
JobStamp,
|
|
PriorityTape,
|
|
Breakage,
|
|
Trash,
|
|
Bomb,
|
|
BombPrimed,
|
|
}
|
|
|
|
public enum DeliverySpawnerVisualLayers : byte
|
|
{
|
|
Contents,
|
|
}
|
|
|