diff --git a/Content.Client/Popups/PopupSystem.cs b/Content.Client/Popups/PopupSystem.cs index d9f47c0799..d24e2aff72 100644 --- a/Content.Client/Popups/PopupSystem.cs +++ b/Content.Client/Popups/PopupSystem.cs @@ -1,4 +1,5 @@ using System.Linq; +using Content.Client.UserInterface.Systems.Chat; using Content.Shared.Examine; using Content.Shared.Chat; using Content.Shared.GameTicking; @@ -10,7 +11,6 @@ using Robust.Client.Player; using Robust.Client.UserInterface; using Robust.Shared.Configuration; using Robust.Shared.Map; -using Robust.Shared.Network; using Robust.Shared.Player; using Robust.Shared.Prototypes; using Robust.Shared.Replays; @@ -31,7 +31,6 @@ namespace Content.Client.Popups [Dependency] private readonly IReplayRecordingManager _replayRecording = default!; [Dependency] private readonly ExamineSystemShared _examine = default!; [Dependency] private readonly SharedTransformSystem _transform = default!; - [Dependency] private readonly IClientNetManager _clientNet = default!; public IReadOnlyList WorldLabels => _aliveWorldLabels; public IReadOnlyList CursorLabels => _aliveCursorLabels; @@ -94,6 +93,13 @@ namespace Content.Client.Popups _aliveWorldLabels.Add(label); + // START WhiteDream + if (!_isLogging) + return; + + if (!_examine.InRangeUnOccluded(_playerManager.LocalEntity!.Value, coordinates, 10)) + return; + var fontSizeDict = new Dictionary { { PopupType.Medium, "12" }, @@ -103,14 +109,16 @@ namespace Content.Client.Popups }; var fontsize = fontSizeDict.GetValueOrDefault(type, "10"); - var fontcolor = type is PopupType.LargeCaution or PopupType.MediumCaution or PopupType.SmallCaution ? "c62828" : "aeabc4"; + var fontcolor = type is PopupType.LargeCaution or PopupType.MediumCaution or PopupType.SmallCaution + ? "c62828" + : "aeabc4"; - if (_isLogging) - { - var wrappedMEssage = $"[font size={fontsize}][color=#{fontcolor}]{message}[/color][/font]"; - var chatMsg = new ChatMessage(ChatChannel.Emotes, message, wrappedMEssage, GetNetEntity(EntityUid.Invalid), null); - _clientNet.DispatchLocalNetMessage(new MsgChatMessage { Message = chatMsg }); - } + var wrappedMEssage = $"[font size={fontsize}][color=#{fontcolor}]{message}[/color][/font]"; + var chatMsg = new ChatMessage(ChatChannel.Emotes, message, wrappedMEssage, + GetNetEntity(EntityUid.Invalid), null); + _uiManager.GetUIController().ProcessChatMessage(chatMsg); + + // END WhiteDream } #region Abstract Method Implementations