mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-10 02:41:18 +03:00
* Remove all IPrototypeManager instances * Remove redundant IComponentFactory instances too * Found some stragglers * DestructibleSystem.PrototypeManager: no dependency * not based
51 lines
1.4 KiB
C#
51 lines
1.4 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>
|
|
{
|
|
[Dependency] private SharedAppearanceSystem _appearance = default!;
|
|
|
|
private static readonly ProtoId<JobIconPrototype> UnknownIcon = "JobIconUnknown";
|
|
|
|
protected override void OnAppearanceChange(EntityUid uid, DeliveryComponent component, ref AppearanceChangeEvent args)
|
|
{
|
|
if (args.Sprite == null)
|
|
return;
|
|
|
|
_appearance.TryGetData(uid, DeliveryVisuals.JobIcon, out string job, args.Component);
|
|
|
|
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,
|
|
}
|
|
|