Toilet fixes (#9609)

This commit is contained in:
wrexbe
2022-07-11 23:04:33 -07:00
committed by GitHub
parent 21a56f4b80
commit a1c4f10061
7 changed files with 34 additions and 35 deletions

View File

@@ -0,0 +1,25 @@
using Content.Shared.Toilet;
using Robust.Client.GameObjects;
namespace Content.Client.Toilet;
public sealed class ToiletVisualsSystem : VisualizerSystem<ToiletComponent>
{
protected override void OnAppearanceChange(EntityUid uid, ToiletComponent component, ref AppearanceChangeEvent args)
{
if (args.Sprite == null) return;
args.Component.TryGetData(ToiletVisuals.LidOpen, out bool lidOpen);
args.Component.TryGetData(ToiletVisuals.SeatUp, out bool seatUp);
var state = (lidOpen, seatUp) switch
{
(false, false) => "closed_toilet_seat_down",
(false, true) => "closed_toilet_seat_up",
(true, false) => "open_toilet_seat_down",
(true, true) => "open_toilet_seat_up"
};
args.Sprite.LayerSetState(0, state);
}
}