* Engine namespace changes.
* Automated remove redundant using statements.
* Simplified Graphics namespace.
* Apparently the container system stores full type names in the map file.😞 This updates those names.
* API Changes to LocalizationManager.LoadCulture.
* Update submodule to v0.3.2
26 lines
855 B
C#
26 lines
855 B
C#
#nullable enable
|
|
using Content.Shared.GameObjects.Components.Watercloset;
|
|
using Robust.Client.GameObjects;
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|