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 += ""; + } + } } } }