From f3783e9abfd74d00e075781a4063114378a48c3d Mon Sep 17 00:00:00 2001 From: Infi Date: Mon, 9 Jun 2025 09:50:14 +0200 Subject: [PATCH] - Fix tells not working in Forays --- ChatTwo/ChatTwo.csproj | 2 +- ChatTwo/GameFunctions/Chat.cs | 4 ++++ ChatTwo/PayloadHandler.cs | 9 ++++----- ChatTwo/Sheets.cs | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ChatTwo/ChatTwo.csproj b/ChatTwo/ChatTwo.csproj index 31baa2e..41b353e 100755 --- a/ChatTwo/ChatTwo.csproj +++ b/ChatTwo/ChatTwo.csproj @@ -1,6 +1,6 @@ - 1.30.3 + 1.30.4 net9.0-windows enable enable diff --git a/ChatTwo/GameFunctions/Chat.cs b/ChatTwo/GameFunctions/Chat.cs index 59cf502..d0ba337 100755 --- a/ChatTwo/GameFunctions/Chat.cs +++ b/ChatTwo/GameFunctions/Chat.cs @@ -439,6 +439,10 @@ internal sealed unsafe class Chat : IDisposable if (!Plugin.CurrentTab.CurrentChannel.UseTempChannel) Plugin.CurrentTab.CurrentChannel.UseTempChannel = true; + // Send tell via CommandInner later and let the game handle it + // Only works because we use the SetTellTargetInForay function to set all required information + Plugin.ChatLogWindow.TellSpecial = true; + var utfName = Utf8String.FromString(name); var utfWorld = Utf8String.FromString(worldName); diff --git a/ChatTwo/PayloadHandler.cs b/ChatTwo/PayloadHandler.cs index 7dae660..872a58e 100755 --- a/ChatTwo/PayloadHandler.cs +++ b/ChatTwo/PayloadHandler.cs @@ -574,11 +574,10 @@ public sealed class PayloadHandler var name = new List { new TextChunk(ChunkSource.None, null, player.PlayerName) }; if (world.Value.IsPublic) { - name.AddRange(new Chunk[] - { + name.AddRange([ new IconChunk(ChunkSource.None, null, BitmapFontIcon.CrossWorld), - new TextChunk(ChunkSource.None, null, world.Value.Name.ExtractText()), - }); + new TextChunk(ChunkSource.None, null, world.Value.Name.ExtractText()) + ]); } LogWindow.DrawChunks(name, false); @@ -587,7 +586,7 @@ public sealed class PayloadHandler var validContentId = chunk.Message?.ContentId is not (null or 0); if (ImGui.Selectable(Language.Context_SendTell)) { - // Eureka and Bozja need special handling as tells work different + // Eureka, Bozja and Occult need special handling as tells work different if (!Sheets.IsInForay()) { LogWindow.Chat = $"/tell {player.PlayerName}"; diff --git a/ChatTwo/Sheets.cs b/ChatTwo/Sheets.cs index b949a7f..0954191 100644 --- a/ChatTwo/Sheets.cs +++ b/ChatTwo/Sheets.cs @@ -28,6 +28,7 @@ public static class Sheets EventItemHelpSheet = Plugin.DataManager.GetExcelSheet(); } - public static bool IsInForay() => TerritorySheet.TryGetRow(Plugin.ClientState.TerritoryType, out var row) && - row.TerritoryIntendedUse.RowId == 41; + public static bool IsInForay() => + TerritorySheet.TryGetRow(Plugin.ClientState.TerritoryType, out var row) && + row.TerritoryIntendedUse.RowId is 41 or 61; } \ No newline at end of file