From c9097388dc726099a17bd27c10e5bae13dc50b82 Mon Sep 17 00:00:00 2001 From: Geekid812 Date: Fri, 6 Oct 2023 17:22:11 +0200 Subject: [PATCH 1/4] Add chat channel API --- src/ChatChannel.as | 58 ++++++++++++++++++ src/ChatLine.as | 14 +++++ src/ChatLineInfo.as | 30 ++++++++++ src/ChatWindow.as | 143 +++++++++++++++++++++++++++++++++----------- src/Export.as | 6 ++ src/ExportCode.as | 26 +++----- src/ExportShared.as | 39 ++++++++++++ src/ServerChat.as | 36 +++++++++++ 8 files changed, 300 insertions(+), 52 deletions(-) create mode 100644 src/ChatChannel.as create mode 100644 src/ServerChat.as diff --git a/src/ChatChannel.as b/src/ChatChannel.as new file mode 100644 index 0000000..3e334c2 --- /dev/null +++ b/src/ChatChannel.as @@ -0,0 +1,58 @@ + +class ChatChannel { + string m_title; + BetterChat::IChatChannelSink@ m_sink; + + array m_lines; + + uint64 m_lastMessageTime = 0; + + ChatChannel() {} + + ChatChannel(const string&in title, BetterChat::IChatChannelSink@ sink) { + m_title = title; + @m_sink = sink; + } + + void Clear() + { + m_lines.RemoveRange(0, m_lines.Length); + } + + string GetTitle() { + return m_title; + } + + void SendChatMessage(const string&in text) { + if (@m_sink !is null) { + m_sink.SendChatMessage(text); + } + } + + void InsertLine(ChatLine@ line) { + m_lines.InsertLast(line); + + if (m_lines.Length > uint(Setting_MaximumLines)) { + m_lines.RemoveRange(0, m_lines.Length - Setting_MaximumLines); + } + + // Remember when the last message was received + m_lastMessageTime = Time::Now; + } +} + +class ChatChannelHook: BetterChat::IChatChannelHook { + ChatChannel@ m_channel; + + ChatChannelHook(ChatChannel@ channel) { + @m_channel = channel; + } + + void Clear() override { + m_channel.Clear(); + } + + void AddChatEntry(BetterChat::ChatEntry entry) override { + g_window.AddChatLine(ChatLine(g_window.NextLineId(), Time::Stamp, entry), m_channel); + } +} diff --git a/src/ChatLine.as b/src/ChatLine.as index 4b54244..5f1f80c 100644 --- a/src/ChatLine.as +++ b/src/ChatLine.as @@ -45,6 +45,12 @@ class ChatLine } #endif + ChatLine(uint id, int64 time, BetterChat::ChatEntry entry) { + m_id = id; + m_time = time; + FromSharedEntry(entry); + } + vec4 GetHighlightColor(const vec4 &in def = vec4(0, 0, 0, 1)) { vec3 ret(def.x, def.y, def.z); @@ -90,6 +96,14 @@ class ChatLine } #endif + void FromSharedEntry(BetterChat::ChatEntry entry) { + // Trace the message to the log if needed by settings (and not in streamer mode) + if (Setting_TraceToLog && !Setting_StreamerMode) { + trace(entry.m_authorName + ", " + entry.m_text); + } + FromChatLineInfo(ChatLineInfo(entry)); + } + void FromChatLineInfo(const ChatLineInfo &in info) { string text = info.m_text; diff --git a/src/ChatLineInfo.as b/src/ChatLineInfo.as index 820a3ba..69785ca 100644 --- a/src/ChatLineInfo.as +++ b/src/ChatLineInfo.as @@ -33,6 +33,36 @@ class ChatLineInfo string m_text; + ChatLineInfo(BetterChat::ChatEntry entry) { + FromSharedEntry(entry); + } + + void FromSharedEntry(BetterChat::ChatEntry entry) { + m_text = entry.m_text; + m_authorName = entry.m_authorName; + m_authorClubTag = entry.m_clubTag; + m_overrideClubTag = entry.m_clubTag != ""; + m_teamColorText = entry.m_teamColor; + m_teamNumber = entry.m_teamColor != "" ? 1 : 0; + m_isSystem = entry.m_system; + m_scope = FromSharedScope(entry.m_scope); + } + + ChatLineScope FromSharedScope(BetterChat::ChatEntryScope scope) { + switch (scope) { + case BetterChat::ChatEntryScope::Everyone: + return ChatLineScope::Everyone; + case BetterChat::ChatEntryScope::SpectatorCurrent: + return ChatLineScope::SpectatorCurrent; + case BetterChat::ChatEntryScope::SpectatorAll: + return ChatLineScope::SpectatorAll; + case BetterChat::ChatEntryScope::Team: + return ChatLineScope::Team; + default: + return ChatLineScope::YouOnly; + } + } + #if TMNEXT ChatLineInfo(NGameScriptChat_SEntry@ entry) { diff --git a/src/ChatWindow.as b/src/ChatWindow.as index 5f4b8b9..7d0f75d 100644 --- a/src/ChatWindow.as +++ b/src/ChatWindow.as @@ -3,7 +3,9 @@ class ChatWindow : BetterChat::IChatMessageListener bool m_visible = true; bool m_big = false; - array m_lines; + array m_channels; + uint m_channelIndex = 0; + uint m_autoChannelIndex = 0; uint m_lineIdIterator = 0; string m_requestedChatFormat = "text"; @@ -20,7 +22,6 @@ class ChatWindow : BetterChat::IChatMessageListener bool m_scrollToBottom = false; - uint64 m_lastMessageTime = 0; int m_jsonMessageCount = 0; AutoCompletion m_auto; @@ -30,19 +31,58 @@ class ChatWindow : BetterChat::IChatMessageListener void Initialize() { + m_channels.InsertLast(ChatChannel("Server Chat", ChatMessageSink())); } - void Clear() - { - m_lines.RemoveRange(0, m_lines.Length); + ChatChannel@ GetActiveChannel() { + return m_channels[m_channelIndex]; + } + + ChatChannel@ GetServerChannel() { + return m_channels[0]; + } + + void AddChannel(ChatChannel@ channel) { + m_channels.InsertLast(channel); + m_channelIndex = m_channels.Length - 1; + } + + void RemoveChannel(ChatChannel@ channel) { + int idx = m_channels.FindByRef(channel); + if (idx < 0) { + return; + } + + m_channels.RemoveAt(idx); + if (m_channelIndex >= uint(idx)) m_channelIndex--; + } + + int GetEnabledChannelsCount() { + int count = m_channels.Length; + if (!HasServerInfo()) count--; + return count; + } + + uint NextLineId() { + return m_lineIdIterator++; + } + + void Clear() { m_history.RemoveRange(0, m_history.Length); + auto channel = GetActiveChannel(); + channel.Clear(); + if (Setting_ShowHelp) { auto plugin = Meta::ExecutingPlugin(); - AddSystemLine("$<$ef7Better Chat " + plugin.Version + "$> - Open the overlay for options"); + AddSystemLine("$<$ef7Better Chat " + plugin.Version + "$> - Open the overlay for options", channel); } } + void SendChatMessage(const string&in text) { + GetActiveChannel().SendChatMessage(text); + } + void OnUserInput(const string &in text) { AddInputHistory(text); @@ -58,7 +98,7 @@ class ChatWindow : BetterChat::IChatMessageListener } } - BetterChat::SendChatMessage(text); + SendChatMessage(text); } void SendChatFormat(const string &in format) @@ -70,7 +110,7 @@ class ChatWindow : BetterChat::IChatMessageListener trace("Requesting chat format \"" + format + "\" from server"); m_requestedChatFormat = format; - BetterChat::SendChatMessage("/chatformat " + format); + GetServerChannel().SendChatMessage("/chatformat " + format); } void ShowInput(const string &in text = "") @@ -92,31 +132,38 @@ class ChatWindow : BetterChat::IChatMessageListener m_showInput = false; } - void AddSystemLine(const string &in line) + void AddSystemLine(const string &in line, ChatChannel@ channel = null) { + if (@channel is null) { + @channel = GetActiveChannel(); + } + string text = "$96f" + Icons::Bolt + " $eee" + line; auto newLine = ChatLine(m_lineIdIterator++, Time::Stamp); newLine.AddText(text); - m_lines.InsertLast(newLine); - - m_lastMessageTime = Time::Now; + + channel.InsertLine(newLine); } #if TMNEXT void OnChatMessage(NGameScriptChat_SEntry@ entry) override { - AddChatLine(ChatLine(m_lineIdIterator++, Time::Stamp, entry)); + AddChatLine(ChatLine(m_lineIdIterator++, Time::Stamp, entry), GetServerChannel()); } #else void OnChatMessage(const string &in line) override { - AddChatLine(ChatLine(m_lineIdIterator++, Time::Stamp, line)); + AddChatLine(ChatLine(m_lineIdIterator++, Time::Stamp, line), GetServerChannel()); } #endif - void AddChatLine(ChatLine@ newLine) + void AddChatLine(ChatLine@ newLine, ChatChannel@ channel = null) { + if (@channel is null) { + @channel = GetActiveChannel(); + } + // When a servercontroller restarts, it will have forgotten about the chatformat. // We can (try to) detect these cases, by using a count of received json messages. if (newLine.m_isJson) { @@ -137,13 +184,7 @@ class ChatWindow : BetterChat::IChatMessageListener } // Add the line to the list of messages - m_lines.InsertLast(newLine); - if (m_lines.Length > uint(Setting_MaximumLines)) { - m_lines.RemoveRange(0, m_lines.Length - Setting_MaximumLines); - } - - // Remember when the last message was received - m_lastMessageTime = Time::Now; + channel.InsertLine(newLine); // Maybe play a sound if (Setting_SoundGain > 0 && Setting_SoundSet != Sounds::SoundSet::None) { @@ -178,8 +219,7 @@ class ChatWindow : BetterChat::IChatMessageListener UI::InputBlocking OnKeyPress(bool down, VirtualKey key) { - string actionMap = UI::CurrentActionMap(); - if (actionMap == "MenuInputsMap") { + if (GetEnabledChannelsCount() == 0) { return UI::InputBlocking::DoNothing; } @@ -315,11 +355,20 @@ class ChatWindow : BetterChat::IChatMessageListener OnServerChanged(serverLogin); } } + + uint autoChannelIndex = HasServerInfo() ? 0 : 1; + if (autoChannelIndex != m_autoChannelIndex) { + if (autoChannelIndex < m_channels.Length) { + m_channelIndex = autoChannelIndex; + } + m_autoChannelIndex = autoChannelIndex; + } } uint64 GetTimeSinceLastMessage() { - return Time::Now - m_lastMessageTime; + auto channel = GetActiveChannel(); + return Time::Now - (channel is null ? 0 : channel.m_lastMessageTime); } string GetWindowTitle() @@ -331,6 +380,12 @@ class ChatWindow : BetterChat::IChatMessageListener return ret; } + bool HasServerInfo() { + auto network = GetApp().Network; + auto serverInfo = cast(network.ServerInfo); + return !(serverInfo is null || serverInfo.ServerLogin == ""); + } + bool IsVisible() { if (!m_visible) { @@ -341,9 +396,7 @@ class ChatWindow : BetterChat::IChatMessageListener return false; } - auto network = GetApp().Network; - auto serverInfo = cast(network.ServerInfo); - if (serverInfo is null || serverInfo.ServerLogin == "") { + if (GetEnabledChannelsCount() == 0) { return false; } @@ -362,8 +415,7 @@ class ChatWindow : BetterChat::IChatMessageListener bool CanFocus() { - string actionMap = UI::CurrentActionMap(); - if (actionMap == "MenuInputsMap") { + if (GetEnabledChannelsCount() == 0) { return false; } @@ -435,6 +487,7 @@ class ChatWindow : BetterChat::IChatMessageListener void RenderLines() { + auto channel = GetActiveChannel(); vec2 windowSize = UI::GetWindowSize(); // Insert empty space before first messages @@ -444,16 +497,17 @@ class ChatWindow : BetterChat::IChatMessageListener // Decide on start index uint startIndex = 0; + array lines = channel.m_lines; if (Setting_LimitOnHiddenOverlay && !CanFocus()) { int numLines = int(windowSize.y / m_chatLineFrameHeight) + 1; - if (uint(numLines) < m_lines.Length) { - startIndex = m_lines.Length - numLines; + if (uint(numLines) < lines.Length) { + startIndex = lines.Length - numLines; } } // Render each line - for (uint i = startIndex; i < m_lines.Length; i++) { - auto line = m_lines[i]; + for (uint i = startIndex; i < lines.Length; i++) { + auto line = lines[i]; // Hide line if we want to filter out system messages if (!Setting_ShowSystemMessages && line.m_isSystem) { @@ -478,6 +532,22 @@ class ChatWindow : BetterChat::IChatMessageListener } } + void RenderChannelTabs() { + for (uint i = 0; i < m_channels.Length; i++) { + if (i != 0) { + UI::SameLine(); + } + string channelName = m_channels[i].GetTitle() + "##channel" + i; + bool clicked; + if (i == m_channelIndex) clicked = UI::Button(channelName); + else clicked = UI::DarkButton(channelName); + + if (clicked) { + m_channelIndex = i; + } + } + } + void RenderSidebar() { if (m_big) { @@ -598,11 +668,14 @@ class ChatWindow : BetterChat::IChatMessageListener if (UI::IsOverlayShown()) { vec2 startingCursorPos = UI::GetCursorPos(); - RenderSidebar(); // Begin second half of the window UI::SetCursorPos(startingCursorPos + vec2(40, 0) * scale); + if (GetEnabledChannelsCount() > 1) { + RenderChannelTabs(); + UI::SetCursorPos(UI::GetCursorPos() + vec2(40, 0) * scale); + } UI::BeginChild("ChatContainer", vec2(), false, childWindowFlags); } diff --git a/src/Export.as b/src/Export.as index 6ab5a8e..ea48184 100644 --- a/src/Export.as +++ b/src/Export.as @@ -33,4 +33,10 @@ namespace BetterChat // Sends a message to the server. import void SendChatMessage(const string &in text) from "BetterChat"; + + // Registers a new chat channel. + import IChatChannelHook@ AquireChatChannelHook(const string&in title, IChatChannelSink@ sink) from "BetterChat"; + + // Unregisters a chat channel. + import void ReleaseChatChannelHook(IChatChannelHook@ hook) from "BetterChat"; } diff --git a/src/ExportCode.as b/src/ExportCode.as index f5904b1..bd58eb0 100644 --- a/src/ExportCode.as +++ b/src/ExportCode.as @@ -43,23 +43,15 @@ namespace BetterChat void SendChatMessage(const string &in text) { -#if TMNEXT - if (!Permissions::InGameChat()) { - return; - } -#endif - - auto pg = GetApp().CurrentPlayground; - if (pg is null) { - //TODO: Queue the message for later - warn("Can't send message right now because there's no playground!"); - return; - } + g_window.SendChatMessage(text); + } - if (text.Length > 2000) { - pg.Interface.ChatEntry = text.SubStr(0, 2000) + " (...)"; - } else { - pg.Interface.ChatEntry = text; - } + IChatChannelHook@ AquireChatChannelHook(const string&in title, IChatChannelSink@ sink) { + auto channel = ChatChannel(title, sink); + g_window.AddChannel(channel); + return ChatChannelHook(channel); + } + void ReleaseChatChannelHook(IChatChannelHook@ hook) { + g_window.RemoveChannel(cast(hook).m_channel); } } diff --git a/src/ExportShared.as b/src/ExportShared.as index 050edea..c81a5ca 100644 --- a/src/ExportShared.as +++ b/src/ExportShared.as @@ -24,4 +24,43 @@ namespace BetterChat void OnChatMessage(const string &in line); #endif } + + shared interface IChatChannelHook + { + void AddChatEntry(ChatEntry entry); + void Clear(); + } + + shared interface IChatChannelSink + { + void SendChatMessage(const string&in text); + } + + shared class ChatEntry { + string m_text; + string m_authorName; + string m_clubTag; + string m_teamColor; + bool m_system; + ChatEntryScope m_scope; + + ChatEntry() {} + + ChatEntry(const string&in text, const string&in authorName, const string&in clubTag = "", const string&in teamColor = "", bool system = false, ChatEntryScope scope = BetterChat::ChatEntryScope::Everyone) { + m_text = text; + m_authorName = authorName; + m_clubTag = clubTag; + m_teamColor = teamColor; + m_system = system; + m_scope = scope; + } + } + + shared enum ChatEntryScope { + Everyone, + SpectatorCurrent, + SpectatorAll, + Team, + YouOnly, + } } diff --git a/src/ServerChat.as b/src/ServerChat.as new file mode 100644 index 0000000..09eda79 --- /dev/null +++ b/src/ServerChat.as @@ -0,0 +1,36 @@ + +class ChatMessageSink: BetterChat::IChatChannelSink { + void SendChatMessage(const string&in text) override { +#if TMNEXT + if (!Permissions::InGameChat()) { + return; + } +#endif + + auto pg = GetApp().CurrentPlayground; + if (pg is null) { + //TODO: Queue the message for later + warn("Can't send message right now because there's no playground!"); + return; + } + + if (text.Length > 2000) { + pg.Interface.ChatEntry = text.SubStr(0, 2000) + " (...)"; + } else { + pg.Interface.ChatEntry = text; + } + } +} + +// Useful for debugging purposes +class EchoSink: BetterChat::IChatChannelSink { + BetterChat::IChatChannelHook@ m_hook; + + void SetHook(BetterChat::IChatChannelHook@ hook) { + @m_hook = hook; + } + + void SendChatMessage(const string&in text) override { + m_hook.AddChatEntry(BetterChat::ChatEntry(text, "", "", "", true)); + } +} From 8a7ac1982c1fd8d9c62d40d63d269283a60e8be6 Mon Sep 17 00:00:00 2001 From: Geekid812 Date: Tue, 7 Nov 2023 18:44:27 +0100 Subject: [PATCH 2/4] convert to tabs indentation --- src/ChatChannel.as | 60 +++++++++++++++++++++++----------------------- src/ExportCode.as | 7 ++++++ 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/src/ChatChannel.as b/src/ChatChannel.as index 3e334c2..ea159e5 100644 --- a/src/ChatChannel.as +++ b/src/ChatChannel.as @@ -1,58 +1,58 @@ class ChatChannel { - string m_title; - BetterChat::IChatChannelSink@ m_sink; + string m_title; + BetterChat::IChatChannelSink@ m_sink; - array m_lines; + array m_lines; uint64 m_lastMessageTime = 0; - ChatChannel() {} + ChatChannel() {} - ChatChannel(const string&in title, BetterChat::IChatChannelSink@ sink) { - m_title = title; - @m_sink = sink; - } + ChatChannel(const string&in title, BetterChat::IChatChannelSink@ sink) { + m_title = title; + @m_sink = sink; + } - void Clear() + void Clear() { m_lines.RemoveRange(0, m_lines.Length); } - string GetTitle() { - return m_title; - } + string GetTitle() { + return m_title; + } - void SendChatMessage(const string&in text) { - if (@m_sink !is null) { - m_sink.SendChatMessage(text); - } - } + void SendChatMessage(const string&in text) { + if (@m_sink !is null) { + m_sink.SendChatMessage(text); + } + } - void InsertLine(ChatLine@ line) { - m_lines.InsertLast(line); + void InsertLine(ChatLine@ line) { + m_lines.InsertLast(line); if (m_lines.Length > uint(Setting_MaximumLines)) { m_lines.RemoveRange(0, m_lines.Length - Setting_MaximumLines); } - // Remember when the last message was received + // Remember when the last message was received m_lastMessageTime = Time::Now; - } + } } class ChatChannelHook: BetterChat::IChatChannelHook { - ChatChannel@ m_channel; + ChatChannel@ m_channel; - ChatChannelHook(ChatChannel@ channel) { - @m_channel = channel; - } + ChatChannelHook(ChatChannel@ channel) { + @m_channel = channel; + } - void Clear() override { - m_channel.Clear(); - } + void Clear() override { + m_channel.Clear(); + } void AddChatEntry(BetterChat::ChatEntry entry) override { - g_window.AddChatLine(ChatLine(g_window.NextLineId(), Time::Stamp, entry), m_channel); - } + g_window.AddChatLine(ChatLine(g_window.NextLineId(), Time::Stamp, entry), m_channel); + } } diff --git a/src/ExportCode.as b/src/ExportCode.as index bd58eb0..d096bd6 100644 --- a/src/ExportCode.as +++ b/src/ExportCode.as @@ -43,6 +43,12 @@ namespace BetterChat void SendChatMessage(const string &in text) { +#if TMNEXT + if (!Permissions::InGameChat()) { + return; + } +#endif + g_window.SendChatMessage(text); } @@ -51,6 +57,7 @@ namespace BetterChat g_window.AddChannel(channel); return ChatChannelHook(channel); } + void ReleaseChatChannelHook(IChatChannelHook@ hook) { g_window.RemoveChannel(cast(hook).m_channel); } From 8b09bb123ce81af52a8adfd926a375033c39fb64 Mon Sep 17 00:00:00 2001 From: Geekid812 Date: Tue, 7 Nov 2023 19:25:29 +0100 Subject: [PATCH 3/4] Set clear to only trigger for the server channel --- src/ChatWindow.as | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ChatWindow.as b/src/ChatWindow.as index 7d0f75d..63d90c1 100644 --- a/src/ChatWindow.as +++ b/src/ChatWindow.as @@ -70,7 +70,7 @@ class ChatWindow : BetterChat::IChatMessageListener void Clear() { m_history.RemoveRange(0, m_history.Length); - auto channel = GetActiveChannel(); + auto channel = GetServerChannel(); channel.Clear(); if (Setting_ShowHelp) { From d2649463a1e12f7e57562ef44d2dac033c39e292 Mon Sep 17 00:00:00 2001 From: Geekid812 Date: Tue, 7 Nov 2023 19:57:23 +0100 Subject: [PATCH 4/4] Expose linear hue instead of team color --- src/ChatLine.as | 2 +- src/ChatLineInfo.as | 4 ++-- src/ExportShared.as | 6 +++--- src/ServerChat.as | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ChatLine.as b/src/ChatLine.as index 5f1f80c..8c43b03 100644 --- a/src/ChatLine.as +++ b/src/ChatLine.as @@ -99,7 +99,7 @@ class ChatLine void FromSharedEntry(BetterChat::ChatEntry entry) { // Trace the message to the log if needed by settings (and not in streamer mode) if (Setting_TraceToLog && !Setting_StreamerMode) { - trace(entry.m_authorName + ", " + entry.m_text); + trace(entry.m_text); } FromChatLineInfo(ChatLineInfo(entry)); } diff --git a/src/ChatLineInfo.as b/src/ChatLineInfo.as index 69785ca..ec6db2e 100644 --- a/src/ChatLineInfo.as +++ b/src/ChatLineInfo.as @@ -42,8 +42,8 @@ class ChatLineInfo m_authorName = entry.m_authorName; m_authorClubTag = entry.m_clubTag; m_overrideClubTag = entry.m_clubTag != ""; - m_teamColorText = entry.m_teamColor; - m_teamNumber = entry.m_teamColor != "" ? 1 : 0; + m_linearHue = entry.m_linearHue; + m_teamNumber = entry.m_linearHue != 0. ? 1 : 0; m_isSystem = entry.m_system; m_scope = FromSharedScope(entry.m_scope); } diff --git a/src/ExportShared.as b/src/ExportShared.as index c81a5ca..1c4caad 100644 --- a/src/ExportShared.as +++ b/src/ExportShared.as @@ -40,17 +40,17 @@ namespace BetterChat string m_text; string m_authorName; string m_clubTag; - string m_teamColor; + float m_linearHue; bool m_system; ChatEntryScope m_scope; ChatEntry() {} - ChatEntry(const string&in text, const string&in authorName, const string&in clubTag = "", const string&in teamColor = "", bool system = false, ChatEntryScope scope = BetterChat::ChatEntryScope::Everyone) { + ChatEntry(const string&in text, const string&in authorName, const string&in clubTag = "", float linearHue = 0f, bool system = false, ChatEntryScope scope = BetterChat::ChatEntryScope::Everyone) { m_text = text; m_authorName = authorName; m_clubTag = clubTag; - m_teamColor = teamColor; + m_linearHue = linearHue; m_system = system; m_scope = scope; } diff --git a/src/ServerChat.as b/src/ServerChat.as index 09eda79..b778e95 100644 --- a/src/ServerChat.as +++ b/src/ServerChat.as @@ -31,6 +31,6 @@ class EchoSink: BetterChat::IChatChannelSink { } void SendChatMessage(const string&in text) override { - m_hook.AddChatEntry(BetterChat::ChatEntry(text, "", "", "", true)); + m_hook.AddChatEntry(BetterChat::ChatEntry(text, "", "", 0., true)); } }