@@ -2,6 +2,7 @@ using System.Numerics;
|
|||||||
using Content.Client.Chat.Managers;
|
using Content.Client.Chat.Managers;
|
||||||
using Content.Shared.CCVar;
|
using Content.Shared.CCVar;
|
||||||
using Content.Shared.Chat;
|
using Content.Shared.Chat;
|
||||||
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Client.Graphics;
|
using Robust.Client.Graphics;
|
||||||
using Robust.Client.UserInterface;
|
using Robust.Client.UserInterface;
|
||||||
using Robust.Client.UserInterface.Controls;
|
using Robust.Client.UserInterface.Controls;
|
||||||
@@ -15,8 +16,8 @@ namespace Content.Client.Chat.UI
|
|||||||
{
|
{
|
||||||
[Dependency] private readonly IEyeManager _eyeManager = default!;
|
[Dependency] private readonly IEyeManager _eyeManager = default!;
|
||||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||||
[Dependency] private readonly SharedTransformSystem _xformSystem = default!;
|
|
||||||
[Dependency] protected readonly IConfigurationManager ConfigManager = default!;
|
[Dependency] protected readonly IConfigurationManager ConfigManager = default!;
|
||||||
|
private readonly SharedTransformSystem _xformSystem;
|
||||||
|
|
||||||
public enum SpeechType : byte
|
public enum SpeechType : byte
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ public sealed class ChatUIController : UIController
|
|||||||
[Dependency] private readonly IChatManager _manager = default!;
|
[Dependency] private readonly IChatManager _manager = default!;
|
||||||
[Dependency] private readonly IConfigurationManager _config = default!;
|
[Dependency] private readonly IConfigurationManager _config = default!;
|
||||||
[Dependency] private readonly IEyeManager _eye = default!;
|
[Dependency] private readonly IEyeManager _eye = default!;
|
||||||
[Dependency] private readonly IEntityManager _ent = default!;
|
|
||||||
[Dependency] private readonly IInputManager _input = default!;
|
[Dependency] private readonly IInputManager _input = default!;
|
||||||
[Dependency] private readonly IClientNetManager _net = default!;
|
[Dependency] private readonly IClientNetManager _net = default!;
|
||||||
[Dependency] private readonly IPlayerManager _player = default!;
|
[Dependency] private readonly IPlayerManager _player = default!;
|
||||||
@@ -54,13 +53,12 @@ public sealed class ChatUIController : UIController
|
|||||||
[Dependency] private readonly IStateManager _state = default!;
|
[Dependency] private readonly IStateManager _state = default!;
|
||||||
[Dependency] private readonly IGameTiming _timing = default!;
|
[Dependency] private readonly IGameTiming _timing = default!;
|
||||||
[Dependency] private readonly IReplayRecordingManager _replayRecording = default!;
|
[Dependency] private readonly IReplayRecordingManager _replayRecording = default!;
|
||||||
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
|
||||||
|
|
||||||
[UISystemDependency] private readonly ExamineSystem? _examine = default;
|
[UISystemDependency] private readonly ExamineSystem? _examine = default;
|
||||||
[UISystemDependency] private readonly GhostSystem? _ghost = default;
|
[UISystemDependency] private readonly GhostSystem? _ghost = default;
|
||||||
[UISystemDependency] private readonly TypingIndicatorSystem? _typingIndicator = default;
|
[UISystemDependency] private readonly TypingIndicatorSystem? _typingIndicator = default;
|
||||||
[UISystemDependency] private readonly ChatSystem? _chatSys = default;
|
[UISystemDependency] private readonly ChatSystem? _chatSys = default;
|
||||||
[UISystemDependency] private readonly SharedTransformSystem? _xformSystem = default!;
|
[UISystemDependency] private readonly TransformSystem? _xformSystem = default!;
|
||||||
|
|
||||||
[ValidatePrototypeId<ColorPalettePrototype>]
|
[ValidatePrototypeId<ColorPalettePrototype>]
|
||||||
private const string ChatNamePalette = "ChatNames";
|
private const string ChatNamePalette = "ChatNames";
|
||||||
@@ -180,8 +178,8 @@ public sealed class ChatUIController : UIController
|
|||||||
_net.RegisterNetMessage<MsgChatMessage>(OnChatMessage);
|
_net.RegisterNetMessage<MsgChatMessage>(OnChatMessage);
|
||||||
_net.RegisterNetMessage<MsgDeleteChatMessagesBy>(OnDeleteChatMessagesBy);
|
_net.RegisterNetMessage<MsgDeleteChatMessagesBy>(OnDeleteChatMessagesBy);
|
||||||
SubscribeNetworkEvent<DamageForceSayEvent>(OnDamageForceSay);
|
SubscribeNetworkEvent<DamageForceSayEvent>(OnDamageForceSay);
|
||||||
_cfg.OnValueChanged(CCVars.ChatEnableColorName, (value) => { _chatNameColorsEnabled = value; });
|
_config.OnValueChanged(CCVars.ChatEnableColorName, (value) => { _chatNameColorsEnabled = value; });
|
||||||
_chatNameColorsEnabled = _cfg.GetCVar(CCVars.ChatEnableColorName);
|
_chatNameColorsEnabled = _config.GetCVar(CCVars.ChatEnableColorName);
|
||||||
|
|
||||||
_speechBubbleRoot = new LayoutContainer();
|
_speechBubbleRoot = new LayoutContainer();
|
||||||
|
|
||||||
@@ -771,7 +769,7 @@ public sealed class ChatUIController : UIController
|
|||||||
ProcessChatMessage(msg);
|
ProcessChatMessage(msg);
|
||||||
|
|
||||||
if ((msg.Channel & ChatChannel.AdminRelated) == 0 ||
|
if ((msg.Channel & ChatChannel.AdminRelated) == 0 ||
|
||||||
_cfg.GetCVar(CCVars.ReplayRecordAdminChat))
|
_config.GetCVar(CCVars.ReplayRecordAdminChat))
|
||||||
{
|
{
|
||||||
_replayRecording.RecordClientMessage(msg);
|
_replayRecording.RecordClientMessage(msg);
|
||||||
}
|
}
|
||||||
@@ -782,7 +780,7 @@ public sealed class ChatUIController : UIController
|
|||||||
// color the name unless it's something like "the old man"
|
// color the name unless it's something like "the old man"
|
||||||
if ((msg.Channel == ChatChannel.Local || msg.Channel == ChatChannel.Whisper) && _chatNameColorsEnabled)
|
if ((msg.Channel == ChatChannel.Local || msg.Channel == ChatChannel.Whisper) && _chatNameColorsEnabled)
|
||||||
{
|
{
|
||||||
var grammar = _ent.GetComponentOrNull<GrammarComponent>(_ent.GetEntity(msg.SenderEntity));
|
var grammar = EntityManager.GetComponentOrNull<GrammarComponent>(EntityManager.GetEntity(msg.SenderEntity));
|
||||||
if (grammar != null && grammar.ProperNoun == true)
|
if (grammar != null && grammar.ProperNoun == true)
|
||||||
msg.WrappedMessage = SharedChatSystem.InjectTagInsideTag(msg, "Name", "color", GetNameColor(SharedChatSystem.GetStringInsideTag(msg, "Name")));
|
msg.WrappedMessage = SharedChatSystem.InjectTagInsideTag(msg, "Name", "color", GetNameColor(SharedChatSystem.GetStringInsideTag(msg, "Name")));
|
||||||
}
|
}
|
||||||
@@ -831,7 +829,7 @@ public sealed class ChatUIController : UIController
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ChatChannel.LOOC:
|
case ChatChannel.LOOC:
|
||||||
if (_cfg.GetCVar(CCVars.LoocAboveHeadShow))
|
if (_config.GetCVar(CCVars.LoocAboveHeadShow))
|
||||||
AddSpeechBubble(msg, SpeechBubble.SpeechType.Looc);
|
AddSpeechBubble(msg, SpeechBubble.SpeechType.Looc);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user