From 88491902eb47e9334b11932fbc70d3e4f13a2ee7 Mon Sep 17 00:00:00 2001 From: Jon Kazama Date: Tue, 16 Jun 2026 01:04:34 +0200 Subject: [PATCH] feat(chat): prefill the input bar for context-menu and direct-chat tells --- HellionChat/GameFunctions/Chat.cs | 47 ++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/HellionChat/GameFunctions/Chat.cs b/HellionChat/GameFunctions/Chat.cs index 5a2f542..841e52f 100755 --- a/HellionChat/GameFunctions/Chat.cs +++ b/HellionChat/GameFunctions/Chat.cs @@ -232,9 +232,14 @@ internal sealed unsafe class Chat : IDisposable if (c != '\0' && !char.IsControl(c)) input = c.ToString(); - // Chat-window Activated integration is offline until the - // new chat layer surfaces an Activated entry point. - _ = input; + // Seed the just-typed character into our input field and focus it, + // the same prefill path the inventory item-link below uses. Prefill- + // only — no tab switch (Flo decision 2026-06-15). + if (input != null) + { + Plugin.InputBar.AppendPending(input); + Plugin.InputBar.Activate = true; + } }); } @@ -325,13 +330,18 @@ internal sealed unsafe class Chat : IDisposable { if (playerName != null) { - // Chat-window Activated integration is offline; tell-target - // routing returns when the new chat layer is wired up. - _ = playerName; - _ = worldId; - _ = contentId; - _ = reason; - _ = setChatType; + // Right-click -> Send Tell: prefill our input the same way our own + // "Send Tell" payload menu does (PayloadHandler), then focus. Prefill- + // only — no tab switch, no ChatActivatedArgs revival (Flo decision + // 2026-06-15). The game supplies worldName here, so no sheet lookup. + var tellName = playerName->ToString(); + var tellWorld = worldName != null ? worldName->ToString() : string.Empty; + var tellCommand = $"/tell {tellName}"; + if (!string.IsNullOrEmpty(tellWorld)) + tellCommand += $"@{tellWorld}"; + tellCommand += " "; + Plugin.InputBar.SetPendingMessage(tellCommand); + Plugin.InputBar.Activate = true; } return SetChatLogTellTargetHook!.Original( @@ -361,12 +371,17 @@ internal sealed unsafe class Chat : IDisposable if (playerName != null) { - // Chat-window Activated integration is offline; tell-target - // routing returns when the new chat layer is wired up. - _ = playerName; - _ = worldId; - _ = contentId; - _ = reason; + // In-foray right-click -> Send Tell: same prefill path as the non-foray + // tell. The foray-specific TellSpecial channel routing stays deferred + // (v1.8.1, SetEurekaTellChannel) — prefill-only here (Flo decision 2026-06-15). + var forayName = playerName->ToString(); + var forayWorld = worldName != null ? worldName->ToString() : string.Empty; + var forayCommand = $"/tell {forayName}"; + if (!string.IsNullOrEmpty(forayWorld)) + forayCommand += $"@{forayWorld}"; + forayCommand += " "; + Plugin.InputBar.SetPendingMessage(forayCommand); + Plugin.InputBar.Activate = true; } ContextMenuTellInForayHook!.Original(