Adding intellicard functionality. (#32347)

* init

* im so confused

* clean

* sprite update

* :|

* further attempts

* be blessed for it works

* Very prestigious pAI

* cleaning up

* Intellicard in RD locker

* PAIn't

* .Clear()n't

* .Clear()n't for real this time

* Cleaning up

* Whoopsie Daisy
This commit is contained in:
ScarKy0
2024-10-22 15:49:39 +02:00
committed by GitHub
parent fc2bb79ef3
commit 9873efd514
7 changed files with 45 additions and 3 deletions

View File

@@ -10,6 +10,7 @@ public sealed class IntrinsicUISystem : EntitySystem
public override void Initialize()
{
SubscribeLocalEvent<IntrinsicUIComponent, MapInitEvent>(InitActions);
SubscribeLocalEvent<IntrinsicUIComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<IntrinsicUIComponent, ToggleIntrinsicUIEvent>(OnActionToggle);
}
@@ -21,6 +22,15 @@ public sealed class IntrinsicUISystem : EntitySystem
args.Handled = InteractUI(uid, args.Key, component);
}
private void OnShutdown(EntityUid uid, IntrinsicUIComponent component, ref ComponentShutdown args)
{
foreach (var actionEntry in component.UIs.Values)
{
var actionId = actionEntry.ToggleActionEntity;
_actionsSystem.RemoveAction(uid, actionId);
}
}
private void InitActions(EntityUid uid, IntrinsicUIComponent component, MapInitEvent args)
{
foreach (var entry in component.UIs.Values)