Selectable Bar Signs (#29068)

* make bar sign selectable

* ajcm strongest soldier

* AJCM comes down hard for round 2

* good shit

* ok ballin

* bless'ed be the webedit
This commit is contained in:
Nemanja
2024-06-30 12:20:57 -04:00
committed by GitHub
parent f6bb10503f
commit 162913ccd0
11 changed files with 300 additions and 98 deletions

View File

@@ -1,3 +1,4 @@
using Content.Client.BarSign.Ui;
using Content.Shared.BarSign;
using Content.Shared.Power;
using Robust.Client.GameObjects;
@@ -8,6 +9,7 @@ namespace Content.Client.BarSign;
public sealed class BarSignSystem : VisualizerSystem<BarSignComponent>
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly UserInterfaceSystem _ui = default!;
public override void Initialize()
{
@@ -17,6 +19,9 @@ public sealed class BarSignSystem : VisualizerSystem<BarSignComponent>
private void OnAfterAutoHandleState(EntityUid uid, BarSignComponent component, ref AfterAutoHandleStateEvent args)
{
if (_ui.TryGetOpenUi<BarSignBoundUserInterface>(uid, BarSignUiKey.Key, out var bui))
bui.Update(component.Current);
UpdateAppearance(uid, component);
}
@@ -34,9 +39,9 @@ public sealed class BarSignSystem : VisualizerSystem<BarSignComponent>
if (powered
&& sign.Current != null
&& _prototypeManager.TryIndex(sign.Current, out BarSignPrototype? proto))
&& _prototypeManager.TryIndex(sign.Current, out var proto))
{
sprite.LayerSetState(0, proto.Icon);
sprite.LayerSetSprite(0, proto.Icon);
sprite.LayerSetShader(0, "unshaded");
}
else