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

@@ -285,6 +285,8 @@ public abstract partial class SharedStationAiSystem : EntitySystem
private bool SetupEye(Entity<StationAiCoreComponent> ent)
{
if (_net.IsClient)
return false;
if (ent.Comp.RemoteEntity != null)
return false;
@@ -299,8 +301,11 @@ public abstract partial class SharedStationAiSystem : EntitySystem
private void ClearEye(Entity<StationAiCoreComponent> ent)
{
if (_net.IsClient)
return;
QueueDel(ent.Comp.RemoteEntity);
ent.Comp.RemoteEntity = null;
Dirty(ent);
}
private void AttachEye(Entity<StationAiCoreComponent> ent)
@@ -330,6 +335,8 @@ public abstract partial class SharedStationAiSystem : EntitySystem
if (_timing.ApplyingState)
return;
SetupEye(ent);
// Just so text and the likes works properly
_metadata.SetEntityName(ent.Owner, MetaData(args.Entity).EntityName);
@@ -351,6 +358,7 @@ public abstract partial class SharedStationAiSystem : EntitySystem
{
_eye.SetTarget(args.Entity, null, eyeComp);
}
ClearEye(ent);
}
private void UpdateAppearance(Entity<StationAiHolderComponent?> entity)

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)

View File

@@ -261,6 +261,7 @@
id: LockerFillResearchDirectorNoHardsuit
table: !type:AllSelector
children:
- id: Intellicard
- id: BoxEncryptionKeyScience
- id: CircuitImprinterMachineCircuitboard
- id: ClothingBeltUtilityFilled

View File

@@ -71,6 +71,26 @@
title: comms-console-announcement-title-station-ai
color: "#2ed2fd"
- type: entity
id: AiHeldIntellicard
description: Components added / removed from an entity that gets inserted into an Intellicard.
categories: [ HideSpawnMenu ]
components:
- type: IntrinsicRadioReceiver
- type: IntrinsicRadioTransmitter
channels:
- Binary
- type: ActiveRadio
channels:
- Binary
- Common
- type: ActionGrant
actions:
- ActionAIViewLaws
- type: UserInterface
interfaces:
enum.SiliconLawsUiKey.Key:
type: SiliconLawBoundUserInterface
# Ai
- type: entity
@@ -82,7 +102,8 @@
- type: StationAiHolder
slot:
name: station-ai-mind-slot
locked: true
locked: false
disableEject: true
whitelist:
tags:
- StationAi
@@ -256,13 +277,16 @@
# Items
- type: entity
id: Intellicard
name: Intellicard
name: intellicard
description: A storage device for AIs.
parent:
- BaseItem
- AiHolder
suffix: Empty
components:
- type: ContainerComp
proto: AiHeldIntellicard
container: station_ai_mind_slot
- type: Sprite
sprite: Objects/Devices/ai_card.rsi
layers:
@@ -361,7 +385,6 @@
enum.SiliconLawsUiKey.Key:
type: SiliconLawBoundUserInterface
- type: ComplexInteraction
- type: DoorRemote
- type: Actions
- type: Access
groups:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB