diff --git a/ChatTwo/GameFunctions.cs b/ChatTwo/GameFunctions.cs index ebb3404..40a0c51 100755 --- a/ChatTwo/GameFunctions.cs +++ b/ChatTwo/GameFunctions.cs @@ -32,7 +32,7 @@ internal unsafe class GameFunctions : IDisposable { private delegate IntPtr AgentContextYesNoDelegate(AgentInterface* context, uint a2, byte* playerName, ushort playerWorld, uint a5, byte a6); internal delegate void ChatActivatedEventDelegate(string? input); - + #region Functions [Signature("E8 ?? ?? ?? ?? 0F B7 44 37 ??")] @@ -65,8 +65,11 @@ internal unsafe class GameFunctions : IDisposable { [Signature("E8 ?? ?? ?? ?? E9 ?? ?? ?? ?? 41 B4 01")] private readonly delegate* unmanaged _searchForRecipesUsingItem; + [Signature("E8 ?? ?? ?? ?? EB 45 45 33 C9")] + private readonly delegate* unmanaged _searchForItem; + #endregion - + internal const int HqItemOffset = 1_000_000; private Plugin Plugin { get; } @@ -416,4 +419,13 @@ internal unsafe class GameFunctions : IDisposable { var a1 = vf35(uiModule); this._searchForRecipesUsingItem(a1, itemId); } + + internal void SearchForItem(uint itemId) { + if (this._searchForItem == null) { + return; + } + + var itemFinder = Framework.Instance()->GetUiModule()->GetItemFinderModule(); + this._searchForItem(itemFinder, itemId, 1); + } } diff --git a/ChatTwo/PayloadHandler.cs b/ChatTwo/PayloadHandler.cs index d162559..3143652 100755 --- a/ChatTwo/PayloadHandler.cs +++ b/ChatTwo/PayloadHandler.cs @@ -247,6 +247,10 @@ internal sealed class PayloadHandler { } } + if (ImGui.Selectable("Search for Item")) { + this.Ui.Plugin.Functions.SearchForItem(realItemId); + } + if (ImGui.Selectable("Link")) { this.Ui.Plugin.Functions.LinkItem(realItemId); }