mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 21:48:58 +03:00
* the definition of insanity * the definition of insanity * the definition of insanity * we have hullrot at home * maybe the real hullrot was the friends we made along the way * john hullrot * i am going to hullroooooot * it's hullrotver * we're so hullback * we're rotting the hull with this one * hullmerge * the hullrot is leaking * never gonna rot you up * hullfresh * john starsector * god i wish we had grid collision damage
43 lines
1.4 KiB
C#
43 lines
1.4 KiB
C#
using Content.Shared.Power;
|
|
using Robust.Client.GameObjects;
|
|
|
|
namespace Content.Client.PowerCell;
|
|
|
|
public sealed class PowerChargerVisualizerSystem : VisualizerSystem<PowerChargerVisualsComponent>
|
|
{
|
|
protected override void OnAppearanceChange(EntityUid uid, PowerChargerVisualsComponent comp, ref AppearanceChangeEvent args)
|
|
{
|
|
if (args.Sprite == null)
|
|
return;
|
|
|
|
// Update base item
|
|
if (AppearanceSystem.TryGetData<bool>(uid, CellVisual.Occupied, out var occupied, args.Component) && occupied)
|
|
{
|
|
// TODO: don't throw if it doesn't have a full state
|
|
args.Sprite.LayerSetState(PowerChargerVisualLayers.Base, comp.OccupiedState);
|
|
}
|
|
else
|
|
{
|
|
args.Sprite.LayerSetState(PowerChargerVisualLayers.Base, comp.EmptyState);
|
|
}
|
|
|
|
// Update lighting
|
|
if (AppearanceSystem.TryGetData<CellChargerStatus>(uid, CellVisual.Light, out var status, args.Component)
|
|
&& comp.LightStates.TryGetValue(status, out var lightState))
|
|
{
|
|
args.Sprite.LayerSetState(PowerChargerVisualLayers.Light, lightState);
|
|
args.Sprite.LayerSetVisible(PowerChargerVisualLayers.Light, true);
|
|
}
|
|
else
|
|
//
|
|
args.Sprite.LayerSetVisible(PowerChargerVisualLayers.Light, false);
|
|
}
|
|
}
|
|
|
|
enum PowerChargerVisualLayers : byte
|
|
{
|
|
Base,
|
|
Light,
|
|
ItemDisplay,
|
|
}
|