From 80699b27e4782ec8a095fc7a1d2e18675a38345c Mon Sep 17 00:00:00 2001 From: Jon Kazama Date: Thu, 21 May 2026 18:08:49 +0200 Subject: [PATCH] feat(ui): insert map-flag and item-link tokens from chat input --- HellionChat/Ui/ChatLogWindow.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/HellionChat/Ui/ChatLogWindow.cs b/HellionChat/Ui/ChatLogWindow.cs index 168e41b..9318935 100644 --- a/HellionChat/Ui/ChatLogWindow.cs +++ b/HellionChat/Ui/ChatLogWindow.cs @@ -14,6 +14,7 @@ using Dalamud.Interface.Utility.Raii; using Dalamud.Interface.Windowing; using Dalamud.Memory; using FFXIVClientStructs.FFXIV.Client.UI; +using FFXIVClientStructs.FFXIV.Client.UI.Agent; using HellionChat.Code; using HellionChat.GameFunctions; using HellionChat.GameFunctions.Types; @@ -1122,6 +1123,27 @@ public sealed class ChatLogWindow : Window using var pushedColor = ImRaii.PushColor(ImGuiCol.Text, normalColor); if (ImGui.Selectable(Language.ChatLog_HideChat)) UserHide(); + + // Insert game text-macro tokens. The game expands / at + // send time, so inserting literal token text is enough. Each entry is + // disabled when its precondition is unmet (no map flag, no linked item) + // so the inserted token cannot expand to nothing. + unsafe + { + var flagSet = AgentMap.Instance()->FlagMarkerCount > 0; + using (ImRaii.Disabled(!flagSet)) + { + if (ImGui.Selectable(HellionStrings.ChatLog_Insert_MapFlag)) + Chat += ""; + } + + var itemSet = AgentChatLog.Instance()->LinkedItem.ItemId != 0; + using (ImRaii.Disabled(!itemSet)) + { + if (ImGui.Selectable(HellionStrings.ChatLog_Insert_ItemLink)) + Chat += ""; + } + } } } }