Cleanup static Logger use in ChatBox (#38405)
Convert static logger to resolved, resolve entman
This commit is contained in:
@@ -19,8 +19,11 @@ namespace Content.Client.UserInterface.Systems.Chat.Widgets;
|
|||||||
[Virtual]
|
[Virtual]
|
||||||
public partial class ChatBox : UIWidget
|
public partial class ChatBox : UIWidget
|
||||||
{
|
{
|
||||||
|
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||||
|
[Dependency] private readonly ILogManager _log = default!;
|
||||||
|
|
||||||
|
private readonly ISawmill _sawmill;
|
||||||
private readonly ChatUIController _controller;
|
private readonly ChatUIController _controller;
|
||||||
private readonly IEntityManager _entManager;
|
|
||||||
|
|
||||||
public bool Main { get; set; }
|
public bool Main { get; set; }
|
||||||
|
|
||||||
@@ -29,7 +32,7 @@ public partial class ChatBox : UIWidget
|
|||||||
public ChatBox()
|
public ChatBox()
|
||||||
{
|
{
|
||||||
RobustXamlLoader.Load(this);
|
RobustXamlLoader.Load(this);
|
||||||
_entManager = IoCManager.Resolve<IEntityManager>();
|
_sawmill = _log.GetSawmill("chat");
|
||||||
|
|
||||||
ChatInput.Input.OnTextEntered += OnTextEntered;
|
ChatInput.Input.OnTextEntered += OnTextEntered;
|
||||||
ChatInput.Input.OnKeyBindDown += OnInputKeyBindDown;
|
ChatInput.Input.OnKeyBindDown += OnInputKeyBindDown;
|
||||||
@@ -52,7 +55,7 @@ public partial class ChatBox : UIWidget
|
|||||||
|
|
||||||
private void OnMessageAdded(ChatMessage msg)
|
private void OnMessageAdded(ChatMessage msg)
|
||||||
{
|
{
|
||||||
Logger.DebugS("chat", $"{msg.Channel}: {msg.Message}");
|
_sawmill.Debug($"{msg.Channel}: {msg.Message}");
|
||||||
if (!ChatInput.FilterButton.Popup.IsActive(msg.Channel))
|
if (!ChatInput.FilterButton.Popup.IsActive(msg.Channel))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user