Adds a UI for gas mixers (#5165)

Co-authored-by: E F R <602406+Efruit@users.noreply.github.com>
Co-authored-by: Paul Ritter <ritter.paul1@googlemail.com>
Co-authored-by: ike709 <ike709@github.com>
This commit is contained in:
ike709
2021-11-11 16:10:21 -06:00
committed by GitHub
parent c6615fd805
commit c06f52a456
12 changed files with 401 additions and 6 deletions

View File

@@ -8,6 +8,7 @@ using Content.Shared.Atmos.Piping;
using Content.Shared.Atmos.Piping.Binary.Components;
using Content.Shared.Examine;
using Content.Shared.Interaction;
using Content.Shared.Popups;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
@@ -94,8 +95,15 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
if (!args.User.TryGetComponent(out ActorComponent? actor))
return;
_userInterfaceSystem.TryOpen(uid, GasPressurePumpUiKey.Key, actor.PlayerSession);
DirtyUI(uid, component);
if (component.Owner.Transform.Anchored)
{
_userInterfaceSystem.TryOpen(uid, GasPressurePumpUiKey.Key, actor.PlayerSession);
DirtyUI(uid, component);
}
else
{
args.User.PopupMessageCursor(Loc.GetString("comp-gas-pump-ui-needs-anchor"));
}
args.Handled = true;
}

View File

@@ -8,6 +8,7 @@ using Content.Shared.Atmos;
using Content.Shared.Atmos.Piping.Binary.Components;
using Content.Shared.Examine;
using Content.Shared.Interaction;
using Content.Shared.Popups;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
@@ -99,8 +100,15 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
if (!args.User.TryGetComponent(out ActorComponent? actor))
return;
_userInterfaceSystem.TryOpen(uid, GasVolumePumpUiKey.Key, actor.PlayerSession);
DirtyUI(uid, component);
if (component.Owner.Transform.Anchored)
{
_userInterfaceSystem.TryOpen(uid, GasVolumePumpUiKey.Key, actor.PlayerSession);
DirtyUI(uid, component);
}
else
{
args.User.PopupMessageCursor(Loc.GetString("comp-gas-pump-ui-needs-anchor"));
}
args.Handled = true;
}