]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix voice mask popup location (#21638)
authorBakke <luringens@protonmail.com>
Mon, 13 Nov 2023 22:55:24 +0000 (23:55 +0100)
committerGitHub <noreply@github.com>
Mon, 13 Nov 2023 22:55:24 +0000 (15:55 -0700)
The voice mask confirmation and error popups were placed at the cursor,
which made the popup render hidden under the voice mask UI. This moves
the message to the player entity, and colors the error feedback red to
make it more distinct.

Content.Server/VoiceMask/VoiceMaskSystem.cs

index 1df66b608cdb25f2ba1bf88a680ac6eda9252eb2..81ff76fb7a73fec35cdd893109767e8690fe6739 100644 (file)
@@ -3,6 +3,7 @@ using Content.Server.Chat.Systems;
 using Content.Server.Popups;
 using Content.Shared.Database;
 using Content.Shared.Inventory.Events;
+using Content.Shared.Popups;
 using Content.Shared.Preferences;
 using Content.Shared.VoiceMask;
 using Robust.Server.GameObjects;
@@ -35,7 +36,7 @@ public sealed partial class VoiceMaskSystem : EntitySystem
     {
         if (message.Name.Length > HumanoidCharacterProfile.MaxNameLength || message.Name.Length <= 0)
         {
-            _popupSystem.PopupCursor(Loc.GetString("voice-mask-popup-failure"), message.Session);
+            _popupSystem.PopupEntity(Loc.GetString("voice-mask-popup-failure"), uid, message.Session, PopupType.SmallCaution);
             return;
         }
 
@@ -45,7 +46,7 @@ public sealed partial class VoiceMaskSystem : EntitySystem
         else
             _adminLogger.Add(LogType.Action, LogImpact.Medium, $"Voice of {ToPrettyString(uid):mask} set: {component.VoiceName}");
 
-        _popupSystem.PopupCursor(Loc.GetString("voice-mask-popup-success"), message.Session);
+        _popupSystem.PopupEntity(Loc.GetString("voice-mask-popup-success"), uid, message.Session);
 
         TrySetLastKnownName(uid, message.Name);