diff --git a/Content.Server/Atmos/Piping/Binary/Components/GasPressurePumpComponent.cs b/Content.Server/Atmos/Piping/Binary/Components/GasPressurePumpComponent.cs index 8816e1af220..27df32b3ec1 100644 --- a/Content.Server/Atmos/Piping/Binary/Components/GasPressurePumpComponent.cs +++ b/Content.Server/Atmos/Piping/Binary/Components/GasPressurePumpComponent.cs @@ -27,5 +27,10 @@ public sealed partial class GasPressurePumpComponent : Component [ViewVariables(VVAccess.ReadWrite)] [DataField("maxTargetPressure")] public float MaxTargetPressure = Atmospherics.MaxOutputPressure; + + /// Corvax-Next-AutoPipes-Start + [DataField] + public bool StartOnMapInit { get; set; } = false; + /// Corvax-Next-AutoPipes-End } } diff --git a/Content.Server/Atmos/Piping/Binary/Components/GasVolumePumpComponent.cs b/Content.Server/Atmos/Piping/Binary/Components/GasVolumePumpComponent.cs index 36ced3887d2..99cb9b5cf22 100644 --- a/Content.Server/Atmos/Piping/Binary/Components/GasVolumePumpComponent.cs +++ b/Content.Server/Atmos/Piping/Binary/Components/GasVolumePumpComponent.cs @@ -46,5 +46,10 @@ public sealed partial class GasVolumePumpComponent : Component [DataField("lastMolesTransferred")] public float LastMolesTransferred; + + /// Corvax-Next-AutoPipes-Start + [DataField] + public bool StartOnMapInit { get; set; } = false; + /// Corvax-Next-AutoPipes-End } } diff --git a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasPressurePumpSystem.cs b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasPressurePumpSystem.cs index abd34396a0c..2f0226ee4e3 100644 --- a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasPressurePumpSystem.cs +++ b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasPressurePumpSystem.cs @@ -44,6 +44,8 @@ public override void Initialize() // Bound UI subscriptions SubscribeLocalEvent(OnOutputPressureChangeMessage); SubscribeLocalEvent(OnToggleStatusMessage); + + SubscribeLocalEvent(OnMapInit); // Corvax-Next-AutoPipes } private void OnInit(EntityUid uid, GasPressurePumpComponent pump, ComponentInit args) @@ -165,5 +167,19 @@ private void UpdateAppearance(EntityUid uid, GasPressurePumpComponent? pump = nu bool pumpOn = pump.Enabled && (TryComp(uid, out var power) && power.Powered); _appearance.SetData(uid, PumpVisuals.Enabled, pumpOn, appearance); } + + /// Corvax-Next-AutoPipes-Start + private void OnMapInit(EntityUid uid, GasPressurePumpComponent pump, MapInitEvent args) + { + if (pump.StartOnMapInit) + { + pump.Enabled = true; + UpdateAppearance(uid, pump); + + DirtyUI(uid, pump); + _userInterfaceSystem.CloseUi(uid, GasPressurePumpUiKey.Key); + } + } + /// Corvax-Next-AutoPipes-End } } diff --git a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasVolumePumpSystem.cs b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasVolumePumpSystem.cs index 9ddd7dce67d..596c9500bd0 100644 --- a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasVolumePumpSystem.cs +++ b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasVolumePumpSystem.cs @@ -52,6 +52,8 @@ public override void Initialize() SubscribeLocalEvent(OnToggleStatusMessage); SubscribeLocalEvent(OnPacketRecv); + + SubscribeLocalEvent(OnMapInit); // Corvax-Next-AutoPipes } private void OnInit(EntityUid uid, GasVolumePumpComponent pump, ComponentInit args) @@ -218,5 +220,19 @@ private void OnPacketRecv(EntityUid uid, GasVolumePumpComponent component, Devic return; } } + + /// Corvax-Next-AutoPipes-Start + private void OnMapInit(EntityUid uid, GasVolumePumpComponent pump, MapInitEvent args) + { + if (pump.StartOnMapInit) + { + pump.Enabled = true; + UpdateAppearance(uid, pump); + + DirtyUI(uid, pump); + _userInterfaceSystem.CloseUi(uid, GasVolumePumpUiKey.Key); + } + } + /// Corvax-Next-AutoPipes-End } } diff --git a/Content.Server/Atmos/Piping/Trinary/Components/GasMixerComponent.cs b/Content.Server/Atmos/Piping/Trinary/Components/GasMixerComponent.cs index fc219923c10..512f92ff69b 100644 --- a/Content.Server/Atmos/Piping/Trinary/Components/GasMixerComponent.cs +++ b/Content.Server/Atmos/Piping/Trinary/Components/GasMixerComponent.cs @@ -38,5 +38,10 @@ public sealed partial class GasMixerComponent : Component [ViewVariables(VVAccess.ReadWrite)] [DataField("inletTwoConcentration")] public float InletTwoConcentration = 0.5f; + + /// Corvax-Next-AutoPipes-Start + [DataField] + public bool StartOnMapInit { get; set; } = false; + /// Corvax-Next-AutoPipes-Start } } diff --git a/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasMixerSystem.cs b/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasMixerSystem.cs index 178caeaa4a9..cefa5d278ec 100644 --- a/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasMixerSystem.cs +++ b/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasMixerSystem.cs @@ -43,6 +43,8 @@ public override void Initialize() SubscribeLocalEvent(OnToggleStatusMessage); SubscribeLocalEvent(OnMixerLeaveAtmosphere); + + SubscribeLocalEvent(OnMapInit); // Corvax-Next-AutoPipes } private void OnInit(EntityUid uid, GasMixerComponent mixer, ComponentInit args) @@ -235,5 +237,19 @@ private void OnMixerAnalyzed(EntityUid uid, GasMixerComponent component, GasAnal args.DeviceFlipped = inletOne != null && inletTwo != null && inletOne.CurrentPipeDirection.ToDirection() == inletTwo.CurrentPipeDirection.ToDirection().GetClockwise90Degrees(); } + + // Corvax-Next-AutoPipes-Start + private void OnMapInit(EntityUid uid, GasMixerComponent mixer, MapInitEvent args) // Frontier - Init on map + { + if (mixer.StartOnMapInit) + { + mixer.Enabled = true; + DirtyUI(uid, mixer); + + UpdateAppearance(uid, mixer); + _userInterfaceSystem.CloseUi(uid, GasFilterUiKey.Key); + } + } + // Corvax-Next-AutoPipes-End } } diff --git a/Resources/Locale/ru-RU/ss14-ru/prototypes/_corvaxnext/entities/structures/piping/atmospherics/binary.ftl b/Resources/Locale/ru-RU/ss14-ru/prototypes/_corvaxnext/entities/structures/piping/atmospherics/binary.ftl new file mode 100644 index 00000000000..6e2534f2b99 --- /dev/null +++ b/Resources/Locale/ru-RU/ss14-ru/prototypes/_corvaxnext/entities/structures/piping/atmospherics/binary.ftl @@ -0,0 +1,9 @@ +ent-GasPressurePumpOn = { ent-GasPressurePump } + .desc = { ent-GasPressurePump.desc } + .suffix = ВКЛ +ent-GasPressurePumpOnMax = { ent-GasPressurePump } + .desc = { ent-GasPressurePump.desc } + .suffix = ВКЛ, 4500 +ent-GasVolumePumpOn = { ent-GasVolumePump } + .desc = { ent-GasVolumePump.desc } + .suffix = ВКЛ diff --git a/Resources/Locale/ru-RU/ss14-ru/prototypes/_corvaxnext/entities/structures/piping/atmospherics/trinary.ftl b/Resources/Locale/ru-RU/ss14-ru/prototypes/_corvaxnext/entities/structures/piping/atmospherics/trinary.ftl new file mode 100644 index 00000000000..3d25e8f497e --- /dev/null +++ b/Resources/Locale/ru-RU/ss14-ru/prototypes/_corvaxnext/entities/structures/piping/atmospherics/trinary.ftl @@ -0,0 +1,6 @@ +ent-GasMixerOn = { ent-GasMixer } + .desc = { ent-GasMixer.desc } + .suffix = ВКЛ +ent-GasMixerOnFlipped = { ent-GasMixerFlipped } + .desc = { ent-GasMixerFlipped.desc } + .suffix = ВКЛ, Перевёрнутый diff --git a/Resources/Prototypes/_CorvaxNext/Entities/Structures/Piping/Atmospherics/binary.yml b/Resources/Prototypes/_CorvaxNext/Entities/Structures/Piping/Atmospherics/binary.yml new file mode 100644 index 00000000000..290445acb87 --- /dev/null +++ b/Resources/Prototypes/_CorvaxNext/Entities/Structures/Piping/Atmospherics/binary.yml @@ -0,0 +1,29 @@ +- type: entity + parent: GasPressurePump + id: GasPressurePumpOn + suffix: On + placement: + mode: SnapgridCenter + components: + - type: GasPressurePump + startOnMapInit: true + +- type: entity + parent: GasPressurePumpOn + id: GasPressurePumpOnMax + suffix: On, Max + placement: + mode: SnapgridCenter + components: + - type: GasPressurePump + targetPressure: 4500 + +- type: entity + parent: GasVolumePump + id: GasVolumePumpOn + suffix: On + placement: + mode: SnapgridCenter + components: + - type: GasVolumePump + startOnMapInit: true diff --git a/Resources/Prototypes/_CorvaxNext/Entities/Structures/Piping/Atmospherics/trinary.yml b/Resources/Prototypes/_CorvaxNext/Entities/Structures/Piping/Atmospherics/trinary.yml new file mode 100644 index 00000000000..e38e070b1fc --- /dev/null +++ b/Resources/Prototypes/_CorvaxNext/Entities/Structures/Piping/Atmospherics/trinary.yml @@ -0,0 +1,16 @@ +- type: entity + parent: GasMixer + id: GasMixerOn + suffix: On + placement: + mode: SnapgridCenter + components: + - type: GasMixer + startOnMapInit: true + +- type: entity + parent: [GasMixerFlipped, GasMixerOn] + id: GasMixerOnFlipped + suffix: On, Flipped + placement: + mode: SnapgridCenter