From a2b737d94563e3de80c80bbc71e78e4ebf976c63 Mon Sep 17 00:00:00 2001 From: Vera Aguilera Puerto <6766154+Zumorica@users.noreply.github.com> Date: Sat, 19 Jun 2021 13:25:05 +0200 Subject: [PATCH] Atmos pipe rework (#3833) * Initial * Cleanup a bunch of things * some changes dunno * RequireAnchored * a * stuff * more work * Lots of progress * delete pipe visualizer * a * b * pipenet and pipenode cleanup * Fixes * Adds GasValve * Adds GasMiner * Fix stuff, maybe? * More fixes * Ignored components on the client * Adds thermomachine behavior, change a bunch of stuff * Remove Anchored * some work, but it's shitcode * significantly more ECS * ECS AtmosDevices * Cleanup * fix appearance * when the pipe direction is sus * Gas tanks and canisters * pipe anchoring and stuff * coding is my passion * Unsafe pipes take longer to unanchor * turns out we're no longer using eris canisters * Gas canister inserted tank appearance, improvements * Work on a bunch of appearances * Scrubber appearance * Reorganize AtmosphereSystem.Piping into a bunch of different systems * Appearance for vent/scrubber/pump turns off when leaving atmosphere * ThermoMachine appearance * Cleanup gas tanks * Remove passive gate unused imports * remove old canister UI functionality * PipeNode environment air, make everything use AssumeAir instead of merging manually * a * Reorganize atmos to follow new structure * ????? * Canister UI, restructure client * Restructure shared * Fix build tho * listen, at least the canister UI works entirely... * fix build : ) * Atmos device prototypes have names and descriptions * gas canister ui slider doesn't jitter * trinary prototypes * sprite for miners * ignore components * fix YAML * Fix port system doing useless thing * Fix build * fix thinking moment * fix build again because * canister direction * pipenode is a word * GasTank Air will throw on invalid states * fix build.... * Unhardcode volume pump thresholds * Volume pump and filter take time into account * Rename Join/Leave atmosphere events to AtmosDeviceEnabled/Disabled Event * Gas tank node volume is set by initial mixtuer * I love node container --- .../UI/Tabs/AtmosTab/AddGasWindow.xaml.cs | 3 +- .../UI/Tabs/AtmosTab/FillGasWindow.xaml.cs | 3 +- .../Components}/GasAnalyzerComponent.cs | 4 +- .../EntitySystems/AtmosDebugOverlaySystem.cs | 7 +- .../EntitySystems/AtmosphereSystem.cs | 4 +- .../EntitySystems/GasTileOverlaySystem.cs | 7 +- .../Atmos/{ => Overlays}/AtmosDebugOverlay.cs | 9 +- .../Atmos/{ => Overlays}/GasTileOverlay.cs | 6 +- .../Piping/EnabledAtmosDeviceVisualizer.cs | 39 +++ .../Atmos/Piping/OutletInjectorVisualizer.cs | 18 + .../Atmos/Piping/PassiveVentVisualizer.cs | 18 + .../Atmos/Piping/PipeConnectorVisualizer.cs | 7 +- .../Atmos/Piping/PressurePumpVisualizer.cs | 18 + .../Atmos/Piping/ScrubberVisualizer.cs | 52 +++ .../Atmos/Piping/ThermoMachineVisualizer.cs | 18 + .../Atmos/Piping/VentPumpVisualizer.cs | 47 +++ .../UI}/GasAnalyzerBoundUserInterface.cs | 4 +- .../Atmos => Atmos/UI}/GasAnalyzerMenu.cs | 4 +- .../Atmos/UI/GasCanisterBoundUserInterface.cs | 86 +++++ .../Atmos/UI/GasCanisterWindow.xaml | 52 +++ .../Atmos/UI/GasCanisterWindow.xaml.cs | 98 ++++++ .../Visualizers}/AtmosPlaqueVisualizer.cs | 4 +- .../Visualizers}/FireVisualizer.cs | 4 +- .../Visualizers}/GasAnalyzerVisualizer.cs | 4 +- .../Visualizers/GasCanisterVisualizer.cs | 54 +++ .../Visualizers/GasPortableVisualizer.cs} | 24 +- .../Visualizers}/VaporVisualizer.cs | 3 +- Content.Client/Commands/AtmosDebugCommands.cs | 2 +- Content.Client/Commands/DebugCommands.cs | 6 - .../Commands/GroupingContextMenuCommand.cs | 1 - .../ComputerBoundUserInterface.cs | 0 .../ConstructionPlacementHijack.cs | 1 - Content.Client/Entry/IgnoredComponents.cs | 16 +- .../Atmos/GasCanisterBoundUserInterface.cs | 118 ------- .../Components/Atmos/GasCanisterWindow.cs | 167 --------- .../Atmos/Piping/GasFilterVisualizer.cs | 42 --- .../Components/Atmos/Piping/PipeVisualizer.cs | 72 ---- .../Components/Atmos/Piping/PumpVisualizer.cs | 42 --- .../Atmos/Piping/SiphonVisualizer.cs | 42 --- .../Components/Atmos/Piping/VentVisualizer.cs | 42 --- Content.Client/Ghost/GhostGui.cs | 1 - .../Power/SolarControlWindow.xaml | 0 .../Power/SolarControlWindow.xaml.cs | 0 Content.Client/Sandbox/SandboxManager.cs | 3 - .../GasTank/GasTankBoundUserInterface.cs | 2 +- .../Atmos/GasTank/GasTankWindow.cs | 2 +- .../Tests/Atmos/ConstantsTest.cs | 2 +- .../Tests/ClickableTest.cs | 1 - .../Tests/Gravity/WeightlessStatusTests.cs | 2 - .../Tests/Interaction/InRangeUnobstructed.cs | 1 - .../Networking/SimplePredictReconcileTest.cs | 1 - .../Containers/TargetAccessibleCon.cs | 1 - Content.Server/Alert/Click/ResistFire.cs | 2 +- Content.Server/Alert/Click/StopPulling.cs | 1 - Content.Server/Atmos/AtmosHelpers.cs | 2 +- .../Components}/AirtightComponent.cs | 48 ++- .../Components}/AtmosExposedComponent.cs | 3 +- .../Components/AtmosPlaqueComponent.cs | 4 +- .../Components}/BarotraumaComponent.cs | 2 +- .../BaseComputerUserInterfaceComponent.cs | 1 - .../Components}/BreathToolComponent.cs | 2 +- .../Components}/FirelockComponent.cs | 8 +- .../Components}/FlammableComponent.cs | 6 +- .../Components}/GasAnalyzerComponent.cs | 9 +- .../Components}/GasMixtureHolderComponent.cs | 7 +- .../Components}/GasTankComponent.cs | 48 ++- .../Components}/GridAtmosphereComponent.cs | 50 +-- .../IGridAtmosphereComponent.cs | 14 +- .../Components}/MovedByPressureComponent.cs | 2 +- .../PressureProtectionComponent.cs | 4 +- .../SpaceGridAtmosphereComponent.cs | 3 +- .../UnsimulatedGridAtmosphereComponent.cs | 13 +- .../Atmos/EntitySystems/AirtightSystem.cs | 26 ++ .../EntitySystems}/AtmosDebugOverlaySystem.cs | 8 +- .../EntitySystems/AtmosphereSystem.CVars.cs | 24 ++ .../EntitySystems/AtmosphereSystem.Gases.cs | 34 ++ .../EntitySystems/AtmosphereSystem.cs | 185 +++++----- .../ComputerUIActivatorSystem.cs | 5 - .../EntitySystems/GasAnalyzerSystem.cs | 4 +- .../EntitySystems/GasTankSystem.cs | 4 +- .../EntitySystems}/GasTileOverlaySystem.cs | 9 +- Content.Server/Atmos/ExcitedGroup.cs | 2 +- Content.Server/Atmos/GasMixture.cs | 18 +- .../Binary/Components/GasCanisterComponent.cs | 52 +++ .../Components/GasPassiveGateComponent.cs | 35 ++ .../Binary/Components/GasPortComponent.cs | 19 ++ .../Components/GasPressurePumpComponent.cs | 27 ++ .../Binary/Components/GasValveComponent.cs | 55 +++ .../Components/GasVolumePumpComponent.cs | 42 +++ .../Binary/EntitySystems/GasCanisterSystem.cs | 247 ++++++++++++++ .../EntitySystems/GasPassiveGateSystem.cs | 53 +++ .../EntitySystems/GasPressurePumpSystem.cs | 67 ++++ .../EntitySystems/GasVolumePumpSystem.cs | 70 ++++ .../Piping/Components/AtmosDeviceComponent.cs | 61 ++++ .../AtmosUnsafeUnanchorComponent.cs | 16 + .../Piping/EntitySystems/AtmosDeviceSystem.cs | 92 +++++ .../AtmosUnsafeUnanchorSystem.cs | 80 +++++ .../Other/Components/GasMinerComponent.cs | 37 ++ .../Other/EntitySystems/GasMinerSystem.cs | 71 ++++ .../Trinary/Components/GasFilterComponent.cs | 35 ++ .../Trinary/Components/GasMixerComponent.cs | 37 ++ .../Trinary/EntitySystems/GasFilterSystem.cs | 66 ++++ .../Trinary/EntitySystems/GasMixerSystem.cs | 95 ++++++ .../Components/GasOutletInjectorComponent.cs | 26 ++ .../Components/GasPassiveVentComponent.cs | 14 + .../Unary/Components/GasPortableComponent.cs | 16 + .../Components/GasThermoMachineComponent.cs | 90 +++++ .../Unary/Components/GasVentPumpComponent.cs | 50 +++ .../Components/GasVentScrubberComponent.cs | 45 +++ .../EntitySystems/GasOutletInjectorSystem.cs | 50 +++ .../EntitySystems/GasPassiveVentSystem.cs | 61 ++++ .../Unary/EntitySystems/GasPortableSystem.cs | 92 +++++ .../Unary/EntitySystems/GasTankSystem.cs | 35 ++ .../EntitySystems/GasThermoMachineSystem.cs | 59 ++++ .../Unary/EntitySystems/GasVentPumpSystem.cs | 101 ++++++ .../EntitySystems/GasVentScrubberSystem.cs | 108 ++++++ .../Atmos/Reactions/WaterVaporReaction.cs | 1 - Content.Server/Atmos/TileAtmosphere.cs | 4 +- Content.Server/Body/Behavior/LungBehavior.cs | 2 +- .../Body/Respiratory/InternalsComponent.cs | 2 +- .../Components/ChemMasterComponent.cs | 1 - .../Components/HyposprayComponent.cs | 1 - .../Chemistry/Components/InjectorComponent.cs | 1 - .../Chemistry/Components/PillComponent.cs | 1 - .../Components/ReagentDispenserComponent.cs | 1 - .../Components/SolutionAreaEffectComponent.cs | 2 +- .../Components/SolutionTransferComponent.cs | 1 - .../AddToSolutionReaction.cs | 1 - .../ExtinguishReaction.cs | 3 +- .../FlammableReaction.cs | 3 +- .../WashCreamPieReaction.cs | 1 - .../Clothing/Components/ClothingComponent.cs | 1 - .../Clothing/Components/MagbootsComponent.cs | 3 +- .../Commands/Atmos/AddAtmosCommand.cs | 3 +- .../Commands/Atmos/AddGasCommand.cs | 2 +- .../Atmos/AddUnsimulatedAtmosCommand.cs | 3 +- .../Commands/Atmos/DeleteGasCommand.cs | 2 +- .../Commands/Atmos/FillGasCommand.cs | 3 +- Content.Server/Commands/Atmos/FixGridAtmos.cs | 2 +- .../Commands/Atmos/ListGasesCommand.cs | 2 +- .../Commands/Atmos/RemoveGasCommand.cs | 2 +- .../Atmos/SetAtmosTemperatureCommand.cs | 2 +- .../Commands/Atmos/SetTemperatureCommand.cs | 2 +- .../Commands/Atmos/ShowAtmosCommand.cs | 2 +- .../Construction/Completions/SetStackCount.cs | 4 - .../Completions/SpawnPrototype.cs | 3 - .../Components/MachineComponent.cs | 1 + Content.Server/Conveyor/ConveyorComponent.cs | 2 +- Content.Server/Damage/GodmodeSystem.cs | 2 +- Content.Server/Damage/RejuvenateVerb.cs | 2 +- .../Unit/Components/DisposalUnitComponent.cs | 3 +- .../Doors/Components/ServerDoorComponent.cs | 2 +- .../Components/Atmos/GasCanisterComponent.cs | 320 ------------------ .../Atmos/Piping/GasCanisterPortComponent.cs | 102 ------ .../Atmos/Piping/GasFilterComponent.cs | 170 ---------- .../Atmos/Piping/GasGeneratorComponent.cs | 99 ------ .../Atmos/Piping/PipeHeaterComponent.cs | 66 ---- .../Atmos/Piping/PipeNetDeviceComponent.cs | 57 ---- .../Atmos/Piping/Pumps/BasePumpComponent.cs | 124 ------- .../Piping/Pumps/PressurePumpComponent.cs | 66 ---- .../Atmos/Piping/Pumps/VolumePumpComponent.cs | 44 --- .../Piping/Scrubbers/BaseSiphonComponent.cs | 97 ------ .../Atmos/Piping/Scrubbers/PressureSiphon.cs | 55 --- .../Atmos/Piping/Vents/BaseVentComponent.cs | 97 ------ .../Piping/Vents/PressureVentComponent.cs | 64 ---- .../DONT_PUT_STUFF_HERE_ATMOS_LEFTOVER | 0 .../EntitySystems/AtmosExposedSystem.cs | 32 -- .../EntitySystems/GasCanisterSystem.cs | 33 -- Content.Server/Ghost/GhostSystem.cs | 1 - .../Interfaces/IGasMixtureHolder.cs | 2 +- .../NodeContainer/NodeGroups/INodeGroup.cs | 11 +- .../NodeContainer/NodeGroups/IPipeNet.cs | 48 ++- Content.Server/NodeContainer/Nodes/Node.cs | 6 +- .../NodeContainer/Nodes/PipeNode.cs | 237 ++++++++----- .../Physics/Controllers/PullController.cs | 1 - .../StationEvents/Events/GasLeak.cs | 2 +- Content.Shared/Atmos/Atmospherics.cs | 15 + .../Components}/SharedFlammableComponent.cs | 2 +- .../Components/SharedGasAnalyzerComponent.cs | 17 +- .../Components/SharedGasTankComponent.cs} | 19 +- .../SharedAtmosDebugOverlaySystem.cs | 5 +- .../EntitySystems}/SharedAtmosphereSystem.cs | 4 +- .../SharedGasTileOverlaySystem.cs | 2 +- .../Atmos/GasOverlayChunk.cs | 3 +- .../PipeDirection.cs} | 38 ++- .../Components/SharedGasCanisterComponent.cs | 90 +++++ .../Atmos/Piping/EnabledAtmosDeviceVisuals.cs | 35 ++ .../Components/SharedGasPortableComponent.cs | 14 + .../Piping/Unary/Visuals/ScrubberVisuals.cs | 21 ++ .../Piping/Unary/Visuals/VentPumpVisuals.cs | 20 ++ .../Atmos/{ => Prototypes}/GasPrototype.cs | 2 +- .../Visuals}/AtmosPlaqueVisuals.cs | 2 +- Content.Shared/Damage/DamageClass.cs | 1 - Content.Shared/Damage/DamageType.cs | 1 - .../GasTank/GasTankSetPressureMessage.cs | 13 - .../GasTank/GasTankToggleInternalsMessage.cs | 12 - .../Atmos/GasTank/SharedGasTankComponent.cs | 12 - .../Atmos/GasTank/SharedGasTankUiKey.cs | 12 - .../Components/Atmos/SharedFilterComponent.cs | 23 -- .../Atmos/SharedGasAnalyzerComponent.cs | 21 -- .../Atmos/SharedGasCanisterComponent.cs | 121 ------- .../Components/Atmos/SharedPumpComponent.cs | 27 -- .../Components/Atmos/SharedSiphonComponent.cs | 23 -- .../Components/Atmos/SharedVentComponent.cs | 23 -- Content.Tests/Shared/WireHackingTest.cs | 1 - .../atmos-unsafe-unanchor-component.ftl | 4 + .../components/gas-canister-component.ftl | 21 ++ .../Piping/Atmospherics/binary.yml | 133 ++++++++ .../{gascanisters.yml => gas_canisters.yml} | 113 ++++--- .../Piping/Atmospherics/gascanisterports.yml | 44 --- .../Piping/Atmospherics/gasfilters.yml | 57 ---- .../Piping/Atmospherics/gasgenerator.yml | 47 --- .../Piping/Atmospherics/heaters.yml | 34 -- .../Piping/Atmospherics/miners.yml | 87 +++++ .../Piping/Atmospherics/pipes.yml | 44 +-- .../Piping/Atmospherics/pumps.yml | 52 --- .../Piping/Atmospherics/scrubbers.yml | 47 --- .../Piping/Atmospherics/trinary.yml | 66 ++++ .../Piping/Atmospherics/unary.yml | 152 +++++++++ .../Piping/Atmospherics/vents.yml | 47 --- .../Entities/Objects/Tools/gas_tanks.yml | 9 + .../Constructible/Atmos/heater.rsi/meta.json | 21 -- .../Constructible/Atmos/miners.rsi/broken.png | Bin 0 -> 147 bytes .../Constructible/Atmos/miners.rsi/meta.json | 1 + .../Constructible/Atmos/miners.rsi/miner.png | Bin 0 -> 647 bytes .../Constructible/Atmos/miners.rsi/on.png | Bin 0 -> 211 bytes .../Atmos/scrubber.rsi/meta.json | 24 +- .../Atmos/scrubber.rsi/scrubOff.png | Bin 2422 -> 0 bytes .../Atmos/scrubber.rsi/scrubOn.png | Bin 4890 -> 0 bytes .../Atmos/scrubber.rsi/scrub_off.png | Bin 0 -> 1002 bytes .../Atmos/scrubber.rsi/scrub_on.png | Bin 0 -> 20683 bytes .../Atmos/scrubber.rsi/scrub_purge.png | Bin 0 -> 7441 bytes .../Atmos/scrubber.rsi/scrub_welded.png | Bin 0 -> 2012 bytes .../Atmos/scrubber.rsi/scrub_wide.png | Bin 0 -> 10949 bytes .../Atmos/thermomachine.rsi/freezer_off.png | Bin 0 -> 1628 bytes .../Atmos/thermomachine.rsi/freezer_on.png | Bin 0 -> 2846 bytes .../Atmos/thermomachine.rsi/freezer_open.png | Bin 0 -> 1671 bytes .../heater_off.png} | Bin .../heater_on.png} | Bin .../Atmos/thermomachine.rsi/heater_open.png | Bin 0 -> 1656 bytes .../Atmos/thermomachine.rsi/meta.json | 1 + .../pipe.png} | Bin .../Constructible/Atmos/vent.rsi/meta.json | 19 +- .../Constructible/Atmos/vent.rsi/ventOff.png | Bin 1768 -> 0 bytes .../Constructible/Atmos/vent.rsi/ventOn.png | Bin 1272 -> 0 bytes .../Constructible/Atmos/vent.rsi/vent_in.png | Bin 0 -> 1595 bytes .../Constructible/Atmos/vent.rsi/vent_off.png | Bin 0 -> 1117 bytes .../Constructible/Atmos/vent.rsi/vent_out.png | Bin 0 -> 2926 bytes .../Atmos/vent.rsi/vent_welded.png | Bin 0 -> 1958 bytes SpaceStation14.sln.DotSettings | 2 + 250 files changed, 3964 insertions(+), 3163 deletions(-) rename Content.Client/{GameObjects/Components/Atmos => Atmos/Components}/GasAnalyzerComponent.cs (95%) rename Content.Client/{GameObjects => Atmos}/EntitySystems/AtmosDebugOverlaySystem.cs (95%) rename Content.Client/{GameObjects => Atmos}/EntitySystems/AtmosphereSystem.cs (53%) rename Content.Client/{GameObjects => Atmos}/EntitySystems/GasTileOverlaySystem.cs (97%) rename Content.Client/Atmos/{ => Overlays}/AtmosDebugOverlay.cs (98%) rename Content.Client/Atmos/{ => Overlays}/GasTileOverlay.cs (95%) create mode 100644 Content.Client/Atmos/Piping/EnabledAtmosDeviceVisualizer.cs create mode 100644 Content.Client/Atmos/Piping/OutletInjectorVisualizer.cs create mode 100644 Content.Client/Atmos/Piping/PassiveVentVisualizer.cs rename Content.Client/{GameObjects/Components => }/Atmos/Piping/PipeConnectorVisualizer.cs (91%) create mode 100644 Content.Client/Atmos/Piping/PressurePumpVisualizer.cs create mode 100644 Content.Client/Atmos/Piping/ScrubberVisualizer.cs create mode 100644 Content.Client/Atmos/Piping/ThermoMachineVisualizer.cs create mode 100644 Content.Client/Atmos/Piping/VentPumpVisualizer.cs rename Content.Client/{GameObjects/Components/Atmos => Atmos/UI}/GasAnalyzerBoundUserInterface.cs (88%) rename Content.Client/{GameObjects/Components/Atmos => Atmos/UI}/GasAnalyzerMenu.cs (98%) create mode 100644 Content.Client/Atmos/UI/GasCanisterBoundUserInterface.cs create mode 100644 Content.Client/Atmos/UI/GasCanisterWindow.xaml create mode 100644 Content.Client/Atmos/UI/GasCanisterWindow.xaml.cs rename Content.Client/{GameObjects/Components/Atmos => Atmos/Visualizers}/AtmosPlaqueVisualizer.cs (89%) rename Content.Client/{GameObjects/Components/Atmos => Atmos/Visualizers}/FireVisualizer.cs (95%) rename Content.Client/{GameObjects/Components/Atmos => Atmos/Visualizers}/GasAnalyzerVisualizer.cs (91%) create mode 100644 Content.Client/Atmos/Visualizers/GasCanisterVisualizer.cs rename Content.Client/{GameObjects/Components/Atmos/GasCanisterVisualizer.cs => Atmos/Visualizers/GasPortableVisualizer.cs} (58%) rename Content.Client/{GameObjects/Components/Atmos => Chemistry/Visualizers}/VaporVisualizer.cs (96%) rename Content.Client/{GameObjects/Components => }/ComputerBoundUserInterface.cs (100%) delete mode 100644 Content.Client/GameObjects/Components/Atmos/GasCanisterBoundUserInterface.cs delete mode 100644 Content.Client/GameObjects/Components/Atmos/GasCanisterWindow.cs delete mode 100644 Content.Client/GameObjects/Components/Atmos/Piping/GasFilterVisualizer.cs delete mode 100644 Content.Client/GameObjects/Components/Atmos/Piping/PipeVisualizer.cs delete mode 100644 Content.Client/GameObjects/Components/Atmos/Piping/PumpVisualizer.cs delete mode 100644 Content.Client/GameObjects/Components/Atmos/Piping/SiphonVisualizer.cs delete mode 100644 Content.Client/GameObjects/Components/Atmos/Piping/VentVisualizer.cs rename Content.Client/{GameObjects/Components => }/Power/SolarControlWindow.xaml (100%) rename Content.Client/{GameObjects/Components => }/Power/SolarControlWindow.xaml.cs (100%) rename Content.Server/{GameObjects/Components/Atmos => Atmos/Components}/AirtightComponent.cs (78%) rename Content.Server/{GameObjects/Components/Atmos => Atmos/Components}/AtmosExposedComponent.cs (94%) rename Content.Server/{GameObjects => Atmos}/Components/AtmosPlaqueComponent.cs (97%) rename Content.Server/{GameObjects/Components/Atmos => Atmos/Components}/BarotraumaComponent.cs (98%) rename Content.Server/{GameObjects => Atmos}/Components/BaseComputerUserInterfaceComponent.cs (99%) rename Content.Server/{GameObjects/Components/Atmos => Atmos/Components}/BreathToolComponent.cs (97%) rename Content.Server/{GameObjects/Components/Atmos => Atmos/Components}/FirelockComponent.cs (95%) rename Content.Server/{GameObjects/Components/Atmos => Atmos/Components}/FlammableComponent.cs (97%) rename Content.Server/{GameObjects/Components/Atmos => Atmos/Components}/GasAnalyzerComponent.cs (97%) rename Content.Server/{GameObjects/Components/Atmos => Atmos/Components}/GasMixtureHolderComponent.cs (68%) rename Content.Server/{GameObjects/Components/Atmos => Atmos/Components}/GasTankComponent.cs (87%) rename Content.Server/{GameObjects/Components/Atmos => Atmos/Components}/GridAtmosphereComponent.cs (95%) rename Content.Server/Atmos/{ => Components}/IGridAtmosphereComponent.cs (94%) rename Content.Server/{GameObjects/Components/Atmos => Atmos/Components}/MovedByPressureComponent.cs (98%) rename Content.Server/{GameObjects/Components/Atmos => Atmos/Components}/PressureProtectionComponent.cs (83%) rename Content.Server/{GameObjects/Components/Atmos => Atmos/Components}/SpaceGridAtmosphereComponent.cs (92%) rename Content.Server/{GameObjects/Components/Atmos => Atmos/Components}/UnsimulatedGridAtmosphereComponent.cs (88%) create mode 100644 Content.Server/Atmos/EntitySystems/AirtightSystem.cs rename Content.Server/{GameObjects/EntitySystems/Atmos => Atmos/EntitySystems}/AtmosDebugOverlaySystem.cs (96%) create mode 100644 Content.Server/Atmos/EntitySystems/AtmosphereSystem.CVars.cs create mode 100644 Content.Server/Atmos/EntitySystems/AtmosphereSystem.Gases.cs rename Content.Server/{GameObjects => Atmos}/EntitySystems/AtmosphereSystem.cs (51%) rename Content.Server/{GameObjects => Atmos}/EntitySystems/ComputerUIActivatorSystem.cs (82%) rename Content.Server/{GameObjects => Atmos}/EntitySystems/GasAnalyzerSystem.cs (78%) rename Content.Server/{GameObjects => Atmos}/EntitySystems/GasTankSystem.cs (85%) rename Content.Server/{GameObjects/EntitySystems/Atmos => Atmos/EntitySystems}/GasTileOverlaySystem.cs (99%) create mode 100644 Content.Server/Atmos/Piping/Binary/Components/GasCanisterComponent.cs create mode 100644 Content.Server/Atmos/Piping/Binary/Components/GasPassiveGateComponent.cs create mode 100644 Content.Server/Atmos/Piping/Binary/Components/GasPortComponent.cs create mode 100644 Content.Server/Atmos/Piping/Binary/Components/GasPressurePumpComponent.cs create mode 100644 Content.Server/Atmos/Piping/Binary/Components/GasValveComponent.cs create mode 100644 Content.Server/Atmos/Piping/Binary/Components/GasVolumePumpComponent.cs create mode 100644 Content.Server/Atmos/Piping/Binary/EntitySystems/GasCanisterSystem.cs create mode 100644 Content.Server/Atmos/Piping/Binary/EntitySystems/GasPassiveGateSystem.cs create mode 100644 Content.Server/Atmos/Piping/Binary/EntitySystems/GasPressurePumpSystem.cs create mode 100644 Content.Server/Atmos/Piping/Binary/EntitySystems/GasVolumePumpSystem.cs create mode 100644 Content.Server/Atmos/Piping/Components/AtmosDeviceComponent.cs create mode 100644 Content.Server/Atmos/Piping/Components/AtmosUnsafeUnanchorComponent.cs create mode 100644 Content.Server/Atmos/Piping/EntitySystems/AtmosDeviceSystem.cs create mode 100644 Content.Server/Atmos/Piping/EntitySystems/AtmosUnsafeUnanchorSystem.cs create mode 100644 Content.Server/Atmos/Piping/Other/Components/GasMinerComponent.cs create mode 100644 Content.Server/Atmos/Piping/Other/EntitySystems/GasMinerSystem.cs create mode 100644 Content.Server/Atmos/Piping/Trinary/Components/GasFilterComponent.cs create mode 100644 Content.Server/Atmos/Piping/Trinary/Components/GasMixerComponent.cs create mode 100644 Content.Server/Atmos/Piping/Trinary/EntitySystems/GasFilterSystem.cs create mode 100644 Content.Server/Atmos/Piping/Trinary/EntitySystems/GasMixerSystem.cs create mode 100644 Content.Server/Atmos/Piping/Unary/Components/GasOutletInjectorComponent.cs create mode 100644 Content.Server/Atmos/Piping/Unary/Components/GasPassiveVentComponent.cs create mode 100644 Content.Server/Atmos/Piping/Unary/Components/GasPortableComponent.cs create mode 100644 Content.Server/Atmos/Piping/Unary/Components/GasThermoMachineComponent.cs create mode 100644 Content.Server/Atmos/Piping/Unary/Components/GasVentPumpComponent.cs create mode 100644 Content.Server/Atmos/Piping/Unary/Components/GasVentScrubberComponent.cs create mode 100644 Content.Server/Atmos/Piping/Unary/EntitySystems/GasOutletInjectorSystem.cs create mode 100644 Content.Server/Atmos/Piping/Unary/EntitySystems/GasPassiveVentSystem.cs create mode 100644 Content.Server/Atmos/Piping/Unary/EntitySystems/GasPortableSystem.cs create mode 100644 Content.Server/Atmos/Piping/Unary/EntitySystems/GasTankSystem.cs create mode 100644 Content.Server/Atmos/Piping/Unary/EntitySystems/GasThermoMachineSystem.cs create mode 100644 Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentPumpSystem.cs create mode 100644 Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentScrubberSystem.cs delete mode 100644 Content.Server/GameObjects/Components/Atmos/GasCanisterComponent.cs delete mode 100644 Content.Server/GameObjects/Components/Atmos/Piping/GasCanisterPortComponent.cs delete mode 100644 Content.Server/GameObjects/Components/Atmos/Piping/GasFilterComponent.cs delete mode 100644 Content.Server/GameObjects/Components/Atmos/Piping/GasGeneratorComponent.cs delete mode 100644 Content.Server/GameObjects/Components/Atmos/Piping/PipeHeaterComponent.cs delete mode 100644 Content.Server/GameObjects/Components/Atmos/Piping/PipeNetDeviceComponent.cs delete mode 100644 Content.Server/GameObjects/Components/Atmos/Piping/Pumps/BasePumpComponent.cs delete mode 100644 Content.Server/GameObjects/Components/Atmos/Piping/Pumps/PressurePumpComponent.cs delete mode 100644 Content.Server/GameObjects/Components/Atmos/Piping/Pumps/VolumePumpComponent.cs delete mode 100644 Content.Server/GameObjects/Components/Atmos/Piping/Scrubbers/BaseSiphonComponent.cs delete mode 100644 Content.Server/GameObjects/Components/Atmos/Piping/Scrubbers/PressureSiphon.cs delete mode 100644 Content.Server/GameObjects/Components/Atmos/Piping/Vents/BaseVentComponent.cs delete mode 100644 Content.Server/GameObjects/Components/Atmos/Piping/Vents/PressureVentComponent.cs delete mode 100644 Content.Server/GameObjects/DONT_PUT_STUFF_HERE_ATMOS_LEFTOVER delete mode 100644 Content.Server/GameObjects/EntitySystems/AtmosExposedSystem.cs delete mode 100644 Content.Server/GameObjects/EntitySystems/GasCanisterSystem.cs rename Content.Shared/{GameObjects/Components/Atmos => Atmos/Components}/SharedFlammableComponent.cs (86%) rename Content.Shared/{GameObjects => Atmos}/Components/SharedGasAnalyzerComponent.cs (89%) rename Content.Shared/{GameObjects/Components/Atmos/GasTank/GasTankBoundUserInterfaceState.cs => Atmos/Components/SharedGasTankComponent.cs} (50%) rename Content.Shared/{GameObjects/EntitySystems/Atmos => Atmos/EntitySystems}/SharedAtmosDebugOverlaySystem.cs (96%) rename Content.Shared/{GameObjects/EntitySystems/Atmos => Atmos/EntitySystems}/SharedAtmosphereSystem.cs (95%) rename Content.Shared/{GameObjects/EntitySystems/Atmos => Atmos/EntitySystems}/SharedGasTileOverlaySystem.cs (98%) rename Content.Shared/{GameObjects/EntitySystems => }/Atmos/GasOverlayChunk.cs (97%) rename Content.Shared/{GameObjects/Components/Atmos/SharedPipeComponent.cs => Atmos/PipeDirection.cs} (83%) create mode 100644 Content.Shared/Atmos/Piping/Binary/Components/SharedGasCanisterComponent.cs create mode 100644 Content.Shared/Atmos/Piping/EnabledAtmosDeviceVisuals.cs create mode 100644 Content.Shared/Atmos/Piping/Unary/Components/SharedGasPortableComponent.cs create mode 100644 Content.Shared/Atmos/Piping/Unary/Visuals/ScrubberVisuals.cs create mode 100644 Content.Shared/Atmos/Piping/Unary/Visuals/VentPumpVisuals.cs rename Content.Shared/Atmos/{ => Prototypes}/GasPrototype.cs (98%) rename Content.Shared/{GameObjects/Components/Atmos => Atmos/Visuals}/AtmosPlaqueVisuals.cs (74%) delete mode 100644 Content.Shared/GameObjects/Components/Atmos/GasTank/GasTankSetPressureMessage.cs delete mode 100644 Content.Shared/GameObjects/Components/Atmos/GasTank/GasTankToggleInternalsMessage.cs delete mode 100644 Content.Shared/GameObjects/Components/Atmos/GasTank/SharedGasTankComponent.cs delete mode 100644 Content.Shared/GameObjects/Components/Atmos/GasTank/SharedGasTankUiKey.cs delete mode 100644 Content.Shared/GameObjects/Components/Atmos/SharedFilterComponent.cs delete mode 100644 Content.Shared/GameObjects/Components/Atmos/SharedGasAnalyzerComponent.cs delete mode 100644 Content.Shared/GameObjects/Components/Atmos/SharedGasCanisterComponent.cs delete mode 100644 Content.Shared/GameObjects/Components/Atmos/SharedPumpComponent.cs delete mode 100644 Content.Shared/GameObjects/Components/Atmos/SharedSiphonComponent.cs delete mode 100644 Content.Shared/GameObjects/Components/Atmos/SharedVentComponent.cs create mode 100644 Resources/Locale/en-US/components/atmos-unsafe-unanchor-component.ftl create mode 100644 Resources/Locale/en-US/components/gas-canister-component.ftl create mode 100644 Resources/Prototypes/Entities/Constructible/Piping/Atmospherics/binary.yml rename Resources/Prototypes/Entities/Constructible/Piping/Atmospherics/{gascanisters.yml => gas_canisters.yml} (87%) delete mode 100644 Resources/Prototypes/Entities/Constructible/Piping/Atmospherics/gascanisterports.yml delete mode 100644 Resources/Prototypes/Entities/Constructible/Piping/Atmospherics/gasfilters.yml delete mode 100644 Resources/Prototypes/Entities/Constructible/Piping/Atmospherics/gasgenerator.yml delete mode 100644 Resources/Prototypes/Entities/Constructible/Piping/Atmospherics/heaters.yml create mode 100644 Resources/Prototypes/Entities/Constructible/Piping/Atmospherics/miners.yml delete mode 100644 Resources/Prototypes/Entities/Constructible/Piping/Atmospherics/pumps.yml delete mode 100644 Resources/Prototypes/Entities/Constructible/Piping/Atmospherics/scrubbers.yml create mode 100644 Resources/Prototypes/Entities/Constructible/Piping/Atmospherics/trinary.yml create mode 100644 Resources/Prototypes/Entities/Constructible/Piping/Atmospherics/unary.yml delete mode 100644 Resources/Prototypes/Entities/Constructible/Piping/Atmospherics/vents.yml delete mode 100644 Resources/Textures/Constructible/Atmos/heater.rsi/meta.json create mode 100644 Resources/Textures/Constructible/Atmos/miners.rsi/broken.png create mode 100644 Resources/Textures/Constructible/Atmos/miners.rsi/meta.json create mode 100644 Resources/Textures/Constructible/Atmos/miners.rsi/miner.png create mode 100644 Resources/Textures/Constructible/Atmos/miners.rsi/on.png delete mode 100644 Resources/Textures/Constructible/Atmos/scrubber.rsi/scrubOff.png delete mode 100644 Resources/Textures/Constructible/Atmos/scrubber.rsi/scrubOn.png create mode 100644 Resources/Textures/Constructible/Atmos/scrubber.rsi/scrub_off.png create mode 100644 Resources/Textures/Constructible/Atmos/scrubber.rsi/scrub_on.png create mode 100644 Resources/Textures/Constructible/Atmos/scrubber.rsi/scrub_purge.png create mode 100644 Resources/Textures/Constructible/Atmos/scrubber.rsi/scrub_welded.png create mode 100644 Resources/Textures/Constructible/Atmos/scrubber.rsi/scrub_wide.png create mode 100644 Resources/Textures/Constructible/Atmos/thermomachine.rsi/freezer_off.png create mode 100644 Resources/Textures/Constructible/Atmos/thermomachine.rsi/freezer_on.png create mode 100644 Resources/Textures/Constructible/Atmos/thermomachine.rsi/freezer_open.png rename Resources/Textures/Constructible/Atmos/{heater.rsi/heater.png => thermomachine.rsi/heater_off.png} (100%) rename Resources/Textures/Constructible/Atmos/{heater.rsi/heaterOn.png => thermomachine.rsi/heater_on.png} (100%) create mode 100644 Resources/Textures/Constructible/Atmos/thermomachine.rsi/heater_open.png create mode 100644 Resources/Textures/Constructible/Atmos/thermomachine.rsi/meta.json rename Resources/Textures/Constructible/Atmos/{heater.rsi/heaterPipe.png => thermomachine.rsi/pipe.png} (100%) delete mode 100644 Resources/Textures/Constructible/Atmos/vent.rsi/ventOff.png delete mode 100644 Resources/Textures/Constructible/Atmos/vent.rsi/ventOn.png create mode 100644 Resources/Textures/Constructible/Atmos/vent.rsi/vent_in.png create mode 100644 Resources/Textures/Constructible/Atmos/vent.rsi/vent_off.png create mode 100644 Resources/Textures/Constructible/Atmos/vent.rsi/vent_out.png create mode 100644 Resources/Textures/Constructible/Atmos/vent.rsi/vent_welded.png diff --git a/Content.Client/Administration/UI/Tabs/AtmosTab/AddGasWindow.xaml.cs b/Content.Client/Administration/UI/Tabs/AtmosTab/AddGasWindow.xaml.cs index 4587b419d3..273d194196 100644 --- a/Content.Client/Administration/UI/Tabs/AtmosTab/AddGasWindow.xaml.cs +++ b/Content.Client/Administration/UI/Tabs/AtmosTab/AddGasWindow.xaml.cs @@ -1,8 +1,9 @@ #nullable enable using System.Collections.Generic; using System.Linq; -using Content.Client.GameObjects.EntitySystems; +using Content.Client.Atmos.EntitySystems; using Content.Shared.Atmos; +using Content.Shared.Atmos.Prototypes; using JetBrains.Annotations; using Robust.Client.AutoGenerated; using Robust.Client.Console; diff --git a/Content.Client/Administration/UI/Tabs/AtmosTab/FillGasWindow.xaml.cs b/Content.Client/Administration/UI/Tabs/AtmosTab/FillGasWindow.xaml.cs index 0acd97e52b..2465d8c61d 100644 --- a/Content.Client/Administration/UI/Tabs/AtmosTab/FillGasWindow.xaml.cs +++ b/Content.Client/Administration/UI/Tabs/AtmosTab/FillGasWindow.xaml.cs @@ -1,8 +1,9 @@ #nullable enable using System.Collections.Generic; using System.Linq; -using Content.Client.GameObjects.EntitySystems; +using Content.Client.Atmos.EntitySystems; using Content.Shared.Atmos; +using Content.Shared.Atmos.Prototypes; using JetBrains.Annotations; using Robust.Client.AutoGenerated; using Robust.Client.Console; diff --git a/Content.Client/GameObjects/Components/Atmos/GasAnalyzerComponent.cs b/Content.Client/Atmos/Components/GasAnalyzerComponent.cs similarity index 95% rename from Content.Client/GameObjects/Components/Atmos/GasAnalyzerComponent.cs rename to Content.Client/Atmos/Components/GasAnalyzerComponent.cs index 41720a8408..bb5ee4e7bd 100644 --- a/Content.Client/GameObjects/Components/Atmos/GasAnalyzerComponent.cs +++ b/Content.Client/Atmos/Components/GasAnalyzerComponent.cs @@ -1,7 +1,7 @@ using Content.Client.Items.Components; using Content.Client.Message; using Content.Client.Stylesheets; -using Content.Shared.GameObjects.Components; +using Content.Shared.Atmos.Components; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Shared.GameObjects; @@ -9,7 +9,7 @@ using Robust.Shared.Localization; using Robust.Shared.Timing; using Robust.Shared.ViewVariables; -namespace Content.Client.GameObjects.Components.Atmos +namespace Content.Client.Atmos.Components { [RegisterComponent] internal class GasAnalyzerComponent : SharedGasAnalyzerComponent, IItemStatus diff --git a/Content.Client/GameObjects/EntitySystems/AtmosDebugOverlaySystem.cs b/Content.Client/Atmos/EntitySystems/AtmosDebugOverlaySystem.cs similarity index 95% rename from Content.Client/GameObjects/EntitySystems/AtmosDebugOverlaySystem.cs rename to Content.Client/Atmos/EntitySystems/AtmosDebugOverlaySystem.cs index 880475471e..fe18e1fc5f 100644 --- a/Content.Client/GameObjects/EntitySystems/AtmosDebugOverlaySystem.cs +++ b/Content.Client/Atmos/EntitySystems/AtmosDebugOverlaySystem.cs @@ -1,9 +1,8 @@ #nullable enable -using System; using System.Collections.Generic; -using Content.Client.Atmos; -using Content.Shared.GameObjects.EntitySystems.Atmos; +using Content.Client.Atmos.Overlays; using Content.Shared.Atmos; +using Content.Shared.Atmos.EntitySystems; using Content.Shared.GameTicking; using JetBrains.Annotations; using Robust.Client.Graphics; @@ -11,7 +10,7 @@ using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Maths; -namespace Content.Client.GameObjects.EntitySystems +namespace Content.Client.Atmos.EntitySystems { [UsedImplicitly] internal sealed class AtmosDebugOverlaySystem : SharedAtmosDebugOverlaySystem, IResettingEntitySystem diff --git a/Content.Client/GameObjects/EntitySystems/AtmosphereSystem.cs b/Content.Client/Atmos/EntitySystems/AtmosphereSystem.cs similarity index 53% rename from Content.Client/GameObjects/EntitySystems/AtmosphereSystem.cs rename to Content.Client/Atmos/EntitySystems/AtmosphereSystem.cs index 9b6f57f06d..ee67361146 100644 --- a/Content.Client/GameObjects/EntitySystems/AtmosphereSystem.cs +++ b/Content.Client/Atmos/EntitySystems/AtmosphereSystem.cs @@ -1,7 +1,7 @@ -using Content.Shared.GameObjects.EntitySystems.Atmos; +using Content.Shared.Atmos.EntitySystems; using JetBrains.Annotations; -namespace Content.Client.GameObjects.EntitySystems +namespace Content.Client.Atmos.EntitySystems { [UsedImplicitly] public class AtmosphereSystem : SharedAtmosphereSystem diff --git a/Content.Client/GameObjects/EntitySystems/GasTileOverlaySystem.cs b/Content.Client/Atmos/EntitySystems/GasTileOverlaySystem.cs similarity index 97% rename from Content.Client/GameObjects/EntitySystems/GasTileOverlaySystem.cs rename to Content.Client/Atmos/EntitySystems/GasTileOverlaySystem.cs index 2efe25f0e9..470c4cae0c 100644 --- a/Content.Client/GameObjects/EntitySystems/GasTileOverlaySystem.cs +++ b/Content.Client/Atmos/EntitySystems/GasTileOverlaySystem.cs @@ -1,20 +1,19 @@ #nullable enable using System; using System.Collections.Generic; -using Content.Client.Atmos; +using Content.Client.Atmos.Overlays; using Content.Shared.Atmos; -using Content.Shared.GameObjects.EntitySystems.Atmos; +using Content.Shared.Atmos.EntitySystems; using JetBrains.Annotations; using Robust.Client.Graphics; using Robust.Client.ResourceManagement; using Robust.Client.Utility; using Robust.Shared.IoC; -using Robust.Shared.Log; using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Utility; -namespace Content.Client.GameObjects.EntitySystems +namespace Content.Client.Atmos.EntitySystems { [UsedImplicitly] internal sealed class GasTileOverlaySystem : SharedGasTileOverlaySystem diff --git a/Content.Client/Atmos/AtmosDebugOverlay.cs b/Content.Client/Atmos/Overlays/AtmosDebugOverlay.cs similarity index 98% rename from Content.Client/Atmos/AtmosDebugOverlay.cs rename to Content.Client/Atmos/Overlays/AtmosDebugOverlay.cs index c0987545c1..cf6cd4b424 100644 --- a/Content.Client/Atmos/AtmosDebugOverlay.cs +++ b/Content.Client/Atmos/Overlays/AtmosDebugOverlay.cs @@ -1,15 +1,14 @@ -using Content.Client.GameObjects.EntitySystems; -using Content.Shared.GameObjects.EntitySystems.Atmos; +using Content.Client.Atmos.EntitySystems; using Content.Shared.Atmos; +using Content.Shared.Atmos.EntitySystems; using Robust.Client.Graphics; +using Robust.Shared.Enums; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Maths; -using Robust.Shared.Enums; -using System; -namespace Content.Client.Atmos +namespace Content.Client.Atmos.Overlays { public class AtmosDebugOverlay : Overlay { diff --git a/Content.Client/Atmos/GasTileOverlay.cs b/Content.Client/Atmos/Overlays/GasTileOverlay.cs similarity index 95% rename from Content.Client/Atmos/GasTileOverlay.cs rename to Content.Client/Atmos/Overlays/GasTileOverlay.cs index 30e31ef0c2..06b5c3bc4f 100644 --- a/Content.Client/Atmos/GasTileOverlay.cs +++ b/Content.Client/Atmos/Overlays/GasTileOverlay.cs @@ -1,12 +1,12 @@ -using Content.Client.GameObjects.EntitySystems; -using Robust.Shared.Enums; +using Content.Client.Atmos.EntitySystems; using Robust.Client.Graphics; +using Robust.Shared.Enums; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Maths; -namespace Content.Client.Atmos +namespace Content.Client.Atmos.Overlays { public class GasTileOverlay : Overlay { diff --git a/Content.Client/Atmos/Piping/EnabledAtmosDeviceVisualizer.cs b/Content.Client/Atmos/Piping/EnabledAtmosDeviceVisualizer.cs new file mode 100644 index 0000000000..93b2913567 --- /dev/null +++ b/Content.Client/Atmos/Piping/EnabledAtmosDeviceVisualizer.cs @@ -0,0 +1,39 @@ +using System; +using JetBrains.Annotations; +using Robust.Client.GameObjects; +using Robust.Shared.GameObjects; +using Robust.Shared.Serialization.Manager.Attributes; + +namespace Content.Client.Atmos.Piping +{ + [UsedImplicitly] + public abstract class EnabledAtmosDeviceVisualizer : AppearanceVisualizer + { + [DataField("enabledState")] + private string _enabledState = string.Empty; + protected abstract object LayerMap { get; } + protected abstract Enum DataKey { get; } + + public override void InitializeEntity(IEntity entity) + { + base.InitializeEntity(entity); + + if (!entity.TryGetComponent(out ISpriteComponent? sprite)) + return; + + sprite.LayerMapSet(LayerMap, sprite.AddLayerState(_enabledState)); + sprite.LayerSetVisible(LayerMap, false); + } + + public override void OnChangeData(AppearanceComponent component) + { + base.OnChangeData(component); + + if (!component.Owner.TryGetComponent(out ISpriteComponent? sprite)) + return; + + if(component.TryGetData(DataKey, out bool enabled)) + sprite.LayerSetVisible(LayerMap, enabled); + } + } +} diff --git a/Content.Client/Atmos/Piping/OutletInjectorVisualizer.cs b/Content.Client/Atmos/Piping/OutletInjectorVisualizer.cs new file mode 100644 index 0000000000..2d4cad5cf6 --- /dev/null +++ b/Content.Client/Atmos/Piping/OutletInjectorVisualizer.cs @@ -0,0 +1,18 @@ +using System; +using Content.Shared.Atmos.Piping; +using JetBrains.Annotations; + +namespace Content.Client.Atmos.Piping +{ + [UsedImplicitly] + public class OutletInjectorVisualizer : EnabledAtmosDeviceVisualizer + { + protected override object LayerMap => Layers.Enabled; + protected override Enum DataKey => OutletInjectorVisuals.Enabled; + + enum Layers + { + Enabled, + } + } +} diff --git a/Content.Client/Atmos/Piping/PassiveVentVisualizer.cs b/Content.Client/Atmos/Piping/PassiveVentVisualizer.cs new file mode 100644 index 0000000000..a932eb055a --- /dev/null +++ b/Content.Client/Atmos/Piping/PassiveVentVisualizer.cs @@ -0,0 +1,18 @@ +using System; +using Content.Shared.Atmos.Piping; +using JetBrains.Annotations; + +namespace Content.Client.Atmos.Piping +{ + [UsedImplicitly] + public class PassiveVentVisualizer : EnabledAtmosDeviceVisualizer + { + protected override object LayerMap => Layers.Enabled; + protected override Enum DataKey => PassiveVentVisuals.Enabled; + + enum Layers + { + Enabled, + } + } +} diff --git a/Content.Client/GameObjects/Components/Atmos/Piping/PipeConnectorVisualizer.cs b/Content.Client/Atmos/Piping/PipeConnectorVisualizer.cs similarity index 91% rename from Content.Client/GameObjects/Components/Atmos/Piping/PipeConnectorVisualizer.cs rename to Content.Client/Atmos/Piping/PipeConnectorVisualizer.cs index dbdc1df5e9..93e70bf8d3 100644 --- a/Content.Client/GameObjects/Components/Atmos/Piping/PipeConnectorVisualizer.cs +++ b/Content.Client/Atmos/Piping/PipeConnectorVisualizer.cs @@ -1,6 +1,6 @@ #nullable enable using System; -using Content.Shared.GameObjects.Components.Atmos; +using Content.Shared.Atmos; using JetBrains.Annotations; using Robust.Client.GameObjects; using Robust.Client.Graphics; @@ -10,9 +10,8 @@ using Robust.Shared.IoC; using Robust.Shared.Log; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; -using YamlDotNet.RepresentationModel; -namespace Content.Client.GameObjects.Components.Atmos.Piping +namespace Content.Client.Atmos.Piping { [UsedImplicitly] public class PipeConnectorVisualizer : AppearanceVisualizer, ISerializationHooks @@ -33,7 +32,7 @@ namespace Content.Client.GameObjects.Components.Atmos.Piping if (resourceCache.TryGetResource(rsiString, out RSIResource? rsi)) _connectorRsi = rsi.RSI; else - Logger.Error($"{nameof(PipeVisualizer)} could not load to load RSI {rsiString}."); + Logger.Error($"{nameof(PipeConnectorVisualizer)} could not load to load RSI {rsiString}."); } public override void InitializeEntity(IEntity entity) diff --git a/Content.Client/Atmos/Piping/PressurePumpVisualizer.cs b/Content.Client/Atmos/Piping/PressurePumpVisualizer.cs new file mode 100644 index 0000000000..acdf4350d0 --- /dev/null +++ b/Content.Client/Atmos/Piping/PressurePumpVisualizer.cs @@ -0,0 +1,18 @@ +using System; +using Content.Shared.Atmos.Piping; +using JetBrains.Annotations; + +namespace Content.Client.Atmos.Piping +{ + [UsedImplicitly] + public class PressurePumpVisualizer : EnabledAtmosDeviceVisualizer + { + protected override object LayerMap => Layers.Enabled; + protected override Enum DataKey => PressurePumpVisuals.Enabled; + + enum Layers + { + Enabled, + } + } +} diff --git a/Content.Client/Atmos/Piping/ScrubberVisualizer.cs b/Content.Client/Atmos/Piping/ScrubberVisualizer.cs new file mode 100644 index 0000000000..b4add93bcd --- /dev/null +++ b/Content.Client/Atmos/Piping/ScrubberVisualizer.cs @@ -0,0 +1,52 @@ +using Content.Shared.Atmos.Piping.Unary.Visuals; +using Content.Shared.Atmos.Visuals; +using JetBrains.Annotations; +using Robust.Client.GameObjects; + +namespace Content.Client.Atmos.Piping +{ + [UsedImplicitly] + public class ScrubberVisualizer : AppearanceVisualizer + { + private string _offState = "scrub_off"; + private string _scrubState = "scrub_on"; + private string _siphonState = "scrub_purge"; + private string _weldedState = "scrub_welded"; + private string _wideState = "scrub_wide"; + + public override void OnChangeData(AppearanceComponent component) + { + base.OnChangeData(component); + + if (!component.Owner.TryGetComponent(out ISpriteComponent? sprite)) + return; + + if (!component.TryGetData(ScrubberVisuals.State, out ScrubberState state)) + return; + + switch (state) + { + case ScrubberState.Off: + sprite.LayerSetState(ScrubberVisualLayers.Scrubber, _offState); + break; + case ScrubberState.Scrub: + sprite.LayerSetState(ScrubberVisualLayers.Scrubber, _scrubState); + break; + case ScrubberState.Siphon: + sprite.LayerSetState(ScrubberVisualLayers.Scrubber, _siphonState); + break; + case ScrubberState.Welded: + sprite.LayerSetState(ScrubberVisualLayers.Scrubber, _weldedState); + break; + case ScrubberState.WideScrub: + sprite.LayerSetState(ScrubberVisualLayers.Scrubber, _wideState); + break; + } + } + } + + public enum ScrubberVisualLayers + { + Scrubber, + } +} diff --git a/Content.Client/Atmos/Piping/ThermoMachineVisualizer.cs b/Content.Client/Atmos/Piping/ThermoMachineVisualizer.cs new file mode 100644 index 0000000000..2a1136a951 --- /dev/null +++ b/Content.Client/Atmos/Piping/ThermoMachineVisualizer.cs @@ -0,0 +1,18 @@ +using System; +using Content.Shared.Atmos.Piping; +using JetBrains.Annotations; + +namespace Content.Client.Atmos.Piping +{ + [UsedImplicitly] + public class ThermoMachineVisualizer : EnabledAtmosDeviceVisualizer + { + protected override object LayerMap => Layers.Enabled; + protected override Enum DataKey => ThermoMachineVisuals.Enabled; + + enum Layers + { + Enabled, + } + } +} diff --git a/Content.Client/Atmos/Piping/VentPumpVisualizer.cs b/Content.Client/Atmos/Piping/VentPumpVisualizer.cs new file mode 100644 index 0000000000..d31dad27a8 --- /dev/null +++ b/Content.Client/Atmos/Piping/VentPumpVisualizer.cs @@ -0,0 +1,47 @@ +using Content.Shared.Atmos.Visuals; +using JetBrains.Annotations; +using Robust.Client.GameObjects; + +namespace Content.Client.Atmos.Piping +{ + [UsedImplicitly] + public class VentPumpVisualizer : AppearanceVisualizer + { + private string _offState = "vent_off"; + private string _inState = "vent_in"; + private string _outState = "vent_out"; + private string _weldedState = "vent_welded"; + + public override void OnChangeData(AppearanceComponent component) + { + base.OnChangeData(component); + + if (!component.Owner.TryGetComponent(out ISpriteComponent? sprite)) + return; + + if (!component.TryGetData(VentPumpVisuals.State, out VentPumpState state)) + return; + + switch (state) + { + case VentPumpState.Off: + sprite.LayerSetState(VentVisualLayers.Vent, _offState); + break; + case VentPumpState.In: + sprite.LayerSetState(VentVisualLayers.Vent, _inState); + break; + case VentPumpState.Out: + sprite.LayerSetState(VentVisualLayers.Vent, _outState); + break; + case VentPumpState.Welded: + sprite.LayerSetState(VentVisualLayers.Vent, _weldedState); + break; + } + } + } + + public enum VentVisualLayers + { + Vent, + } +} diff --git a/Content.Client/GameObjects/Components/Atmos/GasAnalyzerBoundUserInterface.cs b/Content.Client/Atmos/UI/GasAnalyzerBoundUserInterface.cs similarity index 88% rename from Content.Client/GameObjects/Components/Atmos/GasAnalyzerBoundUserInterface.cs rename to Content.Client/Atmos/UI/GasAnalyzerBoundUserInterface.cs index 98d07f1ef9..ad25648633 100644 --- a/Content.Client/GameObjects/Components/Atmos/GasAnalyzerBoundUserInterface.cs +++ b/Content.Client/Atmos/UI/GasAnalyzerBoundUserInterface.cs @@ -1,8 +1,8 @@ using Robust.Client.GameObjects; using Robust.Shared.GameObjects; -using static Content.Shared.GameObjects.Components.SharedGasAnalyzerComponent; +using static Content.Shared.Atmos.Components.SharedGasAnalyzerComponent; -namespace Content.Client.GameObjects.Components.Atmos +namespace Content.Client.Atmos.UI { public class GasAnalyzerBoundUserInterface : BoundUserInterface { diff --git a/Content.Client/GameObjects/Components/Atmos/GasAnalyzerMenu.cs b/Content.Client/Atmos/UI/GasAnalyzerMenu.cs similarity index 98% rename from Content.Client/GameObjects/Components/Atmos/GasAnalyzerMenu.cs rename to Content.Client/Atmos/UI/GasAnalyzerMenu.cs index 15adc5890a..d05c454e38 100644 --- a/Content.Client/GameObjects/Components/Atmos/GasAnalyzerMenu.cs +++ b/Content.Client/Atmos/UI/GasAnalyzerMenu.cs @@ -9,9 +9,9 @@ using Robust.Client.UserInterface.CustomControls; using Robust.Shared.IoC; using Robust.Shared.Localization; using Robust.Shared.Maths; -using static Content.Shared.GameObjects.Components.SharedGasAnalyzerComponent; +using static Content.Shared.Atmos.Components.SharedGasAnalyzerComponent; -namespace Content.Client.GameObjects.Components.Atmos +namespace Content.Client.Atmos.UI { public class GasAnalyzerWindow : BaseWindow { diff --git a/Content.Client/Atmos/UI/GasCanisterBoundUserInterface.cs b/Content.Client/Atmos/UI/GasCanisterBoundUserInterface.cs new file mode 100644 index 0000000000..0f21ef4b1d --- /dev/null +++ b/Content.Client/Atmos/UI/GasCanisterBoundUserInterface.cs @@ -0,0 +1,86 @@ +using Content.Shared.Atmos.Piping.Binary.Components; +using JetBrains.Annotations; +using Robust.Client.GameObjects; +using Robust.Shared.GameObjects; + +namespace Content.Client.Atmos.UI +{ + /// + /// Initializes a and updates it when new server messages are received. + /// + [UsedImplicitly] + public class GasCanisterBoundUserInterface : BoundUserInterface + { + + private GasCanisterWindow? _window; + + public GasCanisterBoundUserInterface(ClientUserInterfaceComponent owner, object uiKey) : base(owner, uiKey) + { + } + + protected override void Open() + { + base.Open(); + + _window = new GasCanisterWindow(); + + if(State != null) + UpdateState(State); + + _window.OpenCentered(); + + _window.OnClose += Close; + _window.ReleaseValveCloseButtonPressed += OnReleaseValveClosePressed; + _window.ReleaseValveOpenButtonPressed += OnReleaseValveOpenPressed; + _window.ReleasePressureSliderChanged += OnReleasePressurePressed; + _window.TankEjectButtonPressed += OnTankEjectPressed; + } + + private void OnTankEjectPressed() + { + SendMessage(new GasCanisterHoldingTankEjectMessage()); + } + + private void OnReleasePressurePressed(float value) + { + SendMessage(new GasCanisterChangeReleasePressureMessage(value)); + } + + private void OnReleaseValveOpenPressed() + { + SendMessage(new GasCanisterChangeReleaseValveMessage(true)); + } + + private void OnReleaseValveClosePressed() + { + SendMessage(new GasCanisterChangeReleaseValveMessage(false)); + } + + /// + /// Update the UI state based on server-sent info + /// + /// + protected override void UpdateState(BoundUserInterfaceState state) + { + base.UpdateState(state); + if (_window == null || state is not GasCanisterBoundUserInterfaceState cast) + return; + + _window.SetCanisterLabel(cast.CanisterLabel); + _window.SetCanisterPressure(cast.CanisterPressure); + _window.SetPortStatus(cast.PortStatus); + _window.SetTankLabel(cast.TankLabel); + _window.SetTankPressure(cast.TankPressure); + _window.SetReleasePressureRange(cast.ReleasePressureMin, cast.ReleasePressureMax); + _window.SetReleasePressure(cast.ReleasePressure); + _window.SetReleaseValve(cast.ReleaseValve); + } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + if (!disposing) return; + _window?.Dispose(); + } + } +} diff --git a/Content.Client/Atmos/UI/GasCanisterWindow.xaml b/Content.Client/Atmos/UI/GasCanisterWindow.xaml new file mode 100644 index 0000000000..6bddc2ced3 --- /dev/null +++ b/Content.Client/Atmos/UI/GasCanisterWindow.xaml @@ -0,0 +1,52 @@ + + + + + + +