diff --git a/ChatTwo/ChatTwo.csproj b/ChatTwo/ChatTwo.csproj index b4c3974..5431a04 100755 --- a/ChatTwo/ChatTwo.csproj +++ b/ChatTwo/ChatTwo.csproj @@ -1,6 +1,6 @@ - 1.29.15 + 1.29.16 net8.0-windows enable enable diff --git a/ChatTwo/GameFunctions/Chat.cs b/ChatTwo/GameFunctions/Chat.cs index f256119..534de83 100755 --- a/ChatTwo/GameFunctions/Chat.cs +++ b/ChatTwo/GameFunctions/Chat.cs @@ -211,7 +211,10 @@ internal sealed unsafe class Chat : IDisposable // We already called this function once, so we skip the duplicated call // Also return the original value here so that vanilla chat receives all information if (Plugin.ChatLogWindow.TellSpecial) + { + Plugin.Log.Information("Return early to prevent duplicated call..."); return ChatLogRefreshHook!.Original(log, eventId, value); + } Plugin.ChatLogWindow.Activated(new ChatActivatedArgs(new ChannelSwitchInfo(null)) { AddIfNotPresent = addIfNotPresent, }); } @@ -313,7 +316,7 @@ internal sealed unsafe class Chat : IDisposable { TellReason = (TellReason) reason, TellTarget = target, - TellSpecial = true, + TellSpecial = Sheets.IsInForay(), // Handle Eureka/Bozja special }); } catch (Exception ex) diff --git a/ChatTwo/PayloadHandler.cs b/ChatTwo/PayloadHandler.cs index 280724b..42dcb6d 100755 --- a/ChatTwo/PayloadHandler.cs +++ b/ChatTwo/PayloadHandler.cs @@ -543,7 +543,7 @@ public sealed class PayloadHandler if (ImGui.Selectable(Language.Context_SendTell)) { // Eureka and Bozja need special handling as tells work different - if (Sheets.TerritorySheet.GetRow(Plugin.ClientState.TerritoryType).TerritoryIntendedUse.RowId != 41) + if (!Sheets.IsInForay()) { LogWindow.Chat = $"/tell {player.PlayerName}"; if (world.Value.IsPublic) diff --git a/ChatTwo/Sheets.cs b/ChatTwo/Sheets.cs index 8468548..b949a7f 100644 --- a/ChatTwo/Sheets.cs +++ b/ChatTwo/Sheets.cs @@ -27,4 +27,7 @@ public static class Sheets TextCommandSheet = Plugin.DataManager.GetExcelSheet(); EventItemHelpSheet = Plugin.DataManager.GetExcelSheet(); } + + public static bool IsInForay() => TerritorySheet.TryGetRow(Plugin.ClientState.TerritoryType, out var row) && + row.TerritoryIntendedUse.RowId == 41; } \ No newline at end of file diff --git a/ChatTwo/Ui/Debugger.cs b/ChatTwo/Ui/Debugger.cs index 5ea4f40..8d1c40e 100644 --- a/ChatTwo/Ui/Debugger.cs +++ b/ChatTwo/Ui/Debugger.cs @@ -14,7 +14,7 @@ public class DebuggerWindow : Window private readonly Plugin Plugin; private readonly ChatLogWindow ChatLogWindow; - public DebuggerWindow(Plugin plugin) : base($"Debugger###chat2-debugger") + public DebuggerWindow(Plugin plugin) : base("Debugger###chat2-debugger") { Plugin = plugin; ChatLogWindow = plugin.ChatLogWindow; @@ -28,16 +28,12 @@ public class DebuggerWindow : Window RespectCloseHotkey = false; DisableWindowSounds = true; - #if DEBUG Plugin.Commands.Register("/chat2Debugger", showInHelp: false).Execute += Toggle; - #endif } public void Dispose() { - #if DEBUG Plugin.Commands.Register("/chat2Debugger", showInHelp: false).Execute -= Toggle; - #endif } private void Toggle(string _, string __) => Toggle();