From 0319636fc56d142c677ce01407e9d6d414461ca2 Mon Sep 17 00:00:00 2001 From: Jon Kazama Date: Thu, 28 May 2026 16:03:57 +0200 Subject: [PATCH] fix(chat): route inventory item-link addIfNotPresent into InputBar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The AddonChatLog.OnRefresh hook is registered and fires correctly when the user picks "Link item" from the inventory right-click menu in-game. The detour extracts addIfNotPresent="" from the AtkValue array — verified empirically via a temporary _logger.LogDebug diagnostic build (eventId=31 valueUInt=C addIfNotPresent=). Pre-fix the extracted value was discarded with `_ = addIfNotPresent;` and a comment "Chat-window Activated integration is offline until the new chat layer surfaces an Activated entry point." The Activated entry point on the new v1.7.0 component layer has existed since that cycle (InputBar.AppendPending + InputBar.Activate, same pattern as PayloadHandler.DrawStatusPopup:546-549), but the rewiring was forgotten when ChatLogWindow.Activated() was removed. Route addIfNotPresent through InputBar.AppendPending with a v1.5.6-equivalent !PendingMessage.Contains() guard to prevent double-insertion on repeated OnRefresh events. Activate = true marks the input bar for ImGui.SetKeyboardFocusHere on the next draw, so the user can immediately keep typing after the link is inserted. Verified in-game: right-click "Link item" on multiple inventory items inserts into the HellionChat input bar, repeated link insertion does not produce , MainWindow gains keyboard focus. --- HellionChat/GameFunctions/Chat.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/HellionChat/GameFunctions/Chat.cs b/HellionChat/GameFunctions/Chat.cs index 10390d1..5a2f542 100755 --- a/HellionChat/GameFunctions/Chat.cs +++ b/HellionChat/GameFunctions/Chat.cs @@ -248,9 +248,13 @@ internal sealed unsafe class Chat : IDisposable addIfNotPresent = add; } - // Chat-window Activated integration is offline until the new chat - // layer surfaces an Activated entry point. - _ = addIfNotPresent; + // Route the addIfNotPresent token into the InputBar so inventory + // right-click "Link item" reaches our input field instead of being lost. + if (addIfNotPresent != null && !Plugin.InputBar.PendingMessage.Contains(addIfNotPresent)) + { + Plugin.InputBar.AppendPending(addIfNotPresent); + Plugin.InputBar.Activate = true; + } return 1; // Prevent vanilla chat log from gaining focus }