Files
Delta-v/Content.Client/SSDIndicator/SSDIndicatorSystem.cs
T
William Lemonandpre-commit-ci[bot] 48bec2057b Fractured Form - New Psionic Power (#4506)
* Initial Fractured Form Pass

* Cleanup

* AAAAAAAAAAAAAAAAAAA

* I forgor

* Sometimes naked

* Untouch and touch where applikcable

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Better optional pattern

* Unbreak it

* Minor Spelling Mistake

* Filthy test fix hack

* Filthy hack to appease the test gods

* A normal number of post-PR commits

* AAAAAAA

* Don't know why I didn't do this in the first place

* Some cleanup

* Damn how did I miss this

* Delta Mandated Cleanup

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-10-15 06:42:43 +11:00

49 lines
1.6 KiB
C#

using Content.Shared._DV.Mind; // DeltaV
using Content.Shared.CCVar; // DeltaV
using Content.Shared.Mind.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.NPC;
using Content.Shared.SSDIndicator;
using Content.Shared.StatusIcon;
using Content.Shared.StatusIcon.Components;
using Robust.Shared.Configuration;
using Robust.Shared.Prototypes;
namespace Content.Client.SSDIndicator;
/// <summary>
/// Handles displaying SSD indicator as status icon
/// </summary>
public sealed class SSDIndicatorSystem : EntitySystem
{
[Dependency] private readonly IPrototypeManager _prototype = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly MobStateSystem _mobState = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SSDIndicatorComponent, GetStatusIconsEvent>(OnGetStatusIcon);
}
private void OnGetStatusIcon(EntityUid uid, SSDIndicatorComponent component, ref GetStatusIconsEvent args)
{
if (component.IsSSD &&
_cfg.GetCVar(CCVars.ICShowSSDIndicator) &&
!_mobState.IsDead(uid) &&
!HasComp<ActiveNPCComponent>(uid) &&
TryComp<MindContainerComponent>(uid, out var mindContainer) &&
mindContainer.ShowExamineInfo)
{
// Begin DeltaV Addition
var ev = new ShowSSDIndicatorEvent();
RaiseLocalEvent(uid, ref ev);
if (ev.Hidden)
return;
// End DeltaV Addition
args.StatusIcons.Add(_prototype.Index(component.Icon));
}
}
}