Toilet (#3012)
* Ported sprites from eris * Added yml * lid open/close logic * interactivity * Working on new secret stash component * Object will drop on destruction * Can get item and examine message * Reagent container and some cleaning * Moved potted plant to stash * New base prefab * Now you can deconstruct toilet * Small fixes * Fixed unknown components errors * Fixed grammar errors Co-authored-by: Paul Ritter <ritter.paul1@googlemail.com> * Now use prob * More grammar * Update Content.Server/Construction/Conditions/ToiletLidClosed.cs Aaaaaaaa Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * No delays * Amazing sound design * Moved sound to mono * Toilet viz Co-authored-by: Paul Ritter <ritter.paul1@googlemail.com> Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
#nullable enable
|
||||
using Content.Shared.GameObjects.Components.Watercloset;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Interfaces.GameObjects.Components;
|
||||
|
||||
namespace Content.Client.GameObjects.Components.Watercloset
|
||||
{
|
||||
public class ToiletVisualizer : AppearanceVisualizer
|
||||
{
|
||||
public override void OnChangeData(AppearanceComponent component)
|
||||
{
|
||||
base.OnChangeData(component);
|
||||
|
||||
if (!component.Owner.TryGetComponent(out ISpriteComponent? sprite)) return;
|
||||
|
||||
if (!component.TryGetData(ToiletVisuals.LidOpen, out bool lidOpen)) lidOpen = false;
|
||||
if (!component.TryGetData(ToiletVisuals.SeatUp, out bool seatUp)) seatUp = false;
|
||||
|
||||
var state = string.Format("{0}_toilet_{1}",
|
||||
lidOpen ? "open" : "closed",
|
||||
seatUp ? "seat_up" : "seat_down");
|
||||
|
||||
sprite.LayerSetState(0, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user