From daccfd0a8d227cf2a2796f4b7b6195bfdbf788a1 Mon Sep 17 00:00:00 2001
From: RedFoxIV <38788538+RedFoxIV@users.noreply.github.com>
Date: Sat, 4 Jan 2025 06:11:02 +0300
Subject: [PATCH 1/4] i think it's working
---
Content.Client/Options/UI/Tabs/MiscTab.xaml | 7 +-
.../Options/UI/Tabs/MiscTab.xaml.cs | 19 ++-
.../Systems/Chat/Widgets/ChatBox.xaml.cs | 112 +++++++++++++++++-
Content.Server/Chat/Managers/ChatManager.cs | 20 ++--
Content.Server/Chat/Managers/IChatManager.cs | 8 +-
Content.Shared/CCVar/CCVars.cs | 3 +
Content.Shared/Chat/MsgChatMessage.cs | 5 +-
Resources/Locale/en-US/chat/chatstack.ftl | 1 +
.../en-US/escape-menu/ui/options-menu.ftl | 5 +
9 files changed, 157 insertions(+), 23 deletions(-)
create mode 100644 Resources/Locale/en-US/chat/chatstack.ftl
diff --git a/Content.Client/Options/UI/Tabs/MiscTab.xaml b/Content.Client/Options/UI/Tabs/MiscTab.xaml
index fcd3cceece7..f34f9f71db7 100644
--- a/Content.Client/Options/UI/Tabs/MiscTab.xaml
+++ b/Content.Client/Options/UI/Tabs/MiscTab.xaml
@@ -1,4 +1,4 @@
-
+
+
+
+
+
+ {
+ ChatStackOption.SelectId(args.Id);
+ UpdateApplyButton();
+ };
+
// Channel can be null in replays so.
// ReSharper disable once ConditionalAccessQualifierIsNonNullableAccordingToAPIContract
ShowOocPatronColor.Visible = _playerManager.LocalSession?.Channel?.UserData.PatronTier is { };
@@ -157,6 +169,7 @@ private void OnApplyButtonPressed(BaseButton.ButtonEventArgs args)
// _cfg.SetCVar(CCVars.ToggleWalk, ToggleWalk.Pressed);
_cfg.SetCVar(CCVars.StaticStorageUI, StaticStorageUI.Pressed);
_cfg.SetCVar(CCVars.NoVisionFilters, DisableFiltersCheckBox.Pressed);
+ _cfg.SetCVar(CCVars.ChatStackLastLines, ChatStackOption.SelectedId);
if (HudLayoutOption.SelectedMetadata is string opt)
{
@@ -188,6 +201,7 @@ private void UpdateApplyButton()
// var isToggleWalkSame = ToggleWalk.Pressed == _cfg.GetCVar(CCVars.ToggleWalk);
var isStaticStorageUISame = StaticStorageUI.Pressed == _cfg.GetCVar(CCVars.StaticStorageUI);
var isNoVisionFiltersSame = DisableFiltersCheckBox.Pressed == _cfg.GetCVar(CCVars.NoVisionFilters);
+ var isChatStackTheSame = ChatStackOption.SelectedId == _cfg.GetCVar(CCVars.ChatStackLastLines);
ApplyButton.Disabled = isHudThemeSame &&
isLayoutSame &&
@@ -207,7 +221,8 @@ private void UpdateApplyButton()
isScreenShakeIntensitySame &&
// isToggleWalkSame &&
isStaticStorageUISame &&
- isNoVisionFiltersSame;
+ isNoVisionFiltersSame &&
+ isChatStackTheSame;
}
}
diff --git a/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs b/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs
index a33bee20f9f..5e22d9a7a17 100644
--- a/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs
+++ b/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs
@@ -1,4 +1,5 @@
using Content.Client.UserInterface.Systems.Chat.Controls;
+using Content.Shared.CCVar;
using Content.Shared.Chat;
using Content.Shared.Input;
using Robust.Client.Audio;
@@ -7,7 +8,9 @@
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
+using Robust.Shared;
using Robust.Shared.Audio;
+using Robust.Shared.Configuration;
using Robust.Shared.Input;
using Robust.Shared.Player;
using Robust.Shared.Utility;
@@ -22,14 +25,22 @@ public partial class ChatBox : UIWidget
{
private readonly ChatUIController _controller;
private readonly IEntityManager _entManager;
+ private readonly IConfigurationManager _cfg;
+ private readonly ILocalizationManager _loc;
public bool Main { get; set; }
public ChatSelectChannel SelectedChannel => ChatInput.ChannelSelector.SelectedChannel;
+
+ private int _chatStackAmount = 0;
+ private bool _chatStackEnabled => _chatStackAmount > 0;
+ private List _chatStackList;
+
public ChatBox()
{
RobustXamlLoader.Load(this);
+ _loc = IoCManager.Resolve();
_entManager = IoCManager.Resolve();
ChatInput.Input.OnTextEntered += OnTextEntered;
@@ -41,6 +52,22 @@ public ChatBox()
_controller = UserInterfaceManager.GetUIController();
_controller.MessageAdded += OnMessageAdded;
_controller.RegisterChat(this);
+
+
+ _cfg = IoCManager.Resolve();
+ //_chatStackAmount = _cfg.GetCVar(CCVars.ChatStackLastLines);
+ //if (_chatStackAmount < 0) // anti-idiot protection
+ // _chatStackAmount = 0;
+ _chatStackList = new(_chatStackAmount);
+ _cfg.OnValueChanged(CCVars.ChatStackLastLines, UpdateChatStack, true);
+
+ }
+
+
+ private void UpdateChatStack(int value)
+ {
+ _chatStackAmount = 42;
+ Repopulate();
}
private void OnTextEntered(LineEditEventArgs args)
@@ -63,7 +90,60 @@ private void OnMessageAdded(ChatMessage msg)
var color = msg.MessageColorOverride ?? msg.Channel.TextColor();
- AddLine(msg.WrappedMessage, color);
+
+ if (msg.IgnoreChatStack)
+ {
+ TrackNewMessage(msg.WrappedMessage, color, true);
+ AddLine(msg.WrappedMessage, color);
+ return;
+ }
+
+ int index = _chatStackList.FindIndex(data => data.WrappedMessage == msg.WrappedMessage && !msg.IgnoreChatStack);
+
+ if (index == -1) // this also handles chatstack being disabled, since FindIndex won't find anything in an empty array
+ {
+ TrackNewMessage(msg.WrappedMessage, color);
+ AddLine(msg.WrappedMessage, color);
+ return;
+ }
+
+ UpdateRepeatingLine(index);
+ }
+
+ ///
+ /// Removing and then adding insantly nudges the chat window up before slowly dragging it back down, which makes the whole chat log shake.
+ /// With rapid enough updates, the whole chat becomes unreadable.
+ /// Adding first and then removing does not produce any visual effects.
+ /// The other option is to dublicate OutputPanel functionality and everything internal to the engine it relies on.
+ /// But OutputPanel relies on directly setting Control.Position for control embedding. (which is not exposed to Content.)
+ /// Thanks robustengine, very cool.
+ ///
+ ///
+ /// zero index is the very last line in chat, 1 is the line before the last one, 2 is the line before that, etc.
+ ///
+ private void UpdateRepeatingLine(int index)
+ {
+ _chatStackList[index].RepeatCount++;
+ for (int i = index; i >= 0; i--)
+ {
+ var data = _chatStackList[i];
+ AddLine(data.WrappedMessage, data.ColorOverride, data.RepeatCount);
+ }
+ for (int i = index; i >= 0; i--)
+ {
+ Contents.RemoveEntry(Index.FromEnd(index + 2));
+ }
+ }
+
+ private void TrackNewMessage(string wrappedMessage, Color colorOverride, bool ignoresChatstack = false)
+ {
+ if (!_chatStackEnabled)
+ return;
+
+ if(_chatStackList.Count == _chatStackList.Capacity)
+ _chatStackList.RemoveAt(_chatStackList.Capacity - 1);
+
+ _chatStackList.Insert(0, new ChatStackData(wrappedMessage, colorOverride, ignoresChatstack));
}
private void OnChannelSelect(ChatSelectChannel channel)
@@ -74,7 +154,7 @@ private void OnChannelSelect(ChatSelectChannel channel)
public void Repopulate()
{
Contents.Clear();
-
+ _chatStackList = new List(_chatStackAmount);
foreach (var message in _controller.History)
{
OnMessageAdded(message.Item2);
@@ -96,12 +176,21 @@ private void OnChannelFilter(ChatChannel channel, bool active)
}
}
- public void AddLine(string message, Color color)
+ public void AddLine(string message, Color color, int repeat = 0)
{
- var formatted = new FormattedMessage(3);
+ var formatted = new FormattedMessage(4);
formatted.PushColor(color);
formatted.AddMarkup(message);
formatted.Pop();
+ if (repeat != 0)
+ {
+ int displayRepeat = repeat + 1;
+ int sizeIncrease = Math.Min(displayRepeat / 6, 5);
+ formatted.AddMarkup(_loc.GetString("chat-system-repeated-message-counter",
+ ("count", displayRepeat),
+ ("size", 8 + sizeIncrease)
+ ));
+ }
Contents.AddMessage(formatted);
}
@@ -185,5 +274,20 @@ protected override void Dispose(bool disposing)
ChatInput.Input.OnKeyBindDown -= OnInputKeyBindDown;
ChatInput.Input.OnTextChanged -= OnTextChanged;
ChatInput.ChannelSelector.OnChannelSelect -= OnChannelSelect;
+ _cfg.UnsubValueChanged(CCVars.ChatStackLastLines, UpdateChatStack);
+ }
+
+ private class ChatStackData
+ {
+ public string WrappedMessage;
+ public Color ColorOverride;
+ public int RepeatCount = 0;
+ public bool IgnoresChatstack;
+ public ChatStackData(string wrappedMessage, Color colorOverride, bool ignoresChatstack = false)
+ {
+ WrappedMessage = wrappedMessage;
+ ColorOverride = colorOverride;
+ IgnoresChatstack = IgnoresChatstack;
+ }
}
}
diff --git a/Content.Server/Chat/Managers/ChatManager.cs b/Content.Server/Chat/Managers/ChatManager.cs
index 565438a2365..55ca3aa0d26 100644
--- a/Content.Server/Chat/Managers/ChatManager.cs
+++ b/Content.Server/Chat/Managers/ChatManager.cs
@@ -296,13 +296,13 @@ private void SendAdminChat(ICommonSession player, string message)
#region Utility
- public void ChatMessageToOne(ChatChannel channel, string message, string wrappedMessage, EntityUid source, bool hideChat, INetChannel client, Color? colorOverride = null, bool recordReplay = false, string? audioPath = null, float audioVolume = 0, NetUserId? author = null)
+ public void ChatMessageToOne(ChatChannel channel, string message, string wrappedMessage, EntityUid source, bool hideChat, INetChannel client, Color? colorOverride = null, bool recordReplay = false, string? audioPath = null, float audioVolume = 0, NetUserId? author = null, bool ignoreChatStack = false)
{
var user = author == null ? null : EnsurePlayer(author);
var netSource = _entityManager.GetNetEntity(source);
user?.AddEntity(netSource);
- var msg = new ChatMessage(channel, message, wrappedMessage, netSource, user?.Key, hideChat, colorOverride, audioPath, audioVolume);
+ var msg = new ChatMessage(channel, message, wrappedMessage, netSource, user?.Key, hideChat, colorOverride, audioPath, audioVolume, ignoreChatStack);
_netManager.ServerSendMessage(new MsgChatMessage() { Message = msg }, client);
if (!recordReplay)
@@ -315,16 +315,16 @@ public void ChatMessageToOne(ChatChannel channel, string message, string wrapped
}
}
- public void ChatMessageToMany(ChatChannel channel, string message, string wrappedMessage, EntityUid source, bool hideChat, bool recordReplay, IEnumerable clients, Color? colorOverride = null, string? audioPath = null, float audioVolume = 0, NetUserId? author = null)
- => ChatMessageToMany(channel, message, wrappedMessage, source, hideChat, recordReplay, clients.ToList(), colorOverride, audioPath, audioVolume, author);
+ public void ChatMessageToMany(ChatChannel channel, string message, string wrappedMessage, EntityUid source, bool hideChat, bool recordReplay, IEnumerable clients, Color? colorOverride = null, string? audioPath = null, float audioVolume = 0, NetUserId? author = null, bool ignoreChatStack = false)
+ => ChatMessageToMany(channel, message, wrappedMessage, source, hideChat, recordReplay, clients.ToList(), colorOverride, audioPath, audioVolume, author, ignoreChatStack);
- public void ChatMessageToMany(ChatChannel channel, string message, string wrappedMessage, EntityUid source, bool hideChat, bool recordReplay, List clients, Color? colorOverride = null, string? audioPath = null, float audioVolume = 0, NetUserId? author = null)
+ public void ChatMessageToMany(ChatChannel channel, string message, string wrappedMessage, EntityUid source, bool hideChat, bool recordReplay, List clients, Color? colorOverride = null, string? audioPath = null, float audioVolume = 0, NetUserId? author = null, bool ignoreChatStack = false)
{
var user = author == null ? null : EnsurePlayer(author);
var netSource = _entityManager.GetNetEntity(source);
user?.AddEntity(netSource);
- var msg = new ChatMessage(channel, message, wrappedMessage, netSource, user?.Key, hideChat, colorOverride, audioPath, audioVolume);
+ var msg = new ChatMessage(channel, message, wrappedMessage, netSource, user?.Key, hideChat, colorOverride, audioPath, audioVolume, ignoreChatStack);
_netManager.ServerSendToMany(new MsgChatMessage() { Message = msg }, clients);
if (!recordReplay)
@@ -338,7 +338,7 @@ public void ChatMessageToMany(ChatChannel channel, string message, string wrappe
}
public void ChatMessageToManyFiltered(Filter filter, ChatChannel channel, string message, string wrappedMessage, EntityUid source,
- bool hideChat, bool recordReplay, Color? colorOverride = null, string? audioPath = null, float audioVolume = 0)
+ bool hideChat, bool recordReplay, Color? colorOverride = null, string? audioPath = null, float audioVolume = 0, bool ignoreChatStack = false)
{
if (!recordReplay && !filter.Recipients.Any())
return;
@@ -349,16 +349,16 @@ public void ChatMessageToManyFiltered(Filter filter, ChatChannel channel, string
clients.Add(recipient.Channel);
}
- ChatMessageToMany(channel, message, wrappedMessage, source, hideChat, recordReplay, clients, colorOverride, audioPath, audioVolume);
+ ChatMessageToMany(channel, message, wrappedMessage, source, hideChat, recordReplay, clients, colorOverride, audioPath, audioVolume, null, ignoreChatStack);
}
- public void ChatMessageToAll(ChatChannel channel, string message, string wrappedMessage, EntityUid source, bool hideChat, bool recordReplay, Color? colorOverride = null, string? audioPath = null, float audioVolume = 0, NetUserId? author = null)
+ public void ChatMessageToAll(ChatChannel channel, string message, string wrappedMessage, EntityUid source, bool hideChat, bool recordReplay, Color? colorOverride = null, string? audioPath = null, float audioVolume = 0, NetUserId? author = null, bool ignoreChatStack = false)
{
var user = author == null ? null : EnsurePlayer(author);
var netSource = _entityManager.GetNetEntity(source);
user?.AddEntity(netSource);
- var msg = new ChatMessage(channel, message, wrappedMessage, netSource, user?.Key, hideChat, colorOverride, audioPath, audioVolume);
+ var msg = new ChatMessage(channel, message, wrappedMessage, netSource, user?.Key, hideChat, colorOverride, audioPath, audioVolume, ignoreChatStack);
_netManager.ServerSendToAll(new MsgChatMessage() { Message = msg });
if (!recordReplay)
diff --git a/Content.Server/Chat/Managers/IChatManager.cs b/Content.Server/Chat/Managers/IChatManager.cs
index e1400e3e8db..e941093e1dc 100644
--- a/Content.Server/Chat/Managers/IChatManager.cs
+++ b/Content.Server/Chat/Managers/IChatManager.cs
@@ -25,14 +25,14 @@ public interface IChatManager : ISharedChatManager
void SendAdminAnnouncementMessage(ICommonSession player, string message, bool suppressLog = true);
void ChatMessageToOne(ChatChannel channel, string message, string wrappedMessage, EntityUid source, bool hideChat,
- INetChannel client, Color? colorOverride = null, bool recordReplay = false, string? audioPath = null, float audioVolume = 0, NetUserId? author = null);
+ INetChannel client, Color? colorOverride = null, bool recordReplay = false, string? audioPath = null, float audioVolume = 0, NetUserId? author = null, bool ignoreChatStack = false);
void ChatMessageToMany(ChatChannel channel, string message, string wrappedMessage, EntityUid source, bool hideChat, bool recordReplay,
- IEnumerable clients, Color? colorOverride = null, string? audioPath = null, float audioVolume = 0, NetUserId? author = null);
+ IEnumerable clients, Color? colorOverride = null, string? audioPath = null, float audioVolume = 0, NetUserId? author = null, bool ignoreChatStack = false);
- void ChatMessageToManyFiltered(Filter filter, ChatChannel channel, string message, string wrappedMessage, EntityUid source, bool hideChat, bool recordReplay, Color? colorOverride, string? audioPath = null, float audioVolume = 0);
+ void ChatMessageToManyFiltered(Filter filter, ChatChannel channel, string message, string wrappedMessage, EntityUid source, bool hideChat, bool recordReplay, Color? colorOverride, string? audioPath = null, float audioVolume = 0, bool ignoreChatStack = false);
- void ChatMessageToAll(ChatChannel channel, string message, string wrappedMessage, EntityUid source, bool hideChat, bool recordReplay, Color? colorOverride = null, string? audioPath = null, float audioVolume = 0, NetUserId? author = null);
+ void ChatMessageToAll(ChatChannel channel, string message, string wrappedMessage, EntityUid source, bool hideChat, bool recordReplay, Color? colorOverride = null, string? audioPath = null, float audioVolume = 0, NetUserId? author = null, bool ignoreChatStack = false);
bool MessageCharacterLimit(ICommonSession player, string message);
diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs
index 0ca289f4175..5a4d2840f32 100644
--- a/Content.Shared/CCVar/CCVars.cs
+++ b/Content.Shared/CCVar/CCVars.cs
@@ -2091,6 +2091,9 @@ public static readonly CVarDef
public static readonly CVarDef ChatFancyNameBackground =
CVarDef.Create("chat.fancy_name_background", false, CVar.CLIENTONLY | CVar.ARCHIVE, "Toggles displaying a background under the speaking character's name.");
+ public static readonly CVarDef ChatStackLastLines =
+ CVarDef.Create("chat.chatstack_last_lines", 1, CVar.CLIENTONLY | CVar.ARCHIVE, "How far into the chat history to look when looking for similiar messages to coalesce them.");
+
///
/// A message broadcast to each player that joins the lobby.
/// May be changed by admins ingame through use of the "set-motd" command.
diff --git a/Content.Shared/Chat/MsgChatMessage.cs b/Content.Shared/Chat/MsgChatMessage.cs
index f7311d2dc8c..e57d4e9a653 100644
--- a/Content.Shared/Chat/MsgChatMessage.cs
+++ b/Content.Shared/Chat/MsgChatMessage.cs
@@ -26,11 +26,11 @@ public sealed class ChatMessage
public Color? MessageColorOverride;
public string? AudioPath;
public float AudioVolume;
-
+ public bool IgnoreChatStack;
[NonSerialized]
public bool Read;
- public ChatMessage(ChatChannel channel, string message, string wrappedMessage, NetEntity source, int? senderKey, bool hideChat = false, Color? colorOverride = null, string? audioPath = null, float audioVolume = 0)
+ public ChatMessage(ChatChannel channel, string message, string wrappedMessage, NetEntity source, int? senderKey, bool hideChat = false, Color? colorOverride = null, string? audioPath = null, float audioVolume = 0, bool ignoreChatStack = false)
{
Channel = channel;
Message = message;
@@ -41,6 +41,7 @@ public ChatMessage(ChatChannel channel, string message, string wrappedMessage, N
MessageColorOverride = colorOverride;
AudioPath = audioPath;
AudioVolume = audioVolume;
+ IgnoreChatStack = IgnoreChatStack;
}
}
diff --git a/Resources/Locale/en-US/chat/chatstack.ftl b/Resources/Locale/en-US/chat/chatstack.ftl
new file mode 100644
index 00000000000..229a09a9edb
--- /dev/null
+++ b/Resources/Locale/en-US/chat/chatstack.ftl
@@ -0,0 +1 @@
+chat-system-repeated-message-counter = {" "}[font size={$size}][color=#DD3333][bold]x{$count}![/bold][/color][/font]
\ No newline at end of file
diff --git a/Resources/Locale/en-US/escape-menu/ui/options-menu.ftl b/Resources/Locale/en-US/escape-menu/ui/options-menu.ftl
index 68a7db1e3eb..6861c8ee5ea 100644
--- a/Resources/Locale/en-US/escape-menu/ui/options-menu.ftl
+++ b/Resources/Locale/en-US/escape-menu/ui/options-menu.ftl
@@ -20,6 +20,11 @@ ui-options-general-cursor = Cursor
ui-options-general-speech = Speech
ui-options-general-storage = Storage
ui-options-general-accessibility = Accessibility
+ui-options-chatstack = Automatically merge identical chat messages
+ui-options-chatstack-off = Off
+ui-options-chatstack-single = Only last message
+ui-options-chatstack-double = Last two messages
+ui-options-chatstack-triple = Last three messages
## Audio menu
From e456e402c8ecc0cc5ca063922739c7b4ac4e28f2 Mon Sep 17 00:00:00 2001
From: RedFoxIV <38788538+RedFoxIV@users.noreply.github.com>
Date: Sat, 4 Jan 2025 06:51:43 +0300
Subject: [PATCH 2/4] apparently not
---
.../UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs | 4 ++--
Content.Shared/Chat/MsgChatMessage.cs | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs b/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs
index 5e22d9a7a17..5a061f327c6 100644
--- a/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs
+++ b/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs
@@ -66,7 +66,7 @@ public ChatBox()
private void UpdateChatStack(int value)
{
- _chatStackAmount = 42;
+ _chatStackAmount = value >= 0 ? value : 0;
Repopulate();
}
@@ -98,7 +98,7 @@ private void OnMessageAdded(ChatMessage msg)
return;
}
- int index = _chatStackList.FindIndex(data => data.WrappedMessage == msg.WrappedMessage && !msg.IgnoreChatStack);
+ int index = _chatStackList.FindIndex(data => data.WrappedMessage == msg.WrappedMessage && !data.IgnoresChatStack);
if (index == -1) // this also handles chatstack being disabled, since FindIndex won't find anything in an empty array
{
diff --git a/Content.Shared/Chat/MsgChatMessage.cs b/Content.Shared/Chat/MsgChatMessage.cs
index e57d4e9a653..056caff6f1f 100644
--- a/Content.Shared/Chat/MsgChatMessage.cs
+++ b/Content.Shared/Chat/MsgChatMessage.cs
@@ -41,7 +41,7 @@ public ChatMessage(ChatChannel channel, string message, string wrappedMessage, N
MessageColorOverride = colorOverride;
AudioPath = audioPath;
AudioVolume = audioVolume;
- IgnoreChatStack = IgnoreChatStack;
+ IgnoreChatStack = ignoreChatStack;
}
}
From ed89dd9c7758c066c4dbeb556da6ecbe7b39ac85 Mon Sep 17 00:00:00 2001
From: RedFoxIV <38788538+RedFoxIV@users.noreply.github.com>
Date: Sat, 4 Jan 2025 06:58:07 +0300
Subject: [PATCH 3/4] why does this keep happening
---
.../UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs b/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs
index 5a061f327c6..b66d63a1d0f 100644
--- a/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs
+++ b/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs
@@ -98,7 +98,7 @@ private void OnMessageAdded(ChatMessage msg)
return;
}
- int index = _chatStackList.FindIndex(data => data.WrappedMessage == msg.WrappedMessage && !data.IgnoresChatStack);
+ int index = _chatStackList.FindIndex(data => data.WrappedMessage == msg.WrappedMessage && !data.IgnoresChatstack);
if (index == -1) // this also handles chatstack being disabled, since FindIndex won't find anything in an empty array
{
@@ -287,7 +287,7 @@ public ChatStackData(string wrappedMessage, Color colorOverride, bool ignoresCha
{
WrappedMessage = wrappedMessage;
ColorOverride = colorOverride;
- IgnoresChatstack = IgnoresChatstack;
+ IgnoresChatstack = ignoresChatstack;
}
}
}
From 2fba3ac90d168f155fad95519fbe1b0c1a41f511 Mon Sep 17 00:00:00 2001
From: RedFoxIV <38788538+RedFoxIV@users.noreply.github.com>
Date: Sat, 4 Jan 2025 17:04:45 +0300
Subject: [PATCH 4/4] i think it's working x2
---
.../UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs | 3 ---
1 file changed, 3 deletions(-)
diff --git a/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs b/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs
index b66d63a1d0f..57bc3c6d2e2 100644
--- a/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs
+++ b/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs
@@ -128,9 +128,6 @@ private void UpdateRepeatingLine(int index)
{
var data = _chatStackList[i];
AddLine(data.WrappedMessage, data.ColorOverride, data.RepeatCount);
- }
- for (int i = index; i >= 0; i--)
- {
Contents.RemoveEntry(Index.FromEnd(index + 2));
}
}