Indicator fixes (#357)

* - fix: Fix hud showing stealth entities.

* - fix: Fix aghost SSD indicator.

* - tweak: Make ninja more stealthy.
This commit is contained in:
Aviu00
2024-06-15 13:11:59 +00:00
committed by GitHub
parent 7072dd31d2
commit 73954e87b1
8 changed files with 78 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
using Content.Client.Interactable.Components;
using Content.Client.StatusIcon;
using Content.Shared.Stealth;
using Content.Shared.Stealth.Components;
using Robust.Client.GameObjects;
@@ -18,9 +19,12 @@ public sealed class StealthSystem : SharedStealthSystem
base.Initialize();
_shader = _protoMan.Index<ShaderPrototype>("Stealth").InstanceUnique();
SubscribeLocalEvent<StealthComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<StealthComponent, ComponentStartup>(OnStartup);
SubscribeLocalEvent<StealthComponent, BeforePostShaderRenderEvent>(OnShaderRender);
SubscribeLocalEvent<StealthComponent, StatusIconVisibleEvent>(OnStatusIconVisible);
}
public override void SetEnabled(EntityUid uid, bool value, StealthComponent? component = null)
@@ -92,5 +96,12 @@ public sealed class StealthSystem : SharedStealthSystem
visibility = MathF.Max(0, visibility);
args.Sprite.Color = new Color(visibility, visibility, 1, 1);
}
private void OnStatusIconVisible(EntityUid uid, StealthComponent comp, ref StatusIconVisibleEvent args)
{
// no sechud seing invisible ninjas
if (comp.Enabled)
args.Visible = false;
}
}