diff --git a/WeakAuras/Init.lua b/WeakAuras/Init.lua index d46a5b65e5..5118c32326 100644 --- a/WeakAuras/Init.lua +++ b/WeakAuras/Init.lua @@ -12,6 +12,8 @@ local GetAddOnMetadata = C_AddOns and C_AddOns.GetAddOnMetadata or GetAddOnMetad --- @class state --- @field id auraId --- @field cloneId string? +--- @field show boolean? +--- @field changed boolean? --- @alias non_transmissable_field table @@ -31,10 +33,14 @@ local GetAddOnMetadata = C_AddOns and C_AddOns.GetAddOnMetadata or GetAddOnMetad --- @field AddToWatchedTriggerDelay fun(id: auraId, triggerNum: number) --- @field anchor_frame_types table --- @field anchor_frame_types_group table +--- @field anim_function_strings table +--- @field anim_presets table --- @field AuraWarnings AuraWarnings --- @field AuraEnvironmentWrappedSystem AuraEnvironmentWrappedSystem --- @field callbacks callbacks +--- @field category_event_prototype table> --- @field CanHaveTooltip fun(data: auraData): boolean +--- @field CheckTalentsForLoad fun(event: string) --- @field ContainsCustomPlaceHolder fun(input: string): boolean --- @field ContainsAnyPlaceHolders fun(input: string): boolean --- @field ContainsPlaceHolders fun(input: string, placeholders: string, checkDoublePercent?: boolean): boolean @@ -42,10 +48,16 @@ local GetAddOnMetadata = C_AddOns and C_AddOns.GetAddOnMetadata or GetAddOnMetad --- @field clones table> --- @field customActionsFunctions table> --- @field DebugLog debugLog +--- @field dynamic_texts table +--- @field EndEvent fun(state: state): boolean? --- @field EnsureRegion fun(id: auraId, cloneId: string?): Frame --- @field ExecEnv table +--- @field event_prototypes table +--- @field event_categories table +--- @field FindUnusedId fun(prefix: string?): string --- @field FixGroupChildrenOrderForGroup fun(data: auraData) --- @field frames table +--- @field function_strings table --- @field GetDataByUID fun(uid: uid): auraData --- @field GetErrorHandlerId fun(id: auraId, context: string): function --- @field GetErrorHandlerUid fun(uid: uid, context: string): function @@ -54,20 +66,27 @@ local GetAddOnMetadata = C_AddOns and C_AddOns.GetAddOnMetadata or GetAddOnMetad --- @field inverse_point_types table --- @field IsCLEUSubevent fun(subevent: string): boolean --- @field IsDragonriding fun(): boolean +--- @field IsGroupType fun(data: auraData): boolean --- @field item_slot_types string[] --- @field LibSpecWrapper LibSpecWrapper --- @field linked table +--- @field loaded table --- @field LoadFunction fun(input: string): function --- @field LoadOptions fun(msg: string?): boolean +--- @field maxTimerDuration number --- @field multiUnitUnits multiUnitUnits --- @field non_transmissable_fields table --- @field non_transmissable_fields_v2000 table --- @field orientation_types table --- @field orientation_with_circle_types table +--- @field ParseNumber fun (numString: string|number): number? --- @field point_types table --- @field PreShowModels fun() +--- @field PrintHelp fun() --- @field QuotedString fun(input: string): string +--- @field regionOptions table --- @field regions table +--- @field regionTypes table --- @field reset_ranged_swing_spells table --- @field reset_swing_spells table --- @field noreset_swing_spells table @@ -80,7 +99,10 @@ local GetAddOnMetadata = C_AddOns and C_AddOns.GetAddOnMetadata or GetAddOnMetad --- @field StartProfileSystem fun(system: string) --- @field StopProfileAura fun(id: auraId) --- @field StopProfileSystem fun(system: string) +--- @field subRegionOptions table +--- @field subRegionTypes table --- @field tick_placement_modes table +--- @field tinySecondFormat fun(value: string|number): string? --- @field TraverseAll fun(data: auraData): traverseFunction, auraData --- @field TraverseAllChildren fun(data: auraData): traverseFunction, auraData --- @field TraverseGroups fun(data: auraData): traverseFunction, auraData @@ -88,10 +110,13 @@ local GetAddOnMetadata = C_AddOns and C_AddOns.GetAddOnMetadata or GetAddOnMetad --- @field TraverseLeafsOrAura fun(data: auraData): traverseFunction, auraData --- @field TraverseParents fun(data: auraData): traverseFunction, auraData --- @field TraverseSubGroups fun(data: auraData): traverseFunction, auraData +--- @field triggerTypes table +--- @field triggerTypesOptions table --- @field UIDtoID fun(uid: uid): auraId --- @field UnitEventList table --- @field UnitPlayerControlledFixed fun(unit: string): boolean --- @field UpdatedTriggerState fun(id: auraId) +--- @field validate fun(input: table, default:table) --- @field watched_trigger_events table>> --- @alias triggerTypes @@ -110,24 +135,48 @@ local GetAddOnMetadata = C_AddOns and C_AddOns.GetAddOnMetadata or GetAddOnMetad --- @class triggerData --- @field buffShowOn string +--- @field debuffType string +--- @field essence number? --- @field event string|nil ---- @field itemTypeName table|nil --- @field instance_size table|nil +--- @field itemName string? +--- @field itemSetName string? +--- @field itemTypeName table|ni +--- @field range number?l +--- @field realSpellName string? +--- @field rune number? +--- @field spellName string? +--- @field subeventPrefix string? +--- @field subeventSuffix string? --- @field type triggerTypes +--- @field unit string? --- @field use_showOn boolean|nil --- @field use_alwaystrue boolean|nil ---- @field subeventPrefix string? ---- @field subeventSuffix string? + +---@class prototypeDataArgs +---@field name string +---@field required boolean? +---@field display string +---@field type "unit"|nil +---@field init "string"|nil +---@field values any +---@field desc string? +---@field store boolean? +---@field test string? + ---@class prototypeData ----@field durationFunc fun(trigger: triggerData): number, number, boolean? ----@field init fun(trigger: triggerData) +---@field durationFunc (fun(trigger: triggerData): number, number, boolean?)|nil +---@field init (fun(trigger: triggerData):string?)|nil ---@field useModRate boolean? ---@field timedrequired boolean? ----@field GetNameAndIcon fun(trigger: triggerData): string?, string? ----@field iconFunc fun(trigger: triggerData): string? ----@field nameFunc fun(trigger: triggerData): string? - +---@field GetNameAndIcon (fun(trigger: triggerData): string?, string?)|nil +---@field iconFunc (fun(trigger: triggerData): string?)|nil +---@field nameFunc (fun(trigger: triggerData): string?)|nil +---@field events (fun(tigger: triggerData): table)|nil +---@field internal_events (fun(tigger: triggerData): table)|nil +---@field name string +---@field statesParamater "unit"|"one"|"all"|nil --- @class triggerUntriggerData --- @field trigger triggerData diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 7dc63d7c72..08b373b2ce 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -709,7 +709,7 @@ if WeakAuras.IsRetail() then talentCheckFrame:RegisterEvent("PLAYER_TALENT_UPDATE") talentCheckFrame:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED") - --- @type table local selectedTalentsById = {} Private.CheckTalentsForLoad = function(event) @@ -5497,7 +5497,7 @@ Private.event_prototypes = { nameFunc = function(trigger) local item = GetInventoryItemID("player", trigger.itemSlot or 0); if (item) then - return GetItemInfo(item); + return (GetItemInfo(item)) end end, stacksFunc = function(trigger) @@ -5575,7 +5575,7 @@ Private.event_prototypes = { nameFunc = function(trigger) local item = GetInventoryItemID("player", trigger.itemSlot or 0); if (item) then - return GetItemInfo(item) + return (GetItemInfo(item)) else return "" end @@ -9855,7 +9855,7 @@ Private.event_prototypes = { } }, nameFunc = function(trigger) - return GetSpellInfo(trigger.spellName or 0) + return (GetSpellInfo(trigger.spellName or 0)) end, iconFunc = function(trigger) local _, _, icon = GetSpellInfo(trigger.spellName or 0); diff --git a/WeakAuras/RegionTypes/AuraBar.lua b/WeakAuras/RegionTypes/AuraBar.lua index cbb6adaa62..ec446c711b 100644 --- a/WeakAuras/RegionTypes/AuraBar.lua +++ b/WeakAuras/RegionTypes/AuraBar.lua @@ -1063,6 +1063,7 @@ local funcs = { local function create(parent) -- Create overall region (containing everything else) local region = CreateFrame("Frame", nil, parent); + --- @cast region table|Frame region.regionType = "aurabar" region:SetMovable(true); region:SetResizable(true); @@ -1073,6 +1074,7 @@ local function create(parent) end local bar = CreateFrame("Frame", nil, region); + --- @cast bar table|Frame Mixin(bar, Private.SmoothStatusBarMixin); -- Now create a bunch of textures diff --git a/WeakAuras/RegionTypes/Icon.lua b/WeakAuras/RegionTypes/Icon.lua index 65d9df0cf0..1b94c90cb5 100644 --- a/WeakAuras/RegionTypes/Icon.lua +++ b/WeakAuras/RegionTypes/Icon.lua @@ -193,6 +193,7 @@ local function create(parent, data) local font = "GameFontHighlight"; local region = CreateFrame("Frame", nil, parent); + --- @cast region table|Frame region.regionType = "icon" region:SetMovable(true); region:SetResizable(true); @@ -228,6 +229,7 @@ local function create(parent, data) local button if MSQ then button = CreateFrame("Button", nil, region) + --- @cast button table|Button button.data = data region.button = button; button:EnableMouse(false); diff --git a/WeakAurasOptions/OptionsFrames/Update.lua b/WeakAurasOptions/OptionsFrames/Update.lua index e8ca64b888..a780de1766 100644 --- a/WeakAurasOptions/OptionsFrames/Update.lua +++ b/WeakAurasOptions/OptionsFrames/Update.lua @@ -314,10 +314,11 @@ local function BuildUidMap(data, children, type) --- @type table map = { }, - type = type -- Either old or new, only used for error checking + type = type, -- Either old or new, only used for error checking + root = data.uid, + totalCount = #children + 1, + idToUid = {} } - uidMap.root = data.uid - uidMap.totalCount = #children + 1 -- Build helper map from id to uid local idToUid = {} diff --git a/WeakAurasTemplates/TriggerTemplates.lua b/WeakAurasTemplates/TriggerTemplates.lua index d25c6c1109..b8622262ed 100644 --- a/WeakAurasTemplates/TriggerTemplates.lua +++ b/WeakAurasTemplates/TriggerTemplates.lua @@ -459,6 +459,7 @@ end local function createThumbnail(parent) -- Preview frame local borderframe = CreateFrame("Frame", nil, parent); + --- @cast borderframe table|Frame borderframe:SetWidth(32); borderframe:SetHeight(32); @@ -470,6 +471,7 @@ local function createThumbnail(parent) -- Main region local region = CreateFrame("Frame", nil, borderframe); + --- @cast region table|Frame borderframe.region = region; -- Preview children