Add disposal signalers (#37535)
* Add disposal signalers * Sprite changes * Some requested changes * Requested changes + change spelling to be with two l's to be consistent with the remote signaller
This commit is contained in:
committed by
GitHub
parent
5a93099509
commit
e72e25aba1
14
Content.Server/Disposal/Tube/DisposalSignallerComponent.cs
Normal file
14
Content.Server/Disposal/Tube/DisposalSignallerComponent.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Content.Shared.DeviceLinking;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Server.Disposal.Tube;
|
||||
|
||||
/// <summary>
|
||||
/// Disposal pipes with this component can be linked with devices to send a signal every time an item goes through the pipe
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(DisposalSignallerSystem))]
|
||||
public sealed partial class DisposalSignallerComponent : Component
|
||||
{
|
||||
[DataField]
|
||||
public ProtoId<SourcePortPrototype> Port = "ItemDetected";
|
||||
}
|
||||
25
Content.Server/Disposal/Tube/DisposalSignallerSystem.cs
Normal file
25
Content.Server/Disposal/Tube/DisposalSignallerSystem.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Content.Server.DeviceLinking.Systems;
|
||||
|
||||
namespace Content.Server.Disposal.Tube;
|
||||
|
||||
public sealed class DisposalSignallerSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly DeviceLinkSystem _link = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<DisposalSignallerComponent, ComponentInit>(OnInit);
|
||||
SubscribeLocalEvent<DisposalSignallerComponent, GetDisposalsNextDirectionEvent>(OnGetNextDirection, after: new[] { typeof(DisposalTubeSystem) });
|
||||
}
|
||||
|
||||
private void OnInit(EntityUid uid, DisposalSignallerComponent comp, ComponentInit args)
|
||||
{
|
||||
_link.EnsureSourcePorts(uid, comp.Port);
|
||||
}
|
||||
|
||||
private void OnGetNextDirection(EntityUid uid, DisposalSignallerComponent comp, ref GetDisposalsNextDirectionEvent args)
|
||||
{
|
||||
_link.InvokePort(uid, comp.Port);
|
||||
}
|
||||
}
|
||||
@@ -69,3 +69,6 @@ signal-port-description-power-charging = This port is invoked with HIGH when the
|
||||
|
||||
signal-port-name-power-discharging = Discharging
|
||||
signal-port-description-power-discharging = This port is invoked with HIGH when the battery is losing charge and LOW when not.
|
||||
|
||||
signal-port-name-item-detected = Detected
|
||||
signal-port-description-item-detected = This port is invoked whenever the transmitter detects an item.
|
||||
|
||||
@@ -156,3 +156,9 @@
|
||||
id: PowerDischarging
|
||||
name: signal-port-name-power-discharging
|
||||
description: signal-port-description-power-discharging
|
||||
|
||||
- type: sourcePort
|
||||
id: ItemDetected
|
||||
name: signal-port-name-item-detected
|
||||
description: signal-port-description-item-detected
|
||||
defaultLinks: [ Toggle, Trigger, Timer ]
|
||||
|
||||
@@ -151,6 +151,43 @@
|
||||
containers:
|
||||
- DisposalTagger
|
||||
|
||||
- type: entity
|
||||
id: DisposalSignaller
|
||||
parent: DisposalPipeBase
|
||||
name: disposal signaller
|
||||
description: A pipe that emits a signal when in item goes through it.
|
||||
components:
|
||||
- type: Sprite
|
||||
layers:
|
||||
- map: [ "pipe" ]
|
||||
state: conpipe-signaller
|
||||
- type: DisposalTube
|
||||
containerId: DisposalTransit
|
||||
- type: DisposalTransit
|
||||
- type: DeviceNetwork
|
||||
deviceNetId: Wireless
|
||||
receiveFrequencyId: BasicDevice
|
||||
- type: DeviceLinkSource
|
||||
ports:
|
||||
- ItemDetected
|
||||
- type: WirelessNetworkConnection
|
||||
range: 200
|
||||
- type: DisposalSignaller
|
||||
- type: ContainerContainer
|
||||
containers:
|
||||
DisposalTransit: !type:Container
|
||||
- type: GenericVisualizer
|
||||
visuals:
|
||||
enum.DisposalTubeVisuals.VisualState:
|
||||
pipe:
|
||||
Free: { state: conpipe-signaller }
|
||||
Anchored: { state: pipe-signaller }
|
||||
- type: Construction
|
||||
graph: DisposalPipe
|
||||
node: pipe
|
||||
containers:
|
||||
- DisposalTransit
|
||||
|
||||
- type: entity
|
||||
id: DisposalTrunk
|
||||
parent: DisposalPipeBase
|
||||
|
||||
@@ -14,6 +14,14 @@
|
||||
- material: Steel
|
||||
amount: 2
|
||||
doAfter: 1
|
||||
- to: signaller
|
||||
steps:
|
||||
- material: Steel
|
||||
amount: 2
|
||||
doAfter: 1
|
||||
- material: Cable
|
||||
amount: 1
|
||||
doAfter: 1
|
||||
- to: trunk
|
||||
steps:
|
||||
- material: Steel
|
||||
@@ -108,6 +116,20 @@
|
||||
steps:
|
||||
- tool: Welding
|
||||
doAfter: 1
|
||||
- node: signaller
|
||||
entity: DisposalSignaller
|
||||
edges:
|
||||
- to: start
|
||||
completed:
|
||||
- !type:SpawnPrototype
|
||||
prototype: SheetSteel1
|
||||
amount: 2
|
||||
- !type:SpawnPrototype
|
||||
prototype: CableApcStack1 # I have no idea why this does not work
|
||||
- !type:DeleteEntity
|
||||
steps:
|
||||
- tool: Welding
|
||||
doAfter: 1
|
||||
- node: trunk
|
||||
entity: DisposalTrunk
|
||||
edges:
|
||||
|
||||
@@ -119,6 +119,15 @@
|
||||
placementMode: SnapgridCenter
|
||||
canBuildInImpassable: false
|
||||
|
||||
- type: construction
|
||||
id: DisposalSignaller
|
||||
graph: DisposalPipe
|
||||
startNode: start
|
||||
targetNode: signaller
|
||||
category: construction-category-utilities
|
||||
placementMode: SnapgridCenter
|
||||
canBuildInImpassable: false
|
||||
|
||||
- type: construction
|
||||
id: DisposalTrunk
|
||||
graph: DisposalPipe
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
@@ -5,7 +5,7 @@
|
||||
"y": 32
|
||||
},
|
||||
"license": "CC-BY-SA-3.0",
|
||||
"copyright": "https://github.com/discordia-space/CEV-Eris/blob/bbe32606902c90f5290b57d905a3f31b84dc6d7d/icons/obj/pipes/disposal.dmi and modified by DrSmugleaf. Signal router sprites based on normal router modified by deltanedas (github). disposal bins by EmoGarbage404 (github). pipe-x pipe-xf, conpipe-x by K-Dynamic (github).",
|
||||
"copyright": "https://github.com/discordia-space/CEV-Eris/blob/bbe32606902c90f5290b57d905a3f31b84dc6d7d/icons/obj/pipes/disposal.dmi and modified by DrSmugleaf. Signal router sprites based on normal router modified by deltanedas (github). disposal bins by EmoGarbage404 (github). pipe-x pipe-xf, conpipe-x by K-Dynamic (github). Signaler sprites based on tagger modified by Wolfkey",
|
||||
"states": [
|
||||
{
|
||||
"name": "condisposal",
|
||||
@@ -51,6 +51,10 @@
|
||||
"name": "conpipe-tagger",
|
||||
"directions": 4
|
||||
},
|
||||
{
|
||||
"name": "conpipe-signaller",
|
||||
"directions": 4
|
||||
},
|
||||
{
|
||||
"name": "conpipe-y",
|
||||
"directions": 4
|
||||
@@ -323,6 +327,52 @@
|
||||
"name": "pipe-tagger-partial",
|
||||
"directions": 4
|
||||
},
|
||||
{
|
||||
"name": "pipe-signaller",
|
||||
"directions": 4,
|
||||
"delays": [
|
||||
[
|
||||
0.1,
|
||||
0.141,
|
||||
0.1,
|
||||
0.141,
|
||||
0.1,
|
||||
0.141,
|
||||
0.1,
|
||||
0.141
|
||||
],
|
||||
[
|
||||
0.1,
|
||||
0.141,
|
||||
0.1,
|
||||
0.141,
|
||||
0.1,
|
||||
0.141,
|
||||
0.1,
|
||||
0.141
|
||||
],
|
||||
[
|
||||
0.1,
|
||||
0.141,
|
||||
0.1,
|
||||
0.141,
|
||||
0.1,
|
||||
0.141,
|
||||
0.1,
|
||||
0.141
|
||||
],
|
||||
[
|
||||
0.1,
|
||||
0.141,
|
||||
0.1,
|
||||
0.141,
|
||||
0.1,
|
||||
0.141,
|
||||
0.1,
|
||||
0.141
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "pipe-tf",
|
||||
"directions": 4
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
Reference in New Issue
Block a user