* Enable nullability in Content.Client * Remove #nullable enable * Merge fixes * Remove Debug.Assert * Merge fixes * Fix build * Fix build
30 lines
709 B
C#
30 lines
709 B
C#
using Content.Client.GameObjects.EntitySystems;
|
|
using Robust.Client.GameObjects;
|
|
using Robust.Shared.GameObjects;
|
|
|
|
namespace Content.Client.GameObjects.Components.Markers
|
|
{
|
|
[RegisterComponent]
|
|
public sealed class MarkerComponent : Component
|
|
{
|
|
public override string Name => "Marker";
|
|
|
|
protected override void Startup()
|
|
{
|
|
base.Startup();
|
|
|
|
UpdateVisibility();
|
|
}
|
|
|
|
public void UpdateVisibility()
|
|
{
|
|
var system = EntitySystem.Get<MarkerSystem>();
|
|
|
|
if (Owner.TryGetComponent(out ISpriteComponent? sprite))
|
|
{
|
|
sprite.Visible = system.MarkersVisible;
|
|
}
|
|
}
|
|
}
|
|
}
|