Files
Delta-v/Content.Client/Overlays/ShowCrewIconsSystem.cs
T
SlamBamActionmanandslarticodefast 53fcd12147 Add Cyborg crew indicator (#37038)
* Initial commit

* Include uncertain crew and make it work for AI

* Add new definition to Silicon Rules 8

* Update based on review

* Remove Cluwne from job list

* ProtoIdify

* Update and also make monkey/corgi show IDs

* Remove unnecessary property

* Remove redundant code

* Carrrrd

* cleanup

* Nicer code

* Update to fix the spawn bug + agent ID

* Fix new icons

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2026-06-29 12:43:44 +02:00

35 lines
978 B
C#

using Content.Shared.Inventory.Events;
using Content.Shared.Overlays;
namespace Content.Client.Overlays;
// The GetStatusIconsEvent subscription is handled in JobStatusSystem
public sealed class ShowCrewIconsSystem : EquipmentHudSystem<ShowCrewIconsComponent>
{
public bool UncertainCrewBorder = false;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<ShowCrewIconsComponent, AfterAutoHandleStateEvent>(OnHandleState);
}
protected override void UpdateInternal(RefreshEquipmentHudEvent<ShowCrewIconsComponent> component)
{
base.UpdateInternal(component);
UncertainCrewBorder = false;
foreach (var comp in component.Components)
{
if (comp.UncertainCrewBorder)
UncertainCrewBorder = true;
}
}
private void OnHandleState(Entity<ShowCrewIconsComponent> ent, ref AfterAutoHandleStateEvent args)
{
RefreshOverlay();
}
}