Fix voice mask popup location (#21638)

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.
This commit is contained in:
Bakke
2023-11-13 23:55:24 +01:00
committed by GitHub
parent 966201c6b3
commit 91a2479b66

View 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);