diff --git a/Content.Client/CharacterInfo/CharacterInfoSystem.cs b/Content.Client/CharacterInfo/CharacterInfoSystem.cs index aeaa48c6f2..2f06924edd 100644 --- a/Content.Client/CharacterInfo/CharacterInfoSystem.cs +++ b/Content.Client/CharacterInfo/CharacterInfoSystem.cs @@ -31,9 +31,11 @@ public sealed class CharacterInfoSystem : EntitySystem private void OnCharacterInfoEvent(CharacterInfoEvent msg, EntitySessionEventArgs args) { - var entity = GetEntity(msg.NetEntity); - var data = new CharacterData(entity, msg.JobTitle, msg.Objectives, msg.Briefing, Name(entity)); + // DeltaV - Refactored to use TryGetEntity instead of GetEntity because of message highlighting which requests character info too soon and I don't know how to delay it properly + if (!TryGetEntity(msg.NetEntity, out var entity)) + return; + var data = new CharacterData(entity.Value, msg.JobTitle, msg.Objectives, msg.Briefing, Name(entity.Value)); OnCharacterUpdate?.Invoke(data); } diff --git a/Content.Client/UserInterface/Systems/Chat/ChatUIController.cs b/Content.Client/UserInterface/Systems/Chat/ChatUIController.cs index c02683898b..15e748e70e 100644 --- a/Content.Client/UserInterface/Systems/Chat/ChatUIController.cs +++ b/Content.Client/UserInterface/Systems/Chat/ChatUIController.cs @@ -44,7 +44,8 @@ using Content.Client.Nyanotrasen.Chat; //Nyano - Summary: chat namespace. namespace Content.Client.UserInterface.Systems.Chat; -public sealed class ChatUIController : UIController +// DeltaV - Make partial to implement message highlighting +public sealed partial class ChatUIController : UIController { [Dependency] private readonly IClientAdminManager _admin = default!; [Dependency] private readonly IChatManager _manager = default!; @@ -245,6 +246,7 @@ public sealed class ChatUIController : UIController _config.OnValueChanged(CCVars.ChatWindowOpacity, OnChatWindowOpacityChanged); + InitializeChatHighlights(); // DeltaV - Message highlighting } public void OnScreenLoad() @@ -839,6 +841,14 @@ public sealed class ChatUIController : UIController msg.WrappedMessage = SharedChatSystem.InjectTagInsideTag(msg, "Name", "color", GetNameColor(SharedChatSystem.GetStringInsideTag(msg, "Name"))); } + // DeltaV - Message highlighting start + // Color any words choosen by the client. + foreach (var highlight in _highlights) + { + msg.WrappedMessage = SharedChatSystem.InjectTagAroundString(msg, highlight, "color", _highlightsColor); + } + // DeltaV - Message highlighting end + // Color any codewords for minds that have roles that use them if (_player.LocalUser != null && _mindSystem != null && _roleCodewordSystem != null) { diff --git a/Content.Client/UserInterface/Systems/Chat/Controls/ChannelFilterPopup.xaml b/Content.Client/UserInterface/Systems/Chat/Controls/ChannelFilterPopup.xaml index 459c44eee2..d7c485fcb2 100644 --- a/Content.Client/UserInterface/Systems/Chat/Controls/ChannelFilterPopup.xaml +++ b/Content.Client/UserInterface/Systems/Chat/Controls/ChannelFilterPopup.xaml @@ -1,10 +1,34 @@ - - - + + + +