Added pop up message for single-use UI (#22573)
This commit is contained in:
@@ -5,6 +5,7 @@ using Content.Shared.Hands;
|
|||||||
using Content.Shared.Hands.Components;
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Interaction.Events;
|
using Content.Shared.Interaction.Events;
|
||||||
|
using Content.Shared.Popups;
|
||||||
using Content.Shared.UserInterface;
|
using Content.Shared.UserInterface;
|
||||||
using Content.Shared.Verbs;
|
using Content.Shared.Verbs;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
@@ -17,6 +18,7 @@ public sealed partial class ActivatableUISystem : EntitySystem
|
|||||||
[Dependency] private readonly IAdminManager _adminManager = default!;
|
[Dependency] private readonly IAdminManager _adminManager = default!;
|
||||||
[Dependency] private readonly ActionBlockerSystem _blockerSystem = default!;
|
[Dependency] private readonly ActionBlockerSystem _blockerSystem = default!;
|
||||||
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
|
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
|
||||||
|
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
@@ -142,6 +144,9 @@ public sealed partial class ActivatableUISystem : EntitySystem
|
|||||||
|
|
||||||
if (aui.SingleUser && (aui.CurrentSingleUser != null) && (actor.PlayerSession != aui.CurrentSingleUser))
|
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.
|
// If we get here, supposedly, the object is in use.
|
||||||
// Check with BUI that it's ACTUALLY in use just in case.
|
// Check with BUI that it's ACTUALLY in use just in case.
|
||||||
// Since this could brick the object if it goes wrong.
|
// Since this could brick the object if it goes wrong.
|
||||||
|
|||||||
@@ -22,4 +22,6 @@ two-way-lever-left = push left
|
|||||||
two-way-lever-right = push right
|
two-way-lever-right = push right
|
||||||
two-way-lever-cant = can't push the lever that way!
|
two-way-lever-cant = can't push the lever that way!
|
||||||
|
|
||||||
recycler-count-items = Recycled {$items} objects.
|
recycler-count-items = Recycled {$items} objects.
|
||||||
|
|
||||||
|
machine-already-in-use = {CAPITALIZE(THE($machine))} is already in use.
|
||||||
Reference in New Issue
Block a user