private bool SetupEye(Entity<StationAiCoreComponent> ent)
{
+ if (_net.IsClient)
+ return false;
if (ent.Comp.RemoteEntity != null)
return false;
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)
if (_timing.ApplyingState)
return;
+ SetupEye(ent);
+
// Just so text and the likes works properly
_metadata.SetEntityName(ent.Owner, MetaData(args.Entity).EntityName);
{
_eye.SetTarget(args.Entity, null, eyeComp);
}
+ ClearEye(ent);
}
private void UpdateAppearance(Entity<StationAiHolderComponent?> entity)
public override void Initialize()
{
SubscribeLocalEvent<IntrinsicUIComponent, MapInitEvent>(InitActions);
+ SubscribeLocalEvent<IntrinsicUIComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<IntrinsicUIComponent, ToggleIntrinsicUIEvent>(OnActionToggle);
}
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)
id: LockerFillResearchDirectorNoHardsuit
table: !type:AllSelector
children:
+ - id: Intellicard
- id: BoxEncryptionKeyScience
- id: CircuitImprinterMachineCircuitboard
- id: ClothingBeltUtilityFilled
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
- type: StationAiHolder
slot:
name: station-ai-mind-slot
- locked: true
+ locked: false
+ disableEject: true
whitelist:
tags:
- StationAi
# 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:
enum.SiliconLawsUiKey.Key:
type: SiliconLawBoundUserInterface
- type: ComplexInteraction
- - type: DoorRemote
- type: Actions
- type: Access
groups: