From 51a48175fac067a0e6366b140e4ea990bd014296 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Tue, 6 May 2025 22:43:25 +0200 Subject: [PATCH] Update --- C_EquipmentSet.lua | 120 ++++++++++++++++++++++++++++++++++++ api/EditMacro.lua | 2 +- api/GetActionInfo.lua | 34 +++++----- api/GetAddOnEnableState.lua | 2 +- api/GetMacroInfo.lua | 4 +- api/GetSpellInfo.lua | 24 ++++---- api/ReloadUI.lua | 2 +- api/hooksecurefunc.lua | 2 +- 8 files changed, 153 insertions(+), 37 deletions(-) create mode 100644 C_EquipmentSet.lua diff --git a/C_EquipmentSet.lua b/C_EquipmentSet.lua new file mode 100644 index 0000000..01c0d9c --- /dev/null +++ b/C_EquipmentSet.lua @@ -0,0 +1,120 @@ +---@meta +--- +--- C_EquipmentSet is a namespace for functions related to equipment sets. +--- +--- @class C_EquipmentSet +C_EquipmentSet = { + --- @param setID number + --- @param specID number + --- Assigns a specialization to an equipment set + AssignSpecToEquipmentSet = function(setID, specID) end, + + --- @return boolean + --- Returns whether the player can use equipment sets + CanUseEquipmentSets = function() end, + + --- Clears the list of equipment slots to be ignored when saving sets + ClearIgnoredSlotsForSave = function() end, + + --- @param name string + --- @param icon number + --- @return number setID + --- Creates a new equipment set + CreateEquipmentSet = function(name, icon) end, + + --- @param name string + --- Deletes an equipment set + DeleteEquipmentSet = function(name) end, + + --- @param name string + --- @return boolean isLocked + --- Returns whether an equipment set contains locked items + EquipmentSetContainsLockedItems = function(name) end, + + --- @param setID number + --- @return number specID + --- Returns the assigned specialization for an equipment set + GetEquipmentSetAssignedSpec = function(setID) end, + + --- @param specID number + --- @return number setID + --- Returns the equipment set associated with a specialization + GetEquipmentSetForSpec = function(specID) end, + + --- @param name string + --- @return number setID + --- Returns the ID of an equipment set by name + GetEquipmentSetID = function(name) end, + + --- @return table setIDs + --- Returns a table of equipment set IDs + GetEquipmentSetIDs = function() end, + + --- @param index number + --- @return string name + --- @return string icon + --- @return number setID + --- @return boolean isEquipped + --- @return number numItems + --- @return number numEquipped + --- @return number numInventory + --- @return number numMissing + --- @return number numIgnored + --- Returns information about an equipment set (specified by index) + GetEquipmentSetInfo = function(index) end, + + --- @return table ignoredSlots + --- Returns a table of slots that are ignored when saving sets + GetIgnoredSlots = function() end, + + --- @param name string + --- @return table itemIDs + --- Returns a table listing the item IDs in an equipment set + GetItemIDs = function(name) end, + + --- @param name string + --- @return table itemLocations + --- Returns a table listing the locations of the items in an equipment set + GetItemLocations = function(name) end, + + --- @return number numSets + --- Returns the number of saved equipment sets + GetNumEquipmentSets = function() end, + + --- @param slot number + --- Ignores a slot when saving equipment sets + IgnoreSlotForSave = function(slot) end, + + --- @param slot number + --- @return boolean isIgnored + --- Returns whether a slot is ignored when saving sets + IsSlotIgnoredForSave = function(slot) end, + + --- @param oldSetName string + --- @param newSetName string + --- @param icon number + --- Modifies the name and icon of an existing equipment set + ModifyEquipmentSet = function(oldSetName, newSetName, icon) end, + + --- @param index number + --- Puts an equipment set (specified by index) on the cursor + PickupEquipmentSet = function(index) end, + + --- @param name string + --- @param icon number + --- Saves or creates an equipment set with the player's currently equipped items + SaveEquipmentSet = function(name, icon) end, + + --- @param setID number + --- Unassigns the specialization from an equipment set + UnassignEquipmentSetSpec = function(setID) end, + + --- @param slot number + --- Unignores a slot when saving equipment sets + UnignoreSlotForSave = function(slot) end, + + --- @param name string + --- @return boolean equipped + --- Equips the items in an equipment set + UseEquipmentSet = function(name) end, +} diff --git a/api/EditMacro.lua b/api/EditMacro.lua index 0840258..a44cd94 100644 --- a/api/EditMacro.lua +++ b/api/EditMacro.lua @@ -3,7 +3,7 @@ ---@param index number ---@param name string ----@param iconTexture string +---@param iconTexture string? ---@param body string ---@return number newIndex ---Changes the name, icon, and/or body of a macro. After patch 4.3 then the numeric 'icon' argument has been replaced by 'iconTexture'. Furthermore, the function always prepend 'Interface\Icons' to the 'iconTexture' string. diff --git a/api/GetActionInfo.lua b/api/GetActionInfo.lua index 5816101..dc5e866 100644 --- a/api/GetActionInfo.lua +++ b/api/GetActionInfo.lua @@ -1,24 +1,22 @@ ---@diagnostic disable: missing-return, lowercase-global ---@meta +---@alias actionType +---| "companion" +---| "equipmentset" +---| "flyout" +---| "item" +---| "macro" +---| "spell" +---@alias actionSubType +---| "CRITTER" +---| "MOUNT" +---| "spell" + ---@param slot number ----@return spell type ----@return companion ----@return equipmentset ----@return flyout ----@return item ----@return macro ----@return spell ----@return spell id ----@return companion ----@return equipmentset ----@return item ----@return macro ----@return spell ----@return id subType ----@return id CRITTER ----@return id MOUNT ----@return id spell ----@return string spellID +---@return actionType #type +---@return string|number #id +---@return actionSubType #subType +---@return string #spellID ---Returns information about an action slot function GetActionInfo(slot) end diff --git a/api/GetAddOnEnableState.lua b/api/GetAddOnEnableState.lua index 7300ad2..e9ba3f5 100644 --- a/api/GetAddOnEnableState.lua +++ b/api/GetAddOnEnableState.lua @@ -4,5 +4,5 @@ ---@param character string ---@param index number ---@return number enabled ----Queries whether an addon is currently enabled. This may differ from what addons are currently loaded, especially if changes have been made and the UI has not yet been reloaded. +---Queries whether an addon is currently enabled. This may differ from what addons are currently loaded, especially if changes have been made and the UI has not yet been Daved. function GetAddOnEnableState(character, index) end diff --git a/api/GetMacroInfo.lua b/api/GetMacroInfo.lua index db4c7c4..9a1087f 100644 --- a/api/GetMacroInfo.lua +++ b/api/GetMacroInfo.lua @@ -1,10 +1,10 @@ ---@diagnostic disable: missing-return, lowercase-global ---@meta ----@param index number ---@param name string ---@return string name ---@return string texture ---@return string body ---Returns information about a macro -function GetMacroInfo(index, name) end +---@overload fun(index: number): string +function GetMacroInfo(name) end diff --git a/api/GetSpellInfo.lua b/api/GetSpellInfo.lua index 7ef8195..a013e69 100644 --- a/api/GetSpellInfo.lua +++ b/api/GetSpellInfo.lua @@ -1,18 +1,16 @@ ---@diagnostic disable: missing-return, lowercase-global ---@meta ----@param index number ----@param bookType spell ----@param pet ----@param spell ----@param name string ---@param id number ----@return string name ----@return string rank ----@return string icon ----@return number castingTime ----@return number minRange ----@return number maxRange ----@return number spellID +---@return string #name +---@return string #rank +---@return string #icon +---@return number #castingTime +---@return number #minRange +---@return number #maxRange +---@return number #spellID ---Returns information about a spell. As of 4.1, this function should always return valid data for a spell if the spell is in the player's spellbook (by name or index) or if requested by spell id. When in doubt, if the player does not have the spell in their spellbook, use the numeric id to access its information. -function GetSpellInfo(index, bookType, pet, spell, name, id) end +---@overload fun(index: number, bookType: string): string, string, string, number, number, number, number +---@overload fun(name: string): string, string, string, number, number, number, number +---@overload fun(spellID: number): string, string, string, number, number, number, number +function GetSpellInfo(id) end diff --git a/api/ReloadUI.lua b/api/ReloadUI.lua index edd6752..7b0141f 100644 --- a/api/ReloadUI.lua +++ b/api/ReloadUI.lua @@ -1,5 +1,5 @@ ---@diagnostic disable: missing-return, lowercase-global ---@meta ----Reloads the user interface. Saved variables are written to disk, the default UI is reloaded, and all enabled non-LoadOnDemand addons are loaded, including any addons previously disabled which were enabled during the session (see EnableAddOn() et al). +---Reloads the user interface. Saved variables are written to disk, the default UI is Daved, and all enabled non-LoadOnDemand addons are loaded, including any addons previously disabled which were enabled during the session (see EnableAddOn() et al). function ReloadUI() end diff --git a/api/hooksecurefunc.lua b/api/hooksecurefunc.lua index eff1772..8005fda 100644 --- a/api/hooksecurefunc.lua +++ b/api/hooksecurefunc.lua @@ -3,6 +3,6 @@ ---@param func string ---@param hookfunc function ----Add a function to be called after execution of a secure function. Allows one to "post-hook" a secure function without tainting the original. The original function will still be called, but the function supplied will be called after the original, with the same arguments. Return values from the supplied function are discarded. Note that there is no API to remove a hook from a function: any hooks applied will remain in place until the UI is reloaded. Only allows hooking of functions named by a global variable; to hook a script handler on a Frame object, see Frame:HookScript(). +---Add a function to be called after execution of a secure function. Allows one to "post-hook" a secure function without tainting the original. The original function will still be called, but the function supplied will be called after the original, with the same arguments. Return values from the supplied function are discarded. Note that there is no API to remove a hook from a function: any hooks applied will remain in place until the UI is Daved. Only allows hooking of functions named by a global variable; to hook a script handler on a Frame object, see Frame:HookScript(). ---@overload fun(table: table, function: string, hookfunc: function): void function hooksecurefunc(func, hookfunc) end