Kill SharedEntityExtensions and all popup extensions (#20909)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
@@ -9,9 +9,7 @@ using Content.Server.DeviceNetwork.Systems;
|
||||
using Content.Server.NodeContainer;
|
||||
using Content.Server.NodeContainer.EntitySystems;
|
||||
using Content.Server.NodeContainer.Nodes;
|
||||
using Content.Shared.Atmos.Piping;
|
||||
using Content.Shared.Atmos.Piping.Binary.Components;
|
||||
using Content.Shared.Atmos.Piping.Unary.Components;
|
||||
using Content.Shared.Atmos.Visuals;
|
||||
using Content.Shared.Audio;
|
||||
using Content.Shared.Database;
|
||||
@@ -34,6 +32,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly NodeContainerSystem _nodeContainer = default!;
|
||||
[Dependency] private readonly DeviceNetworkSystem _deviceNetwork = default!;
|
||||
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
||||
|
||||
|
||||
public override void Initialize()
|
||||
@@ -59,7 +58,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
||||
|
||||
private void OnExamined(EntityUid uid, GasVolumePumpComponent 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-volume-pump-system-examined", out var str,
|
||||
@@ -98,14 +97,14 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
||||
{
|
||||
pump.Blocked = true;
|
||||
}
|
||||
|
||||
|
||||
if (previouslyBlocked != pump.Blocked)
|
||||
UpdateAppearance(uid, pump);
|
||||
if (pump.Blocked)
|
||||
return;
|
||||
|
||||
// We multiply the transfer rate in L/s by the seconds passed since the last process to get the liters.
|
||||
var removed = inlet.Air.RemoveVolume((float)(pump.TransferRate * args.dt));
|
||||
var removed = inlet.Air.RemoveVolume(pump.TransferRate * args.dt);
|
||||
|
||||
// Some of the gas from the mixture leaks when overclocked.
|
||||
if (pump.Overclocked)
|
||||
@@ -141,14 +140,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, GasVolumePumpUiKey.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;
|
||||
@@ -177,7 +176,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
||||
return;
|
||||
|
||||
_userInterfaceSystem.TrySetUiState(uid, GasVolumePumpUiKey.Key,
|
||||
new GasVolumePumpBoundUserInterfaceState(EntityManager.GetComponent<MetaDataComponent>(pump.Owner).EntityName, pump.TransferRate, pump.Enabled));
|
||||
new GasVolumePumpBoundUserInterfaceState(Name(uid), pump.TransferRate, pump.Enabled));
|
||||
}
|
||||
|
||||
private void UpdateAppearance(EntityUid uid, GasVolumePumpComponent? pump = null, AppearanceComponent? appearance = null)
|
||||
|
||||
Reference in New Issue
Block a user