Indicator fixes (#357)
* - fix: Fix hud showing stealth entities. * - fix: Fix aghost SSD indicator. * - tweak: Make ninja more stealthy.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user