Kill SharedEntityExtensions and all popup extensions (#20909)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
@@ -27,6 +27,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
||||
[Dependency] private readonly SharedAmbientSoundSystem _ambientSoundSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly NodeContainerSystem _nodeContainer = default!;
|
||||
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -49,14 +50,16 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
||||
|
||||
private void OnExamined(EntityUid uid, GasPressurePumpComponent pump, ExaminedEvent args)
|
||||
{
|
||||
if (!EntityManager.GetComponent<TransformComponent>(pump.Owner).Anchored || !args.IsInDetailsRange) // Not anchored? Out of range? No status.
|
||||
if (!EntityManager.GetComponent<TransformComponent>(uid).Anchored || !args.IsInDetailsRange) // Not anchored? Out of range? No status.
|
||||
return;
|
||||
|
||||
if (Loc.TryGetString("gas-pressure-pump-system-examined", out var str,
|
||||
("statusColor", "lightblue"), // TODO: change with pressure?
|
||||
("pressure", pump.TargetPressure)
|
||||
))
|
||||
("statusColor", "lightblue"), // TODO: change with pressure?
|
||||
("pressure", pump.TargetPressure)
|
||||
))
|
||||
{
|
||||
args.PushMarkup(str);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnPumpUpdated(EntityUid uid, GasPressurePumpComponent pump, AtmosDeviceUpdateEvent args)
|
||||
@@ -66,7 +69,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
||||
|| !_nodeContainer.TryGetNode(nodeContainer, pump.InletName, out PipeNode? inlet)
|
||||
|| !_nodeContainer.TryGetNode(nodeContainer, pump.OutletName, out PipeNode? outlet))
|
||||
{
|
||||
_ambientSoundSystem.SetAmbience(pump.Owner, false);
|
||||
_ambientSoundSystem.SetAmbience(uid, false);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -74,7 +77,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
||||
|
||||
if (outputStartingPressure >= pump.TargetPressure)
|
||||
{
|
||||
_ambientSoundSystem.SetAmbience(pump.Owner, false);
|
||||
_ambientSoundSystem.SetAmbience(uid, false);
|
||||
return; // No need to pump gas if target has been reached.
|
||||
}
|
||||
|
||||
@@ -86,7 +89,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
||||
|
||||
var removed = inlet.Air.Remove(transferMoles);
|
||||
_atmosphereSystem.Merge(outlet.Air, removed);
|
||||
_ambientSoundSystem.SetAmbience(pump.Owner, removed.TotalMoles > 0f);
|
||||
_ambientSoundSystem.SetAmbience(uid, removed.TotalMoles > 0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,14 +107,14 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
||||
if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor))
|
||||
return;
|
||||
|
||||
if (EntityManager.GetComponent<TransformComponent>(pump.Owner).Anchored)
|
||||
if (Transform(uid).Anchored)
|
||||
{
|
||||
_userInterfaceSystem.TryOpen(uid, GasPressurePumpUiKey.Key, actor.PlayerSession);
|
||||
DirtyUI(uid, pump);
|
||||
}
|
||||
else
|
||||
{
|
||||
args.User.PopupMessageCursor(Loc.GetString("comp-gas-pump-ui-needs-anchor"));
|
||||
_popup.PopupCursor(Loc.GetString("comp-gas-pump-ui-needs-anchor"), args.User);
|
||||
}
|
||||
|
||||
args.Handled = true;
|
||||
@@ -141,7 +144,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
||||
return;
|
||||
|
||||
_userInterfaceSystem.TrySetUiState(uid, GasPressurePumpUiKey.Key,
|
||||
new GasPressurePumpBoundUserInterfaceState(EntityManager.GetComponent<MetaDataComponent>(pump.Owner).EntityName, pump.TargetPressure, pump.Enabled));
|
||||
new GasPressurePumpBoundUserInterfaceState(EntityManager.GetComponent<MetaDataComponent>(uid).EntityName, pump.TargetPressure, pump.Enabled));
|
||||
}
|
||||
|
||||
private void UpdateAppearance(EntityUid uid, GasPressurePumpComponent? pump = null, AppearanceComponent? appearance = null)
|
||||
|
||||
Reference in New Issue
Block a user