Skip to content

Commit

Permalink
Narrow gaslock, fix bidirectional pump UI overlap
Browse files Browse the repository at this point in the history
  • Loading branch information
whatston3 committed Jan 14, 2025
1 parent 42de0b6 commit d1a4afc
Show file tree
Hide file tree
Showing 20 changed files with 95 additions and 72 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Content.Client._NF.Atmos.UI;
using Content.Shared._NF.Atmos.BUIStates;
using Content.Shared._NF.Atmos.Piping.Binary.Components;
using Content.Shared._NF.Atmos.Piping.Binary.Messages;
using Content.Shared.Atmos;
using Content.Shared.Atmos.Piping.Binary.Components;
using Content.Shared.Localizations;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Content.Shared._NF.Atmos.Piping.Binary.Components;
using Content.Shared._NF.Atmos.Piping.Binary.Messages;
using Content.Shared.Atmos;
using Content.Shared.Atmos.Piping.Binary.Components;
using Content.Shared.Localizations;
Expand All @@ -8,26 +8,26 @@
namespace Content.Client._NF.Atmos.UI
{
/// <summary>
/// Initializes a <see cref="BidiGasPressurePumpWindow"/> and updates it when new server messages are received.
/// Initializes a <see cref="GasPressureBidiPumpWindow"/> and updates it when new server messages are received.
/// </summary>
[UsedImplicitly]
public sealed class BidiGasPressurePumpBoundUserInterface : BoundUserInterface
public sealed class GasPressureBidiPumpBoundUserInterface : BoundUserInterface
{
[ViewVariables]
private const float MaxPressure = Atmospherics.MaxOutputPressure;

[ViewVariables]
private BidiGasPressurePumpWindow? _window;
private GasPressureBidiPumpWindow? _window;

public BidiGasPressurePumpBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
public GasPressureBidiPumpBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}

protected override void Open()
{
base.Open();

_window = this.CreateWindow<BidiGasPressurePumpWindow>();
_window = this.CreateWindow<GasPressureBidiPumpWindow>();

_window.ToggleStatusButtonPressed += OnToggleStatusButtonPressed;
_window.ToggleDirectionButtonPressed += OnToggleDirectionButtonPressed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Content.Client._NF.Atmos.UI;
/// Client-side UI used to control a bidirectional gas pressure pump.
/// </summary>
[GenerateTypedNameReferences]
public sealed partial class BidiGasPressurePumpWindow : DefaultWindow
public sealed partial class GasPressureBidiPumpWindow : DefaultWindow
{
public bool PumpStatus = true;
public bool PumpInwards = false;
Expand All @@ -19,7 +19,7 @@ public sealed partial class BidiGasPressurePumpWindow : DefaultWindow
public event Action? ToggleDirectionButtonPressed;
public event Action<string>? PumpOutputPressureChanged;

public BidiGasPressurePumpWindow()
public GasPressureBidiPumpWindow()
{
RobustXamlLoader.Load(this);

Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Atmos/Consoles/AtmosAlertsComputerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
using Content.Server.NodeContainer.EntitySystems; // Frontier
using Content.Server.NodeContainer.Nodes; // Frontier
using Content.Shared._NF.Atmos.BUI; // Frontier
using Content.Shared._NF.Atmos.Piping.Binary.Components; // Frontier
using Content.Shared._NF.Atmos.Piping.Binary.Messages; // Frontier
using Content.Shared.Atmos.Piping.Binary.Components; // Frontier
using Content.Shared.Shuttles.Events; // Frontier
using Content.Server.Shuttles.Systems;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Shared.Player;
using Content.Shared._NF.Atmos.Piping.Binary.Components; // Frontier
using Content.Shared._NF.Atmos.Piping.Binary.Messages; // Frontier

namespace Content.Server.Atmos.Piping.Binary.EntitySystems
{
Expand Down Expand Up @@ -110,7 +110,7 @@ private void OnPumpLeaveAtmosphere(EntityUid uid, GasPressurePumpComponent pump,
UpdateAppearance(uid, pump);

DirtyUI(uid, pump);
_userInterfaceSystem.CloseUi(uid, GasPressurePumpUiKey.Key);
_userInterfaceSystem.CloseUi(uid, pump.UiKey); // Frontier: GasPressurePumpUiKey.Key<pump.UiKey
}

private void OnPumpActivate(EntityUid uid, GasPressurePumpComponent pump, ActivateInWorldEvent args)
Expand All @@ -123,7 +123,7 @@ private void OnPumpActivate(EntityUid uid, GasPressurePumpComponent pump, Activa

if (Transform(uid).Anchored)
{
_userInterfaceSystem.OpenUi(uid, GasPressurePumpUiKey.Key, actor.PlayerSession);
_userInterfaceSystem.OpenUi(uid, pump.UiKey, actor.PlayerSession); // Frontier: GasPressurePumpUiKey.Key<pump.UiKey
DirtyUI(uid, pump);
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

namespace Content.Shared.Atmos.Piping.Binary.Components
{
// Frontier: byte enum, add bidirectional key, key values
[Serializable, NetSerializable]
public enum GasPressurePumpUiKey
public enum GasPressurePumpUiKey : byte
{
Key,
BidiKey, // Frontier: bidirectional pumps
Key = 0,
BidiKey = 1,
}
// End Frontier

[Serializable, NetSerializable]
public sealed class GasPressurePumpBoundUserInterfaceState : BoundUserInterfaceState
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

using Robust.Shared.Serialization;

namespace Content.Shared._NF.Atmos.Piping.Binary.Components;
namespace Content.Shared._NF.Atmos.Piping.Binary.Messages;

[Serializable, NetSerializable]
public sealed class GasPressurePumpChangePumpDirectionMessage : BoundUserInterfaceMessage
Expand Down
2 changes: 1 addition & 1 deletion Resources/Locale/en-US/_NF/devices/device-network.ftl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
device-address-prefix-gas-drill = GDL-
device-address-prefix-sale-point = SLL-
device-address-prefix-gaslock = LCK-
device-address-prefix-staging-port = SPT-
device-address-prefix-portable-gaslock = PLK-
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,7 @@
ports:
- DockStatus
- type: Wires
layoutId: Docking
# - type: Construction
# graph: AirlockShuttle
# node: airlock
layoutId: Docking # TODO: rework these
- type: ApcPowerReceiver
powerLoad: 500
- type: ExtensionCableReceiver
Expand All @@ -122,7 +119,7 @@
- type: UserInterface
interfaces:
enum.GasPressurePumpUiKey.BidiKey:
type: BidiGasPressurePumpBoundUserInterface
type: GasPressureBidiPumpBoundUserInterface
- type: ActivatableUI
key: enum.GasPressurePumpUiKey.BidiKey
- type: DockablePump
Expand All @@ -135,6 +132,11 @@
sound:
path: /Audio/Ambience/Objects/gas_pump.ogg
- type: PipeAppearance
- type: Tag
tags:
- Unstackable
- Pipe
- ForceNoFixRotations

- type: entity
parent: BasePumpGaslock
Expand All @@ -149,7 +151,6 @@
- type: Occluder
- type: Sprite
sprite: _NF/Structures/Piping/Atmospherics/gaslock.rsi
# granularLayersRendering: true
drawdepth: Doors
layers:
- state: closed
Expand Down Expand Up @@ -182,50 +183,27 @@
False: { state: pumpPressureOnOut }
- type: StaticPrice
price: 350
- type: Tag
tags:
- Unstackable
- Pipe
- ForceNoFixRotations
- type: BlockWeather
- type: PlacementReplacement
key: walls
key: walls # For construction if this eventually supports it.
- type: IconSmooth
key: walls
mode: NoSprite
- type: PaintableAirlock
group: External
department: null

- type: entity
parent: Gaslock
id: GaslockReversed
suffix: Airtight, Reversed
description: Connects gas tanks on separate ships or stations together to allow gas transfer. Both stages must be set up to accept flow.
components:
- type: GasPressurePump
inlet: outlet
outlet: inlet
- type: DockablePump
pumpingInwards: true

- type: entity
parent: BasePumpGaslock
id: GaslockFrame
suffix: Docking
name: gas staging port
description: Connects gas pipes on separate ships or stations together to allow gas transfer. Both sides must be docked and pumping in the same direction to accept flow.
name: portable gaslock
description: Pumps gas through. Accepts docking, but cannot dock. Both sides must be docked and pumping in the same direction for gas to flow.
placement:
mode: SnapgridCenter
components:
- type: Sprite
sprite: _NF/Structures/Piping/Atmospherics/gaslock.rsi
# granularLayersRendering: true
sprite: _NF/Structures/Piping/Atmospherics/portable_gaslock.rsi
drawdepth: Doors
layers:
- sprite: Structures/Walls/solid.rsi
state: wall_girder
- state: frame_struts
- state: base
- state: closed_unlit
shader: unshaded
map: ["docked-unlit"]
Expand Down Expand Up @@ -255,23 +233,24 @@
False: { state: pumpPressureOnOut }
- type: StaticPrice
price: 100
- type: Tag
tags:
- Unstackable
- Pipe
- ForceNoFixRotations
- type: Docking
receiveOnly: true
- type: DeviceNetwork
prefix: device-address-prefix-staging-port

- type: entity
parent: GaslockFrame
id: GaslockFrameReversed
suffix: Docking, Reversed
components:
- type: GasPressurePump
inlet: outlet
outlet: inlet
- type: DockablePump
pumpingInwards: true
prefix: device-address-prefix-portable-gaslock
- type: Fixtures
fixtures:
fix1:
shape:
!type:PhysShapeAabb
bounds: "-0.25,-0.49,0.25,0.25" # narrow enough to fit through doors when pulled
density: 100
mask:
- FullTileMask
layer:
- AirlockLayer
docking:
shape:
!type:PhysShapeCircle
radius: 0.2
position: "0,-0.5"
hard: false
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
{
"name": "closed_unlit"
},
{
"name": "frame_struts"
},
{
"name": "panel_open"
},
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"version": 1,
"size":{
"x": 32,
"y": 32
},
"license": "CC-BY-SA-3.0",
"copyright": "closed, bolted_unlit taken from CEV-Eris at commit https://github.com/discordia-space/CEV-Eris/commit/14517938186858388656a6aee14bf47af9e9649f - then modified by 20kdc, AJCM-git and whatston3",
"copyright": "pump* taken from https://github.com/tgstation/tgstation at commit 57cd1d59ca019dd0e7811ac451f295f818e573da, modified by whatston3.",
"states":[
{
"name": "base"
},
{
"name": "closed_unlit"
},
{
"name": "panel_open"
},
{
"name": "pipeStraight",
"directions": 4
},
{
"name": "pumpPressure",
"directions": 4
},
{
"name": "pumpPressureOnIn",
"directions": 4,
"delays": [ [ 0.1, 0.1, 0.1, 0.1, 0.1 ],
[ 0.1, 0.1, 0.1, 0.1, 0.1 ],
[ 0.1, 0.1, 0.1, 0.1, 0.1 ],
[ 0.1, 0.1, 0.1, 0.1, 0.1 ] ]
},
{
"name": "pumpPressureOnOut",
"directions": 4,
"delays": [ [ 0.1, 0.1, 0.1, 0.1, 0.1 ],
[ 0.1, 0.1, 0.1, 0.1, 0.1 ],
[ 0.1, 0.1, 0.1, 0.1, 0.1 ],
[ 0.1, 0.1, 0.1, 0.1, 0.1 ] ]
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d1a4afc

Please sign in to comment.