feat(chat): prefill the input bar for context-menu and direct-chat tells

This commit is contained in:
2026-06-16 01:04:34 +02:00
parent 47a49de8c0
commit 88491902eb
+31 -16
View File
@@ -232,9 +232,14 @@ internal sealed unsafe class Chat : IDisposable
if (c != '\0' && !char.IsControl(c)) if (c != '\0' && !char.IsControl(c))
input = c.ToString(); input = c.ToString();
// Chat-window Activated integration is offline until the // Seed the just-typed character into our input field and focus it,
// new chat layer surfaces an Activated entry point. // the same prefill path the inventory item-link below uses. Prefill-
_ = input; // 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) if (playerName != null)
{ {
// Chat-window Activated integration is offline; tell-target // Right-click -> Send Tell: prefill our input the same way our own
// routing returns when the new chat layer is wired up. // "Send Tell" payload menu does (PayloadHandler), then focus. Prefill-
_ = playerName; // only — no tab switch, no ChatActivatedArgs revival (Flo decision
_ = worldId; // 2026-06-15). The game supplies worldName here, so no sheet lookup.
_ = contentId; var tellName = playerName->ToString();
_ = reason; var tellWorld = worldName != null ? worldName->ToString() : string.Empty;
_ = setChatType; var tellCommand = $"/tell {tellName}";
if (!string.IsNullOrEmpty(tellWorld))
tellCommand += $"@{tellWorld}";
tellCommand += " ";
Plugin.InputBar.SetPendingMessage(tellCommand);
Plugin.InputBar.Activate = true;
} }
return SetChatLogTellTargetHook!.Original( return SetChatLogTellTargetHook!.Original(
@@ -361,12 +371,17 @@ internal sealed unsafe class Chat : IDisposable
if (playerName != null) if (playerName != null)
{ {
// Chat-window Activated integration is offline; tell-target // In-foray right-click -> Send Tell: same prefill path as the non-foray
// routing returns when the new chat layer is wired up. // tell. The foray-specific TellSpecial channel routing stays deferred
_ = playerName; // (v1.8.1, SetEurekaTellChannel) — prefill-only here (Flo decision 2026-06-15).
_ = worldId; var forayName = playerName->ToString();
_ = contentId; var forayWorld = worldName != null ? worldName->ToString() : string.Empty;
_ = reason; var forayCommand = $"/tell {forayName}";
if (!string.IsNullOrEmpty(forayWorld))
forayCommand += $"@{forayWorld}";
forayCommand += " ";
Plugin.InputBar.SetPendingMessage(forayCommand);
Plugin.InputBar.Activate = true;
} }
ContextMenuTellInForayHook!.Original( ContextMenuTellInForayHook!.Original(