Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Ап #298

Merged
merged 3 commits into from
Jun 14, 2024
Merged

Ап #298

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,11 @@ public sealed partial class GasPressurePumpComponent : Component
[ViewVariables(VVAccess.ReadWrite)]
[DataField("maxTargetPressure")]
public float MaxTargetPressure = Atmospherics.MaxOutputPressure;

/// <summary>
/// Frontier - Start the pump with the map.
/// </summary>
[DataField]
public bool StartOnMapInit { get; set; } = false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,11 @@ public sealed partial class GasVolumePumpComponent : Component

[DataField("lastMolesTransferred")]
public float LastMolesTransferred;

/// <summary>
/// Frontier - Start the pump with the map.
/// </summary>
[DataField]
public bool StartOnMapInit { get; set; } = false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public override void Initialize()
// Bound UI subscriptions
SubscribeLocalEvent<GasPressurePumpComponent, GasPressurePumpChangeOutputPressureMessage>(OnOutputPressureChangeMessage);
SubscribeLocalEvent<GasPressurePumpComponent, GasPressurePumpToggleStatusMessage>(OnToggleStatusMessage);

SubscribeLocalEvent<GasPressurePumpComponent, MapInitEvent>(OnMapInit); // Frontier
}

private void OnInit(EntityUid uid, GasPressurePumpComponent pump, ComponentInit args)
Expand Down Expand Up @@ -153,5 +155,17 @@ private void UpdateAppearance(EntityUid uid, GasPressurePumpComponent? pump = nu

_appearance.SetData(uid, PumpVisuals.Enabled, pump.Enabled, appearance);
}

private void OnMapInit(EntityUid uid, GasPressurePumpComponent pump, MapInitEvent args) // Frontier - Init on map
{
if (pump.StartOnMapInit)
{
pump.Enabled = true;
UpdateAppearance(uid, pump);

DirtyUI(uid, pump);
_userInterfaceSystem.CloseUi(uid, GasPressurePumpUiKey.Key);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public override void Initialize()
SubscribeLocalEvent<GasVolumePumpComponent, GasVolumePumpToggleStatusMessage>(OnToggleStatusMessage);

SubscribeLocalEvent<GasVolumePumpComponent, DeviceNetworkPacketEvent>(OnPacketRecv);

SubscribeLocalEvent<GasVolumePumpComponent, MapInitEvent>(OnMapInit); // Frontier
}

private void OnInit(EntityUid uid, GasVolumePumpComponent pump, ComponentInit args)
Expand Down Expand Up @@ -206,5 +208,17 @@ private void OnPacketRecv(EntityUid uid, GasVolumePumpComponent component, Devic
return;
}
}

private void OnMapInit(EntityUid uid, GasVolumePumpComponent pump, MapInitEvent args) // Frontier - Init on map
{
if (pump.StartOnMapInit)
{
pump.Enabled = true;
UpdateAppearance(uid, pump);

DirtyUI(uid, pump);
_userInterfaceSystem.CloseUi(uid, GasVolumePumpUiKey.Key);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,11 @@ public sealed partial class GasMixerComponent : Component
[ViewVariables(VVAccess.ReadWrite)]
[DataField("inletTwoConcentration")]
public float InletTwoConcentration = 0.5f;

/// <summary>
/// Frontier - Start the pump with the map.
/// </summary>
[DataField]
public bool StartOnMapInit { get; set; } = false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public override void Initialize()
SubscribeLocalEvent<GasMixerComponent, GasMixerToggleStatusMessage>(OnToggleStatusMessage);

SubscribeLocalEvent<GasMixerComponent, AtmosDeviceDisabledEvent>(OnMixerLeaveAtmosphere);

SubscribeLocalEvent<GasMixerComponent, MapInitEvent>(OnMapInit); // Frontier
}

private void OnInit(EntityUid uid, GasMixerComponent mixer, ComponentInit args)
Expand Down Expand Up @@ -232,5 +234,17 @@ private void OnMixerAnalyzed(EntityUid uid, GasMixerComponent component, GasAnal

args.DeviceFlipped = inletOne != null && inletTwo != null && inletOne.CurrentPipeDirection.ToDirection() == inletTwo.CurrentPipeDirection.ToDirection().GetClockwise90Degrees();
}

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);
}
}
}
}
6 changes: 6 additions & 0 deletions Resources/Changelog/Changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5057,3 +5057,9 @@ Entries:
message: New omelette recipe using expensive hard to find ingredients.
id: 5036
time: '2024-06-14T00:02:44.0000000+00:00'
- author: dvir01
changes:
- type: Add
message: Added new pumps that start on when places, to be used in mapping.
id: 5037
time: '2024-06-14T14:46:25.0000000+00:00'
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
Slash: 0.8
Piercing: 0.8
Heat: 0.4
Radiation: 0.0
Radiation: 0.05 # Frontier - 0<0.05
Caustic: 0.7
- type: ClothingSpeedModifier
walkModifier: 0.75
Expand Down Expand Up @@ -1004,4 +1004,4 @@
sprintModifier: 0.9
- type: HeldSpeedModifier
- type: ToggleableClothing
clothingPrototype: ClothingHeadHelmetHardsuitSanta
clothingPrototype: ClothingHeadHelmetHardsuitSanta
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Loading