From f656bf479514508638dfeacc3c9819c9f5ca8c6d Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Sat, 17 May 2025 18:52:53 +0200 Subject: [PATCH] Enhance documentation for UseContainerItem function with detailed parameter descriptions and usage conditions --- api/UseContainerItem.lua | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/api/UseContainerItem.lua b/api/UseContainerItem.lua index e5d181e..a137662 100644 --- a/api/UseContainerItem.lua +++ b/api/UseContainerItem.lua @@ -1,9 +1,20 @@ ---@diagnostic disable: missing-return, lowercase-global ---@meta ----@param container number ----@param slot number ----@param target string ----@param reagentBankAccessible boolean ----Activate (as with right-clicking) an item in one of the player's bags. Has the same effect as right-clicking an item in the default UI; therefore, results may vary by context. In cases of conflict, conditions listed first override those below: If the bank, guild bank or reagent bank UI is open, moves the item into the bank, guild bank or reagent bank (or if the item is in the bank, guild bank or reagent bank, moves it into the player's inventory). If the trade UI is open, puts the item into the first available trade slot (or if the item is soulbound, into the "will not be traded" slot). If the merchant UI is open and not in repair mode, attempts to sell the item to the merchant. If the Send Mail UI is open, puts the item into the first available slot for message attachments. If an item is readable (e.g. Lament of the Highborne), opens it for reading. If an item is lootable (e.g. Magically Wrapped Gift), opens it for looting If an item can be equipped, attempts to equip the item (placing any currently equipped item of the same type into the container slot used). If an item has a "Use:" effect, activates said effect. Under this condition only, the function is protected and can only be called by the Blizzard UI. If none of the above conditions are true, nothing happens. +---@param container number Index of one of the player's bags or other containers. +---@param slot number Index of an item slot within the container. +---@param target string? A unit to be used as target for the action. +---@param reagentBankAccessible boolean? Indicates if the reagent bank is accessible right now. +---Activate (as with right-clicking) an item in one of the player's bags. +---Has the same effect as right-clicking an item in the default UI; therefore, results may vary by context. +---In cases of conflict, conditions listed first override those below: +---1. If the bank, guild bank or reagent bank UI is open, moves the item into the bank, guild bank or reagent bank (or if the item is in the bank, guild bank or reagent bank, moves it into the player's inventory). +---2. If the trade UI is open, puts the item into the first available trade slot (or if the item is soulbound, into the "will not be traded" slot). +---3. If the merchant UI is open and not in repair mode, attempts to sell the item to the merchant. +---4. If the Send Mail UI is open, puts the item into the first available slot for message attachments. +---5. If an item is readable (e.g. Lament of the Highborne), opens it for reading. +---6. If an item is lootable (e.g. Magically Wrapped Gift), opens it for looting. +---7. If an item can be equipped, attempts to equip the item (placing any currently equipped item of the same type into the container slot used). +---8. If an item has a "Use:" effect, activates said effect. Under this condition only, the function is protected and can only be called by the Blizzard UI. +---If none of the above conditions are true, nothing happens. function UseContainerItem(container, slot, target, reagentBankAccessible) end