- Potential fix for tells getting stuck

- Allow debugger use outside of debug builds
This commit is contained in:
Infi
2024-12-23 04:48:40 +01:00
parent 70971d7b8a
commit f6dd0359e7
5 changed files with 10 additions and 8 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<Version>1.29.15</Version> <Version>1.29.16</Version>
<TargetFramework>net8.0-windows</TargetFramework> <TargetFramework>net8.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
+4 -1
View File
@@ -211,7 +211,10 @@ internal sealed unsafe class Chat : IDisposable
// We already called this function once, so we skip the duplicated call // 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 // Also return the original value here so that vanilla chat receives all information
if (Plugin.ChatLogWindow.TellSpecial) if (Plugin.ChatLogWindow.TellSpecial)
{
Plugin.Log.Information("Return early to prevent duplicated call...");
return ChatLogRefreshHook!.Original(log, eventId, value); return ChatLogRefreshHook!.Original(log, eventId, value);
}
Plugin.ChatLogWindow.Activated(new ChatActivatedArgs(new ChannelSwitchInfo(null)) { AddIfNotPresent = addIfNotPresent, }); Plugin.ChatLogWindow.Activated(new ChatActivatedArgs(new ChannelSwitchInfo(null)) { AddIfNotPresent = addIfNotPresent, });
} }
@@ -313,7 +316,7 @@ internal sealed unsafe class Chat : IDisposable
{ {
TellReason = (TellReason) reason, TellReason = (TellReason) reason,
TellTarget = target, TellTarget = target,
TellSpecial = true, TellSpecial = Sheets.IsInForay(), // Handle Eureka/Bozja special
}); });
} }
catch (Exception ex) catch (Exception ex)
+1 -1
View File
@@ -543,7 +543,7 @@ public sealed class PayloadHandler
if (ImGui.Selectable(Language.Context_SendTell)) if (ImGui.Selectable(Language.Context_SendTell))
{ {
// Eureka and Bozja need special handling as tells work different // 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}"; LogWindow.Chat = $"/tell {player.PlayerName}";
if (world.Value.IsPublic) if (world.Value.IsPublic)
+3
View File
@@ -27,4 +27,7 @@ public static class Sheets
TextCommandSheet = Plugin.DataManager.GetExcelSheet<TextCommand>(); TextCommandSheet = Plugin.DataManager.GetExcelSheet<TextCommand>();
EventItemHelpSheet = Plugin.DataManager.GetExcelSheet<EventItemHelp>(); EventItemHelpSheet = Plugin.DataManager.GetExcelSheet<EventItemHelp>();
} }
public static bool IsInForay() => TerritorySheet.TryGetRow(Plugin.ClientState.TerritoryType, out var row) &&
row.TerritoryIntendedUse.RowId == 41;
} }
+1 -5
View File
@@ -14,7 +14,7 @@ public class DebuggerWindow : Window
private readonly Plugin Plugin; private readonly Plugin Plugin;
private readonly ChatLogWindow ChatLogWindow; private readonly ChatLogWindow ChatLogWindow;
public DebuggerWindow(Plugin plugin) : base($"Debugger###chat2-debugger") public DebuggerWindow(Plugin plugin) : base("Debugger###chat2-debugger")
{ {
Plugin = plugin; Plugin = plugin;
ChatLogWindow = plugin.ChatLogWindow; ChatLogWindow = plugin.ChatLogWindow;
@@ -28,16 +28,12 @@ public class DebuggerWindow : Window
RespectCloseHotkey = false; RespectCloseHotkey = false;
DisableWindowSounds = true; DisableWindowSounds = true;
#if DEBUG
Plugin.Commands.Register("/chat2Debugger", showInHelp: false).Execute += Toggle; Plugin.Commands.Register("/chat2Debugger", showInHelp: false).Execute += Toggle;
#endif
} }
public void Dispose() public void Dispose()
{ {
#if DEBUG
Plugin.Commands.Register("/chat2Debugger", showInHelp: false).Execute -= Toggle; Plugin.Commands.Register("/chat2Debugger", showInHelp: false).Execute -= Toggle;
#endif
} }
private void Toggle(string _, string __) => Toggle(); private void Toggle(string _, string __) => Toggle();