Vordenburg
2023-01-01 01:21:26 -05:00
committed by GitHub
parent b305a8fdab
commit efb7e0cc22
2 changed files with 21 additions and 15 deletions

View File

@@ -28,6 +28,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
[Dependency] private readonly UserInterfaceSystem _userInterfaceSystem = default!; [Dependency] private readonly UserInterfaceSystem _userInterfaceSystem = default!;
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!; [Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
[Dependency] private readonly IAdminLogManager _adminLogger = default!; [Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
[Dependency] private readonly SharedHandsSystem _handsSystem = default!; [Dependency] private readonly SharedHandsSystem _handsSystem = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!; [Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!; [Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!;
@@ -206,19 +207,19 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
if (canister.Air.Pressure < 10) if (canister.Air.Pressure < 10)
{ {
appearance.SetData(GasCanisterVisuals.PressureState, 0); _appearanceSystem.SetData(uid, GasCanisterVisuals.PressureState, 0, appearance);
} }
else if (canister.Air.Pressure < Atmospherics.OneAtmosphere) else if (canister.Air.Pressure < Atmospherics.OneAtmosphere)
{ {
appearance.SetData(GasCanisterVisuals.PressureState, 1); _appearanceSystem.SetData(uid, GasCanisterVisuals.PressureState, 1, appearance);
} }
else if (canister.Air.Pressure < (15 * Atmospherics.OneAtmosphere)) else if (canister.Air.Pressure < (15 * Atmospherics.OneAtmosphere))
{ {
appearance.SetData(GasCanisterVisuals.PressureState, 2); _appearanceSystem.SetData(uid, GasCanisterVisuals.PressureState, 2, appearance);
} }
else else
{ {
appearance.SetData(GasCanisterVisuals.PressureState, 3); _appearanceSystem.SetData(uid, GasCanisterVisuals.PressureState, 3, appearance);
} }
} }
@@ -234,7 +235,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
return; return;
} }
_userInterfaceSystem.GetUiOrNull(uid, GasCanisterUiKey.Key)?.Open(actor.PlayerSession); _userInterfaceSystem.TryOpen(uid, GasCanisterUiKey.Key, actor.PlayerSession);
args.Handled = true; args.Handled = true;
} }
@@ -246,13 +247,13 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
if (TryComp<LockComponent>(uid, out var lockComponent) && lockComponent.Locked) if (TryComp<LockComponent>(uid, out var lockComponent) && lockComponent.Locked)
return; return;
_userInterfaceSystem.GetUiOrNull(uid, GasCanisterUiKey.Key)?.Open(actor.PlayerSession); _userInterfaceSystem.TryOpen(uid, GasCanisterUiKey.Key, actor.PlayerSession);
args.Handled = true; args.Handled = true;
} }
private void OnCanisterInteractUsing(EntityUid canister, GasCanisterComponent component, InteractUsingEvent args) private void OnCanisterInteractUsing(EntityUid canister, GasCanisterComponent component, InteractUsingEvent args)
{ {
var container = canister.EnsureContainer<ContainerSlot>(component.ContainerName); var container = _containerSystem.EnsureContainer<ContainerSlot>(canister, component.ContainerName);
// Container full. // Container full.
if (container.ContainedEntity != null) if (container.ContainedEntity != null)
@@ -277,10 +278,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
DirtyUI(uid, component); DirtyUI(uid, component);
if (!EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance)) _appearanceSystem.SetData(uid, GasCanisterVisuals.TankInserted, true);
return;
appearance.SetData(GasCanisterVisuals.TankInserted, true);
} }
private void OnCanisterContainerRemoved(EntityUid uid, GasCanisterComponent component, EntRemovedFromContainerMessage args) private void OnCanisterContainerRemoved(EntityUid uid, GasCanisterComponent component, EntRemovedFromContainerMessage args)
@@ -290,10 +288,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
DirtyUI(uid, component); DirtyUI(uid, component);
if (!EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance)) _appearanceSystem.SetData(uid, GasCanisterVisuals.TankInserted, false);
return;
appearance.SetData(GasCanisterVisuals.TankInserted, false);
} }
/// <summary> /// <summary>

View File

@@ -53,6 +53,7 @@
max: 1 max: 1
- !type:DoActsBehavior - !type:DoActsBehavior
acts: [ "Destruction" ] acts: [ "Destruction" ]
- !type:DumpCanisterBehavior
- type: Damageable - type: Damageable
damageContainer: Inorganic damageContainer: Inorganic
damageModifierSet: Metallic damageModifierSet: Metallic
@@ -124,6 +125,7 @@
max: 1 max: 1
- !type:DoActsBehavior - !type:DoActsBehavior
acts: [ "Destruction" ] acts: [ "Destruction" ]
- !type:DumpCanisterBehavior
# Filled canisters, contain 1871.71051 moles each # Filled canisters, contain 1871.71051 moles each
@@ -157,6 +159,7 @@
max: 1 max: 1
- !type:DoActsBehavior - !type:DoActsBehavior
acts: [ "Destruction" ] acts: [ "Destruction" ]
- !type:DumpCanisterBehavior
- type: entity - type: entity
parent: GasCanister parent: GasCanister
@@ -187,6 +190,7 @@
max: 1 max: 1
- !type:DoActsBehavior - !type:DoActsBehavior
acts: [ "Destruction" ] acts: [ "Destruction" ]
- !type:DumpCanisterBehavior
- type: entity - type: entity
parent: GasCanister parent: GasCanister
@@ -218,6 +222,7 @@
max: 1 max: 1
- !type:DoActsBehavior - !type:DoActsBehavior
acts: [ "Destruction" ] acts: [ "Destruction" ]
- !type:DumpCanisterBehavior
- type: entity - type: entity
parent: GasCanister parent: GasCanister
@@ -250,6 +255,7 @@
max: 1 max: 1
- !type:DoActsBehavior - !type:DoActsBehavior
acts: [ "Destruction" ] acts: [ "Destruction" ]
- !type:DumpCanisterBehavior
- type: Lock - type: Lock
locked: true locked: true
@@ -322,6 +328,7 @@
max: 1 max: 1
- !type:DoActsBehavior - !type:DoActsBehavior
acts: [ "Destruction" ] acts: [ "Destruction" ]
- !type:DumpCanisterBehavior
- type: Lock - type: Lock
locked: true locked: true
@@ -359,6 +366,7 @@
max: 1 max: 1
- !type:DoActsBehavior - !type:DoActsBehavior
acts: [ "Destruction" ] acts: [ "Destruction" ]
- !type:DumpCanisterBehavior
- type: entity - type: entity
parent: GasCanister parent: GasCanister
@@ -395,6 +403,7 @@
max: 1 max: 1
- !type:DoActsBehavior - !type:DoActsBehavior
acts: [ "Destruction" ] acts: [ "Destruction" ]
- !type:DumpCanisterBehavior
- type: Lock - type: Lock
locked: true locked: true
@@ -434,6 +443,7 @@
max: 1 max: 1
- !type:DoActsBehavior - !type:DoActsBehavior
acts: [ "Destruction" ] acts: [ "Destruction" ]
- !type:DumpCanisterBehavior
- type: entity - type: entity
parent: GasCanister parent: GasCanister
@@ -471,6 +481,7 @@
max: 1 max: 1
- !type:DoActsBehavior - !type:DoActsBehavior
acts: [ "Destruction" ] acts: [ "Destruction" ]
- !type:DumpCanisterBehavior
- type: Lock - type: Lock
locked: true locked: true