]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Added pop up message for single-use UI (#22573)
authorchromiumboy <50505512+chromiumboy@users.noreply.github.com>
Sat, 16 Dec 2023 14:40:24 +0000 (08:40 -0600)
committerGitHub <noreply@github.com>
Sat, 16 Dec 2023 14:40:24 +0000 (09:40 -0500)
Content.Server/UserInterface/ActivatableUISystem.cs
Resources/Locale/en-US/machine/machine.ftl

index adeeed7c19d3933913939b55b7c4121380d11f54..459a704911f688f2da25f23ce83bce4a7d688bd1 100644 (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.
index e23c9791cda4f00ab42d63317522c3214e6ba1e0..458e78305966d8704e8be4a6dac81aca7fc9d8ff 100644 (file)
@@ -22,4 +22,6 @@ two-way-lever-left = push left
 two-way-lever-right = push right
 two-way-lever-cant = can't push the lever that way!
 
-recycler-count-items = Recycled {$items} objects.
\ No newline at end of file
+recycler-count-items = Recycled {$items} objects.
+
+machine-already-in-use = {CAPITALIZE(THE($machine))} is already in use.
\ No newline at end of file