Dock device link port (#27646)
* Add dock device link port * SpawnAndDeleteAllEntitiesInTheSameSpot moment * The fuck is TryStopNukeOpsFromConstantlyFailing?? Do we have a new test that can randomly fail?
This commit is contained in:
@@ -0,0 +1,14 @@
|
|||||||
|
using Content.Shared.DeviceLinking;
|
||||||
|
using Robust.Shared.Prototypes;
|
||||||
|
|
||||||
|
namespace Content.Server.Shuttles.Components;
|
||||||
|
|
||||||
|
[RegisterComponent]
|
||||||
|
public sealed partial class DockingSignalControlComponent : Component
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Output port that is high while docked.
|
||||||
|
/// </summary>
|
||||||
|
[DataField]
|
||||||
|
public ProtoId<SourcePortPrototype> DockStatusSignalPort = "DockStatus";
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
using Content.Server.DeviceLinking.Systems;
|
||||||
|
using Content.Server.Shuttles.Components;
|
||||||
|
using Content.Server.Shuttles.Events;
|
||||||
|
|
||||||
|
namespace Content.Server.Shuttles.Systems;
|
||||||
|
|
||||||
|
public sealed class DockingSignalControlSystem : EntitySystem
|
||||||
|
{
|
||||||
|
[Dependency] private readonly DeviceLinkSystem _deviceLinkSystem = default!;
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
|
||||||
|
SubscribeLocalEvent<DockingSignalControlComponent, DockEvent>(OnDocked);
|
||||||
|
SubscribeLocalEvent<DockingSignalControlComponent, UndockEvent>(OnUndocked);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDocked(Entity<DockingSignalControlComponent> ent, ref DockEvent args)
|
||||||
|
{
|
||||||
|
_deviceLinkSystem.SendSignal(ent, ent.Comp.DockStatusSignalPort, signal: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnUndocked(Entity<DockingSignalControlComponent> ent, ref UndockEvent args)
|
||||||
|
{
|
||||||
|
_deviceLinkSystem.SendSignal(ent, ent.Comp.DockStatusSignalPort, signal: false);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,6 +19,9 @@ signal-port-description-right = This port is invoked whenever the lever is moved
|
|||||||
signal-port-name-doorstatus = Door status
|
signal-port-name-doorstatus = Door status
|
||||||
signal-port-description-doorstatus = This port is invoked with HIGH when the door opens and LOW when the door finishes closing.
|
signal-port-description-doorstatus = This port is invoked with HIGH when the door opens and LOW when the door finishes closing.
|
||||||
|
|
||||||
|
signal-port-name-dockstatus = Dock status
|
||||||
|
signal-port-description-dockstatus = This port is invoked with HIGH when docked and LOW when undocked.
|
||||||
|
|
||||||
signal-port-name-middle = Middle
|
signal-port-name-middle = Middle
|
||||||
signal-port-description-middle = This port is invoked whenever the lever is moved to the neutral position.
|
signal-port-description-middle = This port is invoked whenever the lever is moved to the neutral position.
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,11 @@
|
|||||||
description: signal-port-description-doorstatus
|
description: signal-port-description-doorstatus
|
||||||
defaultLinks: [ DoorBolt ]
|
defaultLinks: [ DoorBolt ]
|
||||||
|
|
||||||
|
- type: sourcePort
|
||||||
|
id: DockStatus
|
||||||
|
name: signal-port-name-dockstatus
|
||||||
|
description: signal-port-description-dockstatus
|
||||||
|
|
||||||
- type: sourcePort
|
- type: sourcePort
|
||||||
id: OrderSender
|
id: OrderSender
|
||||||
name: signal-port-name-order-sender
|
name: signal-port-name-order-sender
|
||||||
|
|||||||
@@ -6,6 +6,11 @@
|
|||||||
description: Necessary for connecting two space craft together.
|
description: Necessary for connecting two space craft together.
|
||||||
components:
|
components:
|
||||||
- type: Docking
|
- type: Docking
|
||||||
|
- type: DockingSignalControl
|
||||||
|
- type: DeviceLinkSource
|
||||||
|
ports:
|
||||||
|
- DoorStatus
|
||||||
|
- DockStatus
|
||||||
- type: Fixtures
|
- type: Fixtures
|
||||||
fixtures:
|
fixtures:
|
||||||
fix1:
|
fix1:
|
||||||
@@ -75,7 +80,6 @@
|
|||||||
suffix: Glass, Docking
|
suffix: Glass, Docking
|
||||||
description: Necessary for connecting two space craft together.
|
description: Necessary for connecting two space craft together.
|
||||||
components:
|
components:
|
||||||
- type: Docking
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Structures/Doors/Airlocks/Glass/shuttle.rsi
|
sprite: Structures/Doors/Airlocks/Glass/shuttle.rsi
|
||||||
snapCardinals: false
|
snapCardinals: false
|
||||||
@@ -127,7 +131,6 @@
|
|||||||
suffix: Glass, Docking
|
suffix: Glass, Docking
|
||||||
description: Necessary for connecting two space craft together.
|
description: Necessary for connecting two space craft together.
|
||||||
components:
|
components:
|
||||||
- type: Docking
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Structures/Doors/Airlocks/Glass/shuttle_syndicate.rsi
|
sprite: Structures/Doors/Airlocks/Glass/shuttle_syndicate.rsi
|
||||||
snapCardinals: false
|
snapCardinals: false
|
||||||
|
|||||||
Reference in New Issue
Block a user