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:
@@ -285,6 +285,8 @@ public abstract partial class SharedStationAiSystem : EntitySystem
|
|||||||
|
|
||||||
private bool SetupEye(Entity<StationAiCoreComponent> ent)
|
private bool SetupEye(Entity<StationAiCoreComponent> ent)
|
||||||
{
|
{
|
||||||
|
if (_net.IsClient)
|
||||||
|
return false;
|
||||||
if (ent.Comp.RemoteEntity != null)
|
if (ent.Comp.RemoteEntity != null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -299,8 +301,11 @@ public abstract partial class SharedStationAiSystem : EntitySystem
|
|||||||
|
|
||||||
private void ClearEye(Entity<StationAiCoreComponent> ent)
|
private void ClearEye(Entity<StationAiCoreComponent> ent)
|
||||||
{
|
{
|
||||||
|
if (_net.IsClient)
|
||||||
|
return;
|
||||||
QueueDel(ent.Comp.RemoteEntity);
|
QueueDel(ent.Comp.RemoteEntity);
|
||||||
ent.Comp.RemoteEntity = null;
|
ent.Comp.RemoteEntity = null;
|
||||||
|
Dirty(ent);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AttachEye(Entity<StationAiCoreComponent> ent)
|
private void AttachEye(Entity<StationAiCoreComponent> ent)
|
||||||
@@ -330,6 +335,8 @@ public abstract partial class SharedStationAiSystem : EntitySystem
|
|||||||
if (_timing.ApplyingState)
|
if (_timing.ApplyingState)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
SetupEye(ent);
|
||||||
|
|
||||||
// Just so text and the likes works properly
|
// Just so text and the likes works properly
|
||||||
_metadata.SetEntityName(ent.Owner, MetaData(args.Entity).EntityName);
|
_metadata.SetEntityName(ent.Owner, MetaData(args.Entity).EntityName);
|
||||||
|
|
||||||
@@ -351,6 +358,7 @@ public abstract partial class SharedStationAiSystem : EntitySystem
|
|||||||
{
|
{
|
||||||
_eye.SetTarget(args.Entity, null, eyeComp);
|
_eye.SetTarget(args.Entity, null, eyeComp);
|
||||||
}
|
}
|
||||||
|
ClearEye(ent);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateAppearance(Entity<StationAiHolderComponent?> entity)
|
private void UpdateAppearance(Entity<StationAiHolderComponent?> entity)
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ public sealed class IntrinsicUISystem : EntitySystem
|
|||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
SubscribeLocalEvent<IntrinsicUIComponent, MapInitEvent>(InitActions);
|
SubscribeLocalEvent<IntrinsicUIComponent, MapInitEvent>(InitActions);
|
||||||
|
SubscribeLocalEvent<IntrinsicUIComponent, ComponentShutdown>(OnShutdown);
|
||||||
SubscribeLocalEvent<IntrinsicUIComponent, ToggleIntrinsicUIEvent>(OnActionToggle);
|
SubscribeLocalEvent<IntrinsicUIComponent, ToggleIntrinsicUIEvent>(OnActionToggle);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,6 +22,15 @@ public sealed class IntrinsicUISystem : EntitySystem
|
|||||||
args.Handled = InteractUI(uid, args.Key, component);
|
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)
|
private void InitActions(EntityUid uid, IntrinsicUIComponent component, MapInitEvent args)
|
||||||
{
|
{
|
||||||
foreach (var entry in component.UIs.Values)
|
foreach (var entry in component.UIs.Values)
|
||||||
|
|||||||
@@ -261,6 +261,7 @@
|
|||||||
id: LockerFillResearchDirectorNoHardsuit
|
id: LockerFillResearchDirectorNoHardsuit
|
||||||
table: !type:AllSelector
|
table: !type:AllSelector
|
||||||
children:
|
children:
|
||||||
|
- id: Intellicard
|
||||||
- id: BoxEncryptionKeyScience
|
- id: BoxEncryptionKeyScience
|
||||||
- id: CircuitImprinterMachineCircuitboard
|
- id: CircuitImprinterMachineCircuitboard
|
||||||
- id: ClothingBeltUtilityFilled
|
- id: ClothingBeltUtilityFilled
|
||||||
|
|||||||
@@ -71,6 +71,26 @@
|
|||||||
title: comms-console-announcement-title-station-ai
|
title: comms-console-announcement-title-station-ai
|
||||||
color: "#2ed2fd"
|
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
|
# Ai
|
||||||
- type: entity
|
- type: entity
|
||||||
@@ -82,7 +102,8 @@
|
|||||||
- type: StationAiHolder
|
- type: StationAiHolder
|
||||||
slot:
|
slot:
|
||||||
name: station-ai-mind-slot
|
name: station-ai-mind-slot
|
||||||
locked: true
|
locked: false
|
||||||
|
disableEject: true
|
||||||
whitelist:
|
whitelist:
|
||||||
tags:
|
tags:
|
||||||
- StationAi
|
- StationAi
|
||||||
@@ -256,13 +277,16 @@
|
|||||||
# Items
|
# Items
|
||||||
- type: entity
|
- type: entity
|
||||||
id: Intellicard
|
id: Intellicard
|
||||||
name: Intellicard
|
name: intellicard
|
||||||
description: A storage device for AIs.
|
description: A storage device for AIs.
|
||||||
parent:
|
parent:
|
||||||
- BaseItem
|
- BaseItem
|
||||||
- AiHolder
|
- AiHolder
|
||||||
suffix: Empty
|
suffix: Empty
|
||||||
components:
|
components:
|
||||||
|
- type: ContainerComp
|
||||||
|
proto: AiHeldIntellicard
|
||||||
|
container: station_ai_mind_slot
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Devices/ai_card.rsi
|
sprite: Objects/Devices/ai_card.rsi
|
||||||
layers:
|
layers:
|
||||||
@@ -361,7 +385,6 @@
|
|||||||
enum.SiliconLawsUiKey.Key:
|
enum.SiliconLawsUiKey.Key:
|
||||||
type: SiliconLawBoundUserInterface
|
type: SiliconLawBoundUserInterface
|
||||||
- type: ComplexInteraction
|
- type: ComplexInteraction
|
||||||
- type: DoorRemote
|
|
||||||
- type: Actions
|
- type: Actions
|
||||||
- type: Access
|
- type: Access
|
||||||
groups:
|
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 |
Reference in New Issue
Block a user