Added pop up message for single-use UI (#22573)

This commit is contained in:
chromiumboy
2023-12-16 08:40:24 -06:00
committed by GitHub
parent f136db1770
commit aa08cc3e53
2 changed files with 8 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ using Content.Shared.Hands;
using Content.Shared.Hands.Components;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Events;
using Content.Shared.Popups;
using Content.Shared.UserInterface;
using Content.Shared.Verbs;
using Robust.Server.GameObjects;
@@ -17,6 +18,7 @@ public sealed partial class ActivatableUISystem : EntitySystem
[Dependency] private readonly IAdminManager _adminManager = default!;
[Dependency] private readonly ActionBlockerSystem _blockerSystem = default!;
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
public override void Initialize()
{
@@ -142,6 +144,9 @@ public sealed partial class ActivatableUISystem : EntitySystem
if (aui.SingleUser && (aui.CurrentSingleUser != null) && (actor.PlayerSession != aui.CurrentSingleUser))
{
string message = Loc.GetString("machine-already-in-use", ("machine", uiEntity));
_popupSystem.PopupEntity(message, uiEntity, user);
// If we get here, supposedly, the object is in use.
// Check with BUI that it's ACTUALLY in use just in case.
// Since this could brick the object if it goes wrong.

View File

@@ -23,3 +23,5 @@ two-way-lever-right = push right
two-way-lever-cant = can't push the lever that way!
recycler-count-items = Recycled {$items} objects.
machine-already-in-use = {CAPITALIZE(THE($machine))} is already in use.