From a567c3293f7b035c2e8ecae0d0d4f9c6dbab3ed9 Mon Sep 17 00:00:00 2001 From: Knack117 Date: Sun, 8 Feb 2026 00:57:09 -0500 Subject: [PATCH] Add Shift+Right Click Hand Over to NPCs (quest/dialogue) Co-authored-by: Cursor --- ContextMenuHandler.cs | 21 +++++++++++++++++++-- QuickTransfer.json | 2 +- QuickTransferWindow.cs | 1 + README.md | 5 ++++- pluginmaster.json | 2 +- 5 files changed, 26 insertions(+), 5 deletions(-) diff --git a/ContextMenuHandler.cs b/ContextMenuHandler.cs index b4d568e..512a9ac 100644 --- a/ContextMenuHandler.cs +++ b/ContextMenuHandler.cs @@ -33,6 +33,7 @@ internal static unsafe class ContextMenuHandler Sort, Trade, Sell, + HandOver, } public static bool ContextLabelMatches(AutoContextAction desiredAction, string menuText) @@ -92,6 +93,11 @@ internal static unsafe class ContextMenuHandler t.StartsWith("Sell", StringComparison.OrdinalIgnoreCase) || (Has(t, "Sell") && Has(t, "Item")), + AutoContextAction.HandOver => + t.Equals("Hand Over", StringComparison.OrdinalIgnoreCase) || + (Has(t, "Hand") && Has(t, "Over")) || + (Has(t, "Hand Over") && Has(t, "Item")), + _ => false, }; } @@ -117,8 +123,8 @@ internal static unsafe class ContextMenuHandler // Single-pass: decode each label once, record first match per action. var foundAny = false; - int removeIdx = -1, addIdx = -1, placeIdx = -1, returnIdx = -1, entrustIdx = -1, retrieveIdx = -1, companyRemoveIdx = -1, splitIdx = -1, tradeIdx = -1, sellIdx = -1; - string? removeTxt = null, addTxt = null, placeTxt = null, returnTxt = null, entrustTxt = null, retrieveTxt = null, companyRemoveTxt = null, splitTxt = null, tradeTxt = null, sellTxt = null; + int removeIdx = -1, addIdx = -1, placeIdx = -1, returnIdx = -1, entrustIdx = -1, retrieveIdx = -1, companyRemoveIdx = -1, splitIdx = -1, tradeIdx = -1, sellIdx = -1, handOverIdx = -1; + string? removeTxt = null, addTxt = null, placeTxt = null, returnTxt = null, entrustTxt = null, retrieveTxt = null, companyRemoveTxt = null, splitTxt = null, tradeTxt = null, sellTxt = null, handOverTxt = null; var max = Math.Min(agent->ContextItemCount, 64); for (var i = 0; i < max; i++) @@ -201,6 +207,12 @@ internal static unsafe class ContextMenuHandler sellIdx = i; sellTxt = text; } + + if (handOverIdx < 0 && ContextLabelMatches(AutoContextAction.HandOver, text)) + { + handOverIdx = i; + handOverTxt = text; + } } if (!foundAny) @@ -232,6 +244,11 @@ internal static unsafe class ContextMenuHandler { chosen = companyRemoveIdx >= 0 ? (companyRemoveIdx, companyRemoveTxt) : (-1, (string?)null); } + else if (mode == ModifierMode.Shift && handOverIdx >= 0) + { + // Quest/dialogue: hand over item to NPC + chosen = (handOverIdx, handOverTxt); + } else if (mode == ModifierMode.Ctrl) { chosen = returnIdx >= 0 ? (returnIdx, returnTxt) : diff --git a/QuickTransfer.json b/QuickTransfer.json index 09aeb2d..b66ad99 100644 --- a/QuickTransfer.json +++ b/QuickTransfer.json @@ -3,7 +3,7 @@ "Name": "QuickTransfer", "InternalName": "QuickTransfer", "AssemblyVersion": "1.0.5.0", - "Description": "Automate inventory transfers with Shift/Ctrl/Alt + Right-Click. Trade window, vendor quick sell, FC chest.", + "Description": "Automate inventory transfers with Shift/Ctrl/Alt + Right-Click. Trade window, vendor quick sell, FC chest, Hand Over to NPCs.", "ApplicableVersion": "any", "RepoUrl": "https://github.com/Knack117/QuickTransfer", "Tags": [ diff --git a/QuickTransferWindow.cs b/QuickTransferWindow.cs index a58d95c..3bc5bb4 100644 --- a/QuickTransferWindow.cs +++ b/QuickTransferWindow.cs @@ -138,6 +138,7 @@ public class QuickTransferWindow : Window, IDisposable ImGui.BulletText("Inventory + Armoury (no special container): (Gear) Inventory → \"Place in Armoury Chest\", Armoury → \"Return to Inventory\""); ImGui.BulletText("Company Chest (FreeCompanyChest) open: Shift+RClick Inventory/Armoury deposits, Shift+RClick Company Chest withdraws (\"Remove\")"); ImGui.BulletText("Vendor Shop open: Shift+RClick to auto-select \"Sell\"; enable \"Auto-confirm vendor sell\" to auto-fill quantity and confirm."); + ImGui.BulletText("Quest/dialogue: Shift+RClick on an item to auto-select \"Hand Over\" when handing items to an NPC."); ImGui.BulletText("Middle-Click: Sort the clicked container when a \"Sort\" menu entry exists. In Company Chest, MMB runs an organize pass (stack + compact)."); ImGui.BulletText("Use /qt or click 'Open Config' in plugin list to reopen this window"); diff --git a/README.md b/README.md index 33b7880..c79a731 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A Dalamud plugin for Final Fantasy XIV that adds quick inventory actions via the game's existing context menus: -- **Shift + Right Click**: quick transfers (including vendor sell when shop is open) +- **Shift + Right Click**: quick transfers (including vendor sell when shop is open, and Hand Over to NPCs in quest/dialogue) - **Ctrl + Right Click**: armoury-mode transfers (when a special container is open) - **Alt + Right Click**: split a stack in half @@ -12,6 +12,7 @@ A Dalamud plugin for Final Fantasy XIV that adds quick inventory actions via the - **Vendor Quick Sell**: With a vendor shop open, Shift + Right Click auto-selects **Sell**. With **Auto-confirm vendor sell** enabled, quantity dialogs and "Are you certain?" confirmations are auto-filled and confirmed - **Trade Window Support**: Shift + Right Click items from inventory into Trade window with auto-fill max quantity - **Company Chest**: Shift + Right Click to deposit/withdraw when Free Company Chest is open; middle-click runs organize (stack + compact) +- **Hand Over to NPCs**: During quest or dialogue that requires handing over items, Shift + Right Click on the item to auto-select **Hand Over** - **Armoury Mode**: Hold Ctrl and right-click to prioritize armoury actions while a special container is open - **Split Half**: Hold Alt and right-click to split a stack and auto-fill half - **Middle-Click Sort**: Middle-click an item to auto-select **Sort** (or organize in FC chest) @@ -65,6 +66,8 @@ The plugin only clicks **existing** context menu options when they are available - With a vendor shop open, Shift + Right Click → **Sell**. Enable **Auto-confirm vendor sell** to auto-fill quantity and click OK on "Are you certain?" dialogs. - **Company Chest (Free Company Chest)** - Shift + Right Click Inventory/Armoury → deposit; Shift + Right Click Company Chest → **Remove** (withdraw) +- **Hand Over to NPCs (quest/dialogue)** + - When an NPC is asking for items (e.g. quest turn-in), Shift + Right Click the item → **Hand Over** If an option is not present for the clicked item, **nothing happens**. diff --git a/pluginmaster.json b/pluginmaster.json index e7209c0..881c33e 100644 --- a/pluginmaster.json +++ b/pluginmaster.json @@ -4,7 +4,7 @@ "Name": "QuickTransfer", "InternalName": "QuickTransfer", "AssemblyVersion": "1.0.5.0", - "Description": "Automate inventory transfers with Shift/Ctrl/Alt + Right-Click. Trade window, vendor quick sell, FC chest.", + "Description": "Automate inventory transfers with Shift/Ctrl/Alt + Right-Click. Trade window, vendor quick sell, FC chest, Hand Over to NPCs.", "ApplicableVersion": "any", "RepoUrl": "https://github.com/Knack117/QuickTransfer", "DalamudApiLevel": 14,