From 2df204e1271cd6db4506f29b005e0e1e653aafaf Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Fri, 9 Feb 2024 00:25:41 +0100 Subject: [PATCH] Add more types to Types --- .luarc.json | 4 +- WeakAuras/Init.lua | 4 - WeakAuras/SubscribableObject.lua | 8 +- WeakAuras/Types.lua | 423 +++++++++++++++++++++++++++---- 4 files changed, 377 insertions(+), 62 deletions(-) diff --git a/.luarc.json b/.luarc.json index 789505a3b3..fca6f65cf8 100644 --- a/.luarc.json +++ b/.luarc.json @@ -218,7 +218,9 @@ "GetCurrencyListSize", "FIRST_NUMBER_CAP_NO_SPACE", "CreateFramePool", - "AceGUIWeakAurasMultiLineEditBoxWithEnterInsertLink" + "AceGUIWeakAurasMultiLineEditBoxWithEnterInsertLink", + "ExpandCurrencyList", + "GetCurrencyListInfo" ], "runtime.version": "Lua 5.1", "workspace.ignoreDir": [ diff --git a/WeakAuras/Init.lua b/WeakAuras/Init.lua index 0cdde87188..4a5d8bd7c5 100644 --- a/WeakAuras/Init.lua +++ b/WeakAuras/Init.lua @@ -59,9 +59,6 @@ local GetAddOnMetadata = C_AddOns and C_AddOns.GetAddOnMetadata or GetAddOnMetad --- @field frames table --- @field function_strings table --- @field GetDataByUID fun(uid: uid): auraData ---- @field GetDiscoveredCurrencies fun(): table ---- @field GetDiscoveredCurrenciesSorted fun(): table ---- @field GetDiscoveredCurrenciesHeaders fun(): table --- @field GetErrorHandlerId fun(id: auraId, context: string): function --- @field GetErrorHandlerUid fun(uid: uid, context: string): function --- @field GetRegionByUID fun(uid: uid, cloneId: string): Region @@ -83,7 +80,6 @@ local GetAddOnMetadata = C_AddOns and C_AddOns.GetAddOnMetadata or GetAddOnMetad --- @field orientation_types table --- @field orientation_with_circle_types table --- @field ParseNumber fun (numString: string|number): number?, string? ---- @field point_types table --- @field PreShowModels fun() --- @field PrintHelp fun() --- @field QuotedString fun(input: string): string diff --git a/WeakAuras/SubscribableObject.lua b/WeakAuras/SubscribableObject.lua index 0e32145b17..70ae366ea9 100644 --- a/WeakAuras/SubscribableObject.lua +++ b/WeakAuras/SubscribableObject.lua @@ -8,7 +8,7 @@ local L = WeakAuras.L --- @class SubscribableObject --- @field events table Subscribers ordered by "priority" --- @field subscribers table Subscribers lookup ---- @field callback table +--- @field callbacks table --- @field ClearSubscribers fun(self: SubscribableObject) --- @field ClearCallbacks fun(self: SubscribableObject) --- @field AddSubscriber fun(self: SubscribableObject, event: string, subscriber: frame, highPriority: boolean?) @@ -16,9 +16,7 @@ local L = WeakAuras.L --- @field SetOnSubscriptionStatusChanged fun(self: SubscribableObject, event: string, cb: fun()) --- @field Notify fun(self: SubscribableObject, event: type, ...: any) --- @field HasSubscribers fun(self: SubscribableObject, event: string): boolean ---- @type SubscribableObject -local SubscribableObject = -{ +local SubscribableObject = { --- @type fun(self: SubscribableObject) ClearSubscribers = function(self) self.events = {} @@ -55,8 +53,6 @@ local SubscribableObject = end end, - - --- @type fun(self: SubscribableObject, event: string, subscriber: frame) RemoveSubscriber = function(self, event, subscriber) if self.events[event] then diff --git a/WeakAuras/Types.lua b/WeakAuras/Types.lua index f5f637ff45..2c8e8c62ac 100644 --- a/WeakAuras/Types.lua +++ b/WeakAuras/Types.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsLibsOK() then return end + --- @type string, Private local AddonName, Private = ... @@ -22,31 +23,31 @@ local function WA_GetClassColor(classFilename) return "ffffffff" end ---- @class Private ---- @field glow_action_types table +---@class Private +---@field glow_action_types table Private.glow_action_types = { show = L["Show"], hide = L["Hide"] } ---- @class Private ---- @field glow_frame_types table +---@class Private +---@field glow_frame_types table Private.glow_frame_types = { UNITFRAME = L["Unit Frame"], NAMEPLATE = L["Nameplate"], FRAMESELECTOR = L["Frame Selector"] } ---- @class Private ---- @field circular_group_constant_factor_types table +---@class Private +---@field circular_group_constant_factor_types table Private.circular_group_constant_factor_types = { ANGLE = L["Angle and Radius"], RADIUS = L["Radius"], SPACING = L["Spacing"] } ---- @class Private ---- @field frame_strata_types table +---@class Private +---@field frame_strata_types table Private.frame_strata_types = { [1] = L["Inherited"], [2] = "BACKGROUND", @@ -59,29 +60,29 @@ Private.frame_strata_types = { [9] = "TOOLTIP" } ---- @class Private ---- @field hostility_types table +---@class Private +---@field hostility_types table Private.hostility_types = { hostile = L["Hostile"], friendly = L["Friendly"] } ---- @class Private ---- @field character_types table +---@class Private +---@field character_types table Private.character_types = { player = L["Player Character"], npc = L["Non-player Character"] } ---- @class Private ---- @field spec_position_types table +---@class Private +---@field spec_position_types table Private.spec_position_types = { RANGED = L["Ranged"], MELEE = L["Melee"] } ---- @class Private ---- @field group_sort_types table +---@class Private +---@field group_sort_types table Private.group_sort_types = { ascending = L["Ascending"], descending = L["Descending"], @@ -90,38 +91,38 @@ Private.group_sort_types = { custom = L["Custom"] } ---- @class Private ---- @field group_hybrid_position_types table +---@class Private +---@field group_hybrid_position_types table Private.group_hybrid_position_types = { hybridFirst = L["Marked First"], hybridLast = L["Marked Last"] } ---- @class Private ---- @field group_hybrid_sort_types table +---@class Private +---@field group_hybrid_sort_types table Private.group_hybrid_sort_types = { ascending = L["Ascending"], descending = L["Descending"] } ---- @class Private ---- @field time_format_types table +---@class Private +---@field time_format_types table Private.time_format_types = { [0] = L["WeakAuras Built-In (63:42 | 3:07 | 10 | 2.4)"], [1] = L["Old Blizzard (2h | 3m | 10s | 2.4)"], [2] = L["Modern Blizzard (1h 3m | 3m 7s | 10s | 2.4)"], } ---- @class Private ---- @field time_precision_types table +---@class Private +---@field time_precision_types table Private.time_precision_types = { [1] = "12.3", [2] = "12.34", [3] = "12.345", } ---- @class Private ---- @field precision_types table +---@class Private +---@field precision_types table Private.precision_types = { [0] = "12", [1] = "12.3", @@ -129,30 +130,30 @@ Private.precision_types = { [3] = "12.345", } ---- @class Private ---- @field big_number_types table +---@class Private +---@field big_number_types table Private.big_number_types = { ["AbbreviateNumbers"] = L["AbbreviateNumbers (Blizzard)"], ["AbbreviateLargeNumbers"] = L["AbbreviateLargeNumbers (Blizzard)"] } ---- @class Private ---- @field round_types table +---@class Private +---@field round_types table Private.round_types = { floor = L["Floor"], ceil = L["Ceil"], round = L["Round"] } ---- @class Private ---- @field unit_color_types table +---@class Private +---@field unit_color_types table Private.unit_color_types = { none = L["None"], class = L["Class"] } ---- @class Private ---- @field unit_realm_name_types table +---@class Private +---@field unit_realm_name_types table Private.unit_realm_name_types = { never = L["Never"], star = L["* Suffix"], @@ -279,6 +280,8 @@ local simpleFormatters = { }, } +---@class Private +---@field format_types table Private.format_types = { none = { display = L["None"], @@ -854,10 +857,13 @@ Private.format_types = { } } +---@class Private +---@field format_types_display table Private.format_types_display = {} for k, v in pairs(Private.format_types) do Private.format_types_display[k] = v.display end - +---@class Private +---@field sound_channel_types table Private.sound_channel_types = { Master = L["Master"], SFX = ENABLE_SOUNDFX, @@ -866,44 +872,60 @@ Private.sound_channel_types = { Dialog = ENABLE_DIALOG } +---@class Private +---@field sound_condition_types table Private.sound_condition_types = { Play = L["Play"], Loop = L["Loop"], Stop = L["Stop"] } +---@class Private +---@field trigger_require_types table Private.trigger_require_types = { any = L["Any Triggers"], all = L["All Triggers"], custom = L["Custom Function"] } +---@class Private +---@field trigger_require_types_one table Private.trigger_require_types_one = { any = L["Trigger 1"], custom = L["Custom Function"] } +---@class Private +---@field trigger_modes table Private.trigger_modes = { ["first_active"] = -10, } +---@class Private +---@field debuff_types table Private.debuff_types = { HELPFUL = L["Buff"], HARMFUL = L["Debuff"], BOTH = L["Buff/Debuff"] } +---@class Private +---@field tooltip_count table Private.tooltip_count = { [1] = L["First"], [2] = L["Second"], [3] = L["Third"] } +---@class Private +---@field aura_types table Private.aura_types = { BUFF = L["Buff"], DEBUFF = L["Debuff"], } +---@class Private +---@field debuff_class_types table Private.debuff_class_types = { magic = L["Magic"], curse = L["Curse"], @@ -913,6 +935,8 @@ Private.debuff_class_types = { none = L["None"] } +---@class Private +---@field player_target_events table Private.player_target_events = { PLAYER_TARGET_CHANGED = "target", PLAYER_FOCUS_CHANGED = "focus", @@ -920,11 +944,15 @@ Private.player_target_events = { PLAYER_SOFT_FRIEND_CHANGED = "softfriend", } +---@class Private +---@field soft_target_cvars table Private.soft_target_cvars = { softenemy = "SoftTargetEnemy", softfriend = "SoftTargetFriend" } +---@class Private +---@field target_unit_types table local target_unit_types = { target = L["Target"], softenemy = L["Soft Enemy"], @@ -935,6 +963,8 @@ if not WeakAuras.IsClassicEra() then target_unit_types.focus = L["Focus"] end +---@class Private +---@field unit_types table Private.unit_types = Mixin({ player = L["Player"], group = L["Group"], @@ -943,6 +973,8 @@ Private.unit_types = Mixin({ multi = L["Multi-target"] }, target_unit_types) +---@class Private +---@field unit_types_bufftrigger_2 table Private.unit_types_bufftrigger_2 = Mixin({ player = L["Player"], group = L["Smart Group"], @@ -956,12 +988,16 @@ Private.unit_types_bufftrigger_2 = Mixin({ multi = L["Multi-target"] }, target_unit_types) +---@class Private +---@field actual_unit_types_with_specific table Private.actual_unit_types_with_specific = Mixin({ player = L["Player"], pet = L["Pet"], member = L["Specific Unit"] }, target_unit_types) +---@class Private +---@field actual_unit_types_cast table Private.actual_unit_types_cast = Mixin({ player = L["Player"], group = L["Smart Group"], @@ -974,8 +1010,12 @@ Private.actual_unit_types_cast = Mixin({ member = L["Specific Unit"], }, target_unit_types) +---@class Private +---@field actual_unit_types_cast_tooltip string Private.actual_unit_types_cast_tooltip = L["• |cff00ff00Player|r, |cff00ff00Target|r, |cff00ff00Focus|r, and |cff00ff00Pet|r correspond directly to those individual unitIDs.\n• |cff00ff00Specific Unit|r lets you provide a specific valid unitID to watch.\n|cffff0000Note|r: The game will not fire events for all valid unitIDs, making some untrackable by this trigger.\n• |cffffff00Party|r, |cffffff00Raid|r, |cffffff00Boss|r, |cffffff00Arena|r, and |cffffff00Nameplate|r can match multiple corresponding unitIDs.\n• |cffffff00Smart Group|r adjusts to your current group type, matching just the \"player\" when solo, \"party\" units (including \"player\") in a party or \"raid\" units in a raid.\n\n|cffffff00*|r Yellow Unit settings will create clones for each matching unit while this trigger is providing Dynamic Info to the Aura."] +---@class Private +---@field threat_unit_types table Private.threat_unit_types = Mixin({ nameplate = L["Nameplate"], boss = L["Boss"], @@ -983,11 +1023,15 @@ Private.threat_unit_types = Mixin({ none = L["At Least One Enemy"] }, target_unit_types) +---@class Private +---@field unit_types_range_check table Private.unit_types_range_check = Mixin({ pet = L["Pet"], member = L["Specific Unit"] }, target_unit_types) +---@class Private +---@field unit_threat_situation_types table Private.unit_threat_situation_types = { [-1] = L["Not On Threat Table"], [0] = "|cFFB0B0B0"..L["Lower Than Tank"].."|r", @@ -1045,6 +1089,8 @@ do end end +---@class Private +---@field covenant_types table if WeakAuras.IsRetail() then Private.covenant_types = {} Private.covenant_types[0] = L["None"] @@ -1053,12 +1099,16 @@ if WeakAuras.IsRetail() then end end +---@class Private +---@field faction_group table Private.faction_group = { Alliance = L["Alliance"], Horde = L["Horde"], Neutral = L["Neutral"] } +---@class Private +---@field form_types table Private.form_types = {}; local function update_forms() wipe(Private.form_types); @@ -1073,16 +1123,21 @@ local function update_forms() end end end + local form_frame = CreateFrame("Frame"); form_frame:RegisterEvent("UPDATE_SHAPESHIFT_FORMS") form_frame:RegisterEvent("PLAYER_LOGIN") form_frame:SetScript("OnEvent", update_forms); +---@class Private +---@field blend_types table Private.blend_types = { ADD = L["Glow"], BLEND = L["Opaque"] } +---@class Private +---@field texture_wrap_types table Private.texture_wrap_types = { CLAMP = L["Clamp"], MIRROR = L["Mirror"], @@ -1090,21 +1145,29 @@ Private.texture_wrap_types = { CLAMPTOBLACKADDITIVE = L["No Extend"] } +---@class Private +---@field slant_mode table Private.slant_mode = { INSIDE = L["Keep Inside"], EXTEND = L["Extend Outside"] } +---@class Private +---@field text_check_types table Private.text_check_types = { update = L["Every Frame"], event = L["Trigger Update"] } +---@class Private +---@field check_types table Private.check_types = { update = L["Every Frame (High CPU usage)"], event = L["Event(s)"] } +---@class Private +---@field point_types table Private.point_types = { BOTTOMLEFT = L["Bottom Left"], BOTTOM = L["Bottom"], @@ -1117,6 +1180,8 @@ Private.point_types = { CENTER = L["Center"] } +---@class Private +---@field default_types_for_anchor table Private.default_types_for_anchor = {} for k, v in pairs(Private.point_types) do Private.default_types_for_anchor[k] = { @@ -1130,6 +1195,8 @@ Private.default_types_for_anchor["ALL"] = { type = "area" } +---@class Private +---@field aurabar_anchor_areas table Private.aurabar_anchor_areas = { icon = L["Icon"], fg = L["Foreground"], @@ -1174,6 +1241,8 @@ Private.spark_rotation_types = { MANUAL = L["Manual Rotation"] } +---@class Private +---@field spark_hide_types table Private.spark_hide_types = { NEVER = L["Never"], FULL = L["Full"], @@ -1188,6 +1257,8 @@ Private.tick_placement_modes = { ValueOffset = L["Offset from progress"] } +---@class Private +---@field font_flags table Private.font_flags = { None = L["None"], MONOCHROME = L["Monochrome"], @@ -1197,21 +1268,29 @@ Private.font_flags = { ["MONOCHROME|THICKOUTLINE"] = L["Monochrome Thick Outline"] } +---@class Private +---@field text_automatic_width table Private.text_automatic_width = { Auto = L["Automatic"], Fixed = L["Fixed"] } +---@class Private +---@field text_word_wrap table Private.text_word_wrap = { WordWrap = L["Wrap"], Elide = L["Elide"] } +---@class Private +---@field include_pets_types table Private.include_pets_types = { PlayersAndPets = L["Players and Pets"], PetsOnly = L["Pets only"] } +---@class Private +---@field subevent_prefix_types table Private.subevent_prefix_types = { SWING = L["Swing"], RANGE = L["Range"], @@ -1230,6 +1309,8 @@ Private.subevent_prefix_types = { ENCHANT_REMOVED = L["Enchant Removed"] } +---@class Private +---@field subevent_actual_prefix_types table Private.subevent_actual_prefix_types = { SWING = L["Swing"], RANGE = L["Range"], @@ -1239,6 +1320,8 @@ Private.subevent_actual_prefix_types = { ENVIRONMENTAL = L["Environmental"] } +---@class Private +---@field subevent_suffix_types table Private.subevent_suffix_types = { _ABSORBED = L["Absorbed"], _DAMAGE = L["Damage"], @@ -1274,6 +1357,8 @@ Private.subevent_suffix_types = { _RESURRECT = L["Resurrect"] } +---@class Private +---@field power_types table Private.power_types = { [0] = POWER_TYPE_MANA, [1] = POWER_TYPE_RED_POWER, @@ -1296,6 +1381,8 @@ if WeakAuras.IsRetail() then Private.power_types[19] = POWER_TYPE_ESSENCE end +---@class Private +---@field miss_types table Private.miss_types = { ABSORB = L["Absorb"], BLOCK = L["Block"], @@ -1309,6 +1396,8 @@ Private.miss_types = { RESIST = L["Resist"] } +---@class Private +---@field environmental_types table Private.environmental_types = { Drowning = STRING_ENVIRONMENTAL_DAMAGE_DROWNING, Falling = STRING_ENVIRONMENTAL_DAMAGE_FALLING, @@ -1318,6 +1407,8 @@ Private.environmental_types = { Slime = STRING_ENVIRONMENTAL_DAMAGE_SLIME } +---@class Private +---@field combatlog_flags_check_type table Private.combatlog_flags_check_type = { Mine = L["Mine"], InGroup = L["In Group"], @@ -1325,12 +1416,16 @@ Private.combatlog_flags_check_type = { NotInGroup = L["Not in Smart Group"] } +---@class Private +---@field combatlog_flags_check_reaction table Private.combatlog_flags_check_reaction = { Hostile = L["Hostile"], Neutral = L["Neutral"], Friendly = L["Friendly"] } +---@class Private +---@field combatlog_flags_check_object_type table Private.combatlog_flags_check_object_type = { Object = L["Object"], Guardian = L["Guardian"], @@ -1339,6 +1434,8 @@ Private.combatlog_flags_check_object_type = { Player = L["Player"] } +---@class Private +---@field combatlog_spell_school_types table Private.combatlog_spell_school_types = { [1] = STRING_SCHOOL_PHYSICAL, [2] = STRING_SCHOOL_HOLY, @@ -1376,13 +1473,18 @@ Private.combatlog_spell_school_types = { [127] = STRING_SCHOOL_CHAOS, } ---- @class Private ---- @field combatlog_spell_school_types_for_ui table +---@class Private +---@field combatlog_spell_school_types_for_ui table Private.combatlog_spell_school_types_for_ui = {} for id, str in pairs(Private.combatlog_spell_school_types) do Private.combatlog_spell_school_types_for_ui[id] = ("%.3d - %s"):format(id, str) end +---@class Private +---@field GetCurrencyListSize fun(): number +---@field GetCurrencyIDFromLink fun(currencyLink: string): number +---@field ExpandCurrencyList fun(index: number, expand: boolean): any +---@field GetCurrencyListInfo fun(index: number): table if WeakAuras.IsRetail() then Private.GetCurrencyListSize = C_CurrencyInfo.GetCurrencyListSize Private.GetCurrencyIDFromLink = C_CurrencyInfo.GetCurrencyIDFromLink @@ -1427,6 +1529,10 @@ elseif WeakAuras.IsWrathClassic() then end end +---@class Private +---@field discovered_currencies table +---@field discovered_currencies_sorted table +---@field discovered_currencies_headers table local function InitializeCurrencies() if Private.discovered_currencies then return @@ -1471,21 +1577,31 @@ local function InitializeCurrencies() Private.discovered_currencies_sorted["member"] = -1; end -Private.GetDiscoveredCurencies = function() +---@class Private +---@field GetDiscoveredCurrencies function +Private.GetDiscoveredCurrencies = function() InitializeCurrencies() return Private.discovered_currencies end -Private.GetDiscoveredCurenciesSorted = function() +---@class Private +---@field GetDiscoveredCurrenciesSorted function +Private.GetDiscoveredCurrenciesSorted = function() InitializeCurrencies() return Private.discovered_currencies_sorted end -Private.GetDiscoveredCurenciesHeaders = function() +---@class Private +---@field GetDiscoveredCurrenciesHeaders function +Private.GetDiscoveredCurrenciesHeaders = function() InitializeCurrencies() return Private.discovered_currencies_headers end +---@class Private +---@field reputations table +---@field reputations_sorted table +---@field reputations_headers table local function InitializeReputations() if Private.reputations then return @@ -1526,21 +1642,29 @@ local function InitializeReputations() end end +---@class Private +---@field GetReputations function Private.GetReputations = function() InitializeReputations() return Private.reputations end +---@class Private +---@field GetReputationsSorted function Private.GetReputationsSorted = function() InitializeReputations() return Private.reputations_sorted end +---@class Private +---@field GetReputationsHeaders function Private.GetReputationsHeaders = function() InitializeReputations() return Private.reputations_headers end +---@class Private +---@field combatlog_raid_mark_check_type table Private.combatlog_raid_mark_check_type = { [0] = RAID_TARGET_NONE, "|TInterface\\TARGETINGFRAME\\UI-RaidTargetingIcon_1:14|t " .. RAID_TARGET_1, -- Star @@ -1554,6 +1678,8 @@ Private.combatlog_raid_mark_check_type = { L["Any"] } +---@class Private +---@field combatlog_raidFlags table Private.combatlog_raidFlags = { [0] = 0, [1] = 1, @@ -1566,6 +1692,8 @@ Private.combatlog_raidFlags = { [128] = 8, } +---@class Private +---@field raid_mark_check_type table Private.raid_mark_check_type = CopyTable(Private.combatlog_raid_mark_check_type) Private.raid_mark_check_type[9] = nil @@ -1585,6 +1713,8 @@ Private.orientation_with_circle_types = { ANTICLOCKWISE = L["Anticlockwise"] } +---@class Private +---@field gradient_orientations table Private.gradient_orientations = { HORIZONTAL = L["Horizontal"], VERTICAL = L["Vertical"] @@ -1609,6 +1739,9 @@ Private.spec_types_2 = { } WeakAuras.spec_types_specific = {} + +---@class Private +---@field spec_types_all table Private.spec_types_all = {} local function update_specs() for classFileName, classID in pairs(WeakAuras.class_ids) do @@ -1628,7 +1761,8 @@ local function update_specs() end end - +---@class Private +---@field talent_types table Private.talent_types = {} if WeakAuras.IsRetail() then local spec_frame = CreateFrame("Frame"); @@ -1643,6 +1777,8 @@ else end end +---@class Private +---@field pvp_talent_types table Private.pvp_talent_types = {} if WeakAuras.IsRetail() then for i = 1,10 do @@ -1650,6 +1786,8 @@ if WeakAuras.IsRetail() then end end +---@class Private +---@field talent_extra_option_types table Private.talent_extra_option_types = { [0] = L["Talent Known"], [1] = L["Talent Selected"], @@ -1658,12 +1796,16 @@ Private.talent_extra_option_types = { } -- GetTotemInfo() only works for the first 5 totems +---@class Private +---@field totem_types table Private.totem_types = {}; local totemString = L["Totem #%i"]; for i = 1, 5 do Private.totem_types[i] = totemString:format(i); end +---@class Private +---@field loss_of_control_types table Private.loss_of_control_types = { NONE = "NONE", CHARM = "CHARM", @@ -1681,6 +1823,8 @@ Private.loss_of_control_types = { STUN_MECHANIC = "STUN_MECHANIC", } +---@class Private +---@field main_spell_schools table Private.main_spell_schools = { [1] = GetSchoolString(1), [2] = GetSchoolString(2), @@ -1691,6 +1835,8 @@ Private.main_spell_schools = { [64] = GetSchoolString(64), } +---@class Private +---@field texture_types table> Private.texture_types = { ["Blizzard Alerts"] = { ["424570"] = "Spell Activation Overlay 0", @@ -2269,6 +2415,8 @@ Private.texture_types["PowerAuras Words"] = { ["Interface\\AddOns\\WeakAuras\\Media\\Textures\\interrupt"] = "Interrupt" } +---@class Private +---@field operator_types table Private.operator_types = { ["=="] = "=", ["~="] = "!=", @@ -2278,27 +2426,37 @@ Private.operator_types = { ["<="] = "<=" } +---@class Private +---@field equality_operator_types table Private.equality_operator_types = { ["=="] = "=", ["~="] = "!=" } +---@class Private +---@field operator_types_without_equal table Private.operator_types_without_equal = { [">="] = ">=", ["<="] = "<=" } +---@class Private +---@field string_operator_types table Private.string_operator_types = { ["=="] = L["Is Exactly"], ["find('%s')"] = L["Contains"], ["match('%s')"] = L["Matches (Pattern)"] } +---@class Private +---@field weapon_types table Private.weapon_types = { ["main"] = MAINHANDSLOT, ["off"] = SECONDARYHANDSLOT } +---@class Private +---@field swing_types table Private.swing_types = { ["main"] = MAINHANDSLOT, ["off"] = SECONDARYHANDSLOT @@ -2308,6 +2466,9 @@ if WeakAuras.IsClassicEraOrWrath() then Private.swing_types["ranged"] = RANGEDSLOT end +---@class Private +---@field rune_specific_types table +---@field essence_specific_types table if WeakAuras.IsWrathClassic() then Private.rune_specific_types = { [1] = L["Blood Rune #1"], @@ -2336,27 +2497,37 @@ else } end +---@class Private +---@field custom_trigger_types table Private.custom_trigger_types = { ["event"] = L["Event"], ["status"] = L["Status"], ["stateupdate"] = L["Trigger State Updater (Advanced)"] } +---@class Private +---@field eventend_types table Private.eventend_types = { ["timed"] = L["Timed"], ["custom"] = L["Custom"] } +---@class Private +---@field timedeventend_types table Private.timedeventend_types = { ["timed"] = L["Timed"], } +---@class Private +---@field justify_types table Private.justify_types = { ["LEFT"] = L["Left"], ["CENTER"] = L["Center"], ["RIGHT"] = L["Right"] } +---@class Private +---@field grow_types table Private.grow_types = { ["LEFT"] = L["Left"], ["RIGHT"] = L["Right"], @@ -2372,7 +2543,8 @@ Private.grow_types = { -- horizontal types: R (right), L (left) -- vertical types: U (up), D (down) ---- @type table +---@class Private +---@field grid_types table Private.grid_types = { RU = L["Right, then Up"], UR = L["Up, then Right"], @@ -2394,7 +2566,8 @@ Private.grid_types = { VH = L["Centered Vertical, then Centered Horizontal"] } ---- @type table +---@class Private +---@field centered_types_h table Private.centered_types_h = { LR = L["Left to Right"], RL = L["Right to Left"], @@ -2402,7 +2575,8 @@ Private.centered_types_h = { CRL = L["Center, then alternating right and left"] } ---- @type table +---@class Private +---@field centered_types_v table Private.centered_types_v = { LR = L["Bottom to Top"], RL = L["Top to Bottom"], @@ -2410,40 +2584,54 @@ Private.centered_types_v = { CRL = L["Center, then alternating top and bottom"] } +---@class Private +---@field text_rotate_types table Private.text_rotate_types = { ["LEFT"] = L["Left"], ["NONE"] = L["None"], ["RIGHT"] = L["Right"] } +---@class Private +---@field align_types table Private.align_types = { ["LEFT"] = L["Left"], ["CENTER"] = L["Center"], ["RIGHT"] = L["Right"] } +---@class Private +---@field rotated_align_types table Private.rotated_align_types = { ["LEFT"] = L["Top"], ["CENTER"] = L["Center"], ["RIGHT"] = L["Bottom"] } +---@class Private +---@field icon_side_types table Private.icon_side_types = { ["LEFT"] = L["Left"], ["RIGHT"] = L["Right"] } +---@class Private +---@field rotated_icon_side_types table Private.rotated_icon_side_types = { ["LEFT"] = L["Top"], ["RIGHT"] = L["Bottom"] } +---@class Private +---@field anim_types table Private.anim_types = { none = L["None"], preset = L["Preset"], custom = L["Custom"] } +---@class Private +---@field anim_ease_types table Private.anim_ease_types = { none = L["None"], easeIn = L["Ease In"], @@ -2451,6 +2639,8 @@ Private.anim_ease_types = { easeOutIn = L["Ease In and Out"] } +---@class Private +---@field anim_ease_functions table Private.anim_ease_functions = { none = function(percent) return percent end, easeIn = function(percent, power) @@ -2467,6 +2657,8 @@ Private.anim_ease_functions = { end } +---@class Private +---@field anim_translate_types table Private.anim_translate_types = { straightTranslate = L["Normal"], circle = L["Circle"], @@ -2478,6 +2670,8 @@ Private.anim_translate_types = { custom = L["Custom Function"] } +---@class Private +---@field anim_scale_types table Private.anim_scale_types = { straightScale = L["Normal"], pulse = L["Pulse"], @@ -2486,6 +2680,8 @@ Private.anim_scale_types = { custom = L["Custom Function"] } +---@class Private +---@field anim_alpha_types table Private.anim_alpha_types = { straight = L["Normal"], alphaPulse = L["Pulse"], @@ -2493,6 +2689,8 @@ Private.anim_alpha_types = { custom = L["Custom Function"] } +---@class Private +---@field anim_rotate_types table Private.anim_rotate_types = { straight = L["Normal"], backandforth = L["Back and Forth"], @@ -2500,6 +2698,8 @@ Private.anim_rotate_types = { custom = L["Custom Function"] } +---@class Private +---@field anim_color_types table Private.anim_color_types = { straightColor = L["Legacy RGB Gradient"], straightHSV = L["Gradient"], @@ -2508,6 +2708,8 @@ Private.anim_color_types = { custom = L["Custom Function"] } +---@class Private +---@field instance_types table Private.instance_types = { none = L["No Instance"], scenario = L["Scenario"], @@ -2529,9 +2731,9 @@ if WeakAuras.IsClassicEra() then Private.instance_types["ratedarena"] = nil end -Private.instance_difficulty_types = { - -} +---@class Private +---@field instance_difficulty_types table +Private.instance_difficulty_types = {} do -- Fill out instance_difficulty_types automatically. @@ -2609,6 +2811,8 @@ do end end +---@class Private +---@field TocToExpansion table Private.TocToExpansion = { [1] = L["Classic"], [2] = L["Burning Crusade"], @@ -2622,12 +2826,16 @@ Private.TocToExpansion = { [10] = L["Dragonflight"] } +---@class Private +---@field group_types table Private.group_types = { solo = L["Not in Group"], group = L["In Party"], raid = L["In Raid"] } +---@class Private +---@field difficulty_types table if WeakAuras.IsRetail() then Private.difficulty_types = { none = L["None"], @@ -2646,7 +2854,8 @@ elseif WeakAuras.IsWrathClassic() then } end - +---@class Private +---@field raid_role_types table if WeakAuras.IsClassicEraOrWrath() then Private.raid_role_types = { MAINTANK = "|TInterface\\GroupFrame\\UI-Group-maintankIcon:16:16|t "..MAINTANK, @@ -2654,6 +2863,9 @@ if WeakAuras.IsClassicEraOrWrath() then NONE = L["Other"] } end + +---@class Private +---@field role_types table if WeakAuras.IsWrathOrRetail() then Private.role_types = { TANK = INLINE_TANK_ICON.." "..TANK, @@ -2662,12 +2874,16 @@ if WeakAuras.IsWrathOrRetail() then } end +---@class Private +---@field group_member_types table Private.group_member_types = { LEADER = L["Leader"], ASSIST = L["Assist"], NONE = L["None"] } +---@class Private +---@field classification_types table Private.classification_types = { worldboss = L["World Boss"], rareelite = L["Rare Elite"], @@ -2678,6 +2894,8 @@ Private.classification_types = { minus = L["Minus (Small Nameplate)"] } +---@class Private +---@field anim_start_preset_types table Private.anim_start_preset_types = { slidetop = L["Slide from Top"], slideleft = L["Slide from Left"], @@ -2691,6 +2909,8 @@ Private.anim_start_preset_types = { starShakeDecay = L["Star Shake"], } +---@class Private +---@field anim_main_preset_types table Private.anim_main_preset_types = { shake = L["Shake"], spin = L["Spin"], @@ -2705,6 +2925,8 @@ Private.anim_main_preset_types = { bounce = L["Bounce"] } +---@class Private +---@field anim_finish_preset_types table Private.anim_finish_preset_types = { slidetop = L["Slide to Top"], slideleft = L["Slide to Left"], @@ -2716,8 +2938,10 @@ Private.anim_finish_preset_types = { spiral = L["Spiral"], bounceDecay = L["Bounce"], starShakeDecay = L["Star Shake"], -}; +} +---@class Private +---@field chat_message_types table Private.chat_message_types = { CHAT_MSG_INSTANCE_CHAT = L["Instance"], CHAT_MSG_BG_SYSTEM_NEUTRAL = L["BG-System Neutral"], @@ -2745,6 +2969,8 @@ Private.chat_message_types = { CHAT_MSG_LOOT = L["Loot"], } +---@class Private +---@field send_chat_message_types table Private.send_chat_message_types = { WHISPER = L["Whisper"], SAY = L["Say"], @@ -2762,31 +2988,42 @@ Private.send_chat_message_types = { ERROR = L["Error Frame"] } - Private.send_chat_message_types.TTS = L["Text-to-speech"] + +---@class Private +---@field tts_voices table Private.tts_voices = {} + local function updateTts() wipe(Private.tts_voices) for i, voiceInfo in pairs(C_VoiceChat.GetTtsVoices()) do Private.tts_voices[voiceInfo.voiceID] = voiceInfo.name end end + updateTts() + local TtsUpdateFrame = CreateFrame("FRAME") TtsUpdateFrame:RegisterEvent("VOICE_CHAT_TTS_VOICES_UPDATE") TtsUpdateFrame:SetScript("OnEvent", updateTts) +---@class Private +---@field group_aura_name_info_types table Private.group_aura_name_info_types = { aura = L["Aura Name"], players = L["Player(s) Affected"], nonplayers = L["Player(s) Not Affected"] } +---@class Private +---@field group_aura_stack_info_types table Private.group_aura_stack_info_types = { count = L["Number Affected"], stack = L["Aura Stack"] } +---@class Private +---@field cast_types table Private.cast_types = { cast = L["Cast"], channel = L["Channel (Spell)"] @@ -2905,12 +3142,15 @@ LSM:Register("sound", "Wicked Female Laugh", PowerAurasSoundPath.."wlaugh.ogg") LSM:Register("sound", "Wolf Howl", PowerAurasSoundPath.."wolf5.ogg") LSM:Register("sound", "Yeehaw", PowerAurasSoundPath.."yeehaw.ogg") - +---@class Private +---@field sound_types table Private.sound_types = { [" custom"] = " " .. L["Custom"], [" KitID"] = " " .. L["Sound by Kit ID"] } +---@class Private +---@field sound_file_types table Private.sound_file_types = {} for name, path in next, LSM:HashTable("sound") do @@ -2947,15 +3187,21 @@ LSM:Register("statusbar", "Thick Stripes", [[Interface\AddOns\WeakAuras\Media\Te LSM:Register("statusbar", "Thin Stripes", [[Interface\AddOns\WeakAuras\Media\Textures\Statusbar_Stripes_Thin]]) LSM:Register("border", "Drop Shadow", [[Interface\AddOns\WeakAuras\Media\Textures\Border_DropShadow]]) +---@class Private +---@field duration_types table Private.duration_types = { seconds = L["Seconds"], relative = L["Relative"] } +---@class Private +---@field duration_types_no_choice table Private.duration_types_no_choice = { seconds = L["Seconds"] } +---@class Private +---@field gtfo_types table Private.gtfo_types = { [1] = L["High Damage"], [2] = L["Low Damage"], @@ -2963,6 +3209,8 @@ Private.gtfo_types = { [4] = L["Friendly Fire"] } +---@class Private +---@field pet_behavior_types table Private.pet_behavior_types = { passive = PET_MODE_PASSIVE, defensive = PET_MODE_DEFENSIVE, @@ -2974,6 +3222,8 @@ if WeakAuras.IsClassicEraOrWrath() then Private.pet_behavior_types.assist = nil end +---@class Private +---@field pet_spec_types table if WeakAuras.IsRetail() then Private.pet_spec_types = { [1] = select(2, GetSpecializationInfoByID(74)), -- Ferocity @@ -2984,24 +3234,32 @@ else Private.pet_spec_types = {} end +---@class Private +---@field cooldown_progress_behavior_types table Private.cooldown_progress_behavior_types = { showOnCooldown = L["On Cooldown"], showOnReady = L["Not on Cooldown"], showAlways = L["Always"] } +---@class Private +---@field cooldown_types table Private.cooldown_types = { auto = L["Auto"], charges = L["Charges"], cooldown = L["Cooldown"] } +---@class Private +---@field bufftrigger_progress_behavior_types table Private.bufftrigger_progress_behavior_types = { showOnActive = L["Buffed/Debuffed"], showOnMissing = L["Missing"], showAlways= L["Always"] } +---@class Private +---@field bufftrigger_2_progress_behavior_types table Private.bufftrigger_2_progress_behavior_types = { showOnActive = L["Aura(s) Found"], showOnMissing = L["Aura(s) Missing"], @@ -3009,11 +3267,15 @@ Private.bufftrigger_2_progress_behavior_types = { showOnMatches = L["Match Count"] } +---@class Private +---@field bufftrigger_2_preferred_match_types table Private.bufftrigger_2_preferred_match_types = { showLowest = L["Least remaining time"], showHighest = L["Most remaining time"] } +---@class Private +---@field bufftrigger_2_per_unit_mode table Private.bufftrigger_2_per_unit_mode = { affected = L["Affected"], unaffected = L["Unaffected"], @@ -3049,37 +3311,51 @@ Private.item_slot_types = { [28] = FISHINGTOOLSLOT, } +---@class Private +---@field charges_change_type table Private.charges_change_type = { GAINED = L["Gained"], LOST = L["Lost"], CHANGED = L["Changed"] } +---@class Private +---@field charges_change_condition_type table Private.charges_change_condition_type = { GAINED = L["Gained"], LOST = L["Lost"] } +---@class Private +---@field combat_event_type table Private.combat_event_type = { PLAYER_REGEN_ENABLED = L["Leaving"], PLAYER_REGEN_DISABLED = L["Entering"] } +---@class Private +---@field encounter_event_type table Private.encounter_event_type = { ENCOUNTER_END = L["Leaving"], ENCOUNTER_START = L["Entering"] } +---@class Private +---@field bool_types table Private.bool_types = { [0] = L["False"], [1] = L["True"] } +---@class Private +---@field absorb_modes table Private.absorb_modes = { OVERLAY_FROM_START = L["Attach to Start"], OVERLAY_FROM_END = L["Attach to End"] } +---@class Private +---@field mythic_plus_affixes table Private.mythic_plus_affixes = {} local mythic_plus_ignorelist = { @@ -3096,6 +3372,8 @@ if WeakAuras.IsRetail() then end end +---@class Private +---@field update_categories table> Private.update_categories = { { name = "anchor", @@ -3216,6 +3494,8 @@ Private.update_categories = { -- fields that are handled as special cases when importing -- mismatch of internal fields is not counted as a difference +---@class Private +---@field internal_fields table Private.internal_fields = { uid = true, internalVersion = true, @@ -3252,6 +3532,8 @@ Private.non_transmissable_fields_v2000 = { } } +---@class Private +---@field data_stub table Private.data_stub = { -- note: this is the minimal data stub which prevents false positives in diff upon reimporting an aura. -- pending a refactor of other code which adds unnecessary fields, it is possible to shrink it @@ -3315,6 +3597,8 @@ Private.data_stub = { information = {}, } +---@class Private +---@field author_option_classes table Private.author_option_classes = { toggle = "simple", input = "simple", @@ -3330,6 +3614,8 @@ Private.author_option_classes = { group = "group" } +---@class Private +---@field author_option_types table Private.author_option_types = { toggle = L["Toggle"], input = L["String"], @@ -3345,6 +3631,8 @@ Private.author_option_types = { group = L["Option Group"], } +---@class Private +---@field author_option_fields table> Private.author_option_fields = { common = { type = true, @@ -3418,6 +3706,8 @@ Private.author_option_fields = { } } +---@class Private +---@field shared_media_types table Private.shared_media_types = { sound = L["Sound"], font = L["Font"], @@ -3426,6 +3716,8 @@ Private.shared_media_types = { statusbar = L["Status Bar"] } +---@class Private +---@field author_option_media_defaults table Private.author_option_media_defaults = { sound = "Interface\\AddOns\\WeakAuras\\Media\\Sounds\\AirHorn.ogg", font = "Friz Quadrata TT", @@ -3433,21 +3725,32 @@ Private.author_option_media_defaults = { background = "None", statusbar = "Blizzard", } + +---@class Private +---@field author_option_media_controls table Private.author_option_media_controls = { statusbar = "LSM30_Statusbar", border = "LSM30_Border", background = "LSM30_Background", font = "LSM30_Font" } + +---@class Private +---@field author_option_media_itemControls table Private.author_option_media_itemControls = { sound = "WeakAurasMediaSound" } + +---@class Private +---@field array_entry_name_types table Private.array_entry_name_types = { [-1] = L["Fixed Names"], [0] = L["Entry Order"], -- the rest is auto-populated with indices which are valid entry name sources } +---@class Private +---@field name_source_option_types table Private.name_source_option_types = { -- option types which can be used to generate entry names on arrays input = true, @@ -3455,17 +3758,23 @@ Private.name_source_option_types = { range = true, } +---@class Private +---@field group_limit_types table Private.group_limit_types = { none = L["Unlimited"], max = L["Limited"], fixed = L["Fixed Size"], } +---@class Private +---@field group_option_types table Private.group_option_types = { simple = L["Simple"], array = L["Array"], } +---@class Private +---@field difficulty_info table Private.difficulty_info = { [1] = { size = "party", @@ -3575,12 +3884,16 @@ if WeakAuras.IsRetail() then end end +---@class Private +---@field font_sizes table Private.font_sizes = { small = L["Small"], medium = L["Medium"], large = L["Large"], } +---@class Private +---@field baseUnitId table -- unitIds registerable with RegisterUnitEvent Private.baseUnitId = { ["player"] = true, @@ -3592,6 +3905,8 @@ Private.baseUnitId = { ["softfriend"] = true } +---@class Private +---@field multiUnitId table Private.multiUnitId = { ["nameplate"] = true, ["boss"] = true, @@ -3651,6 +3966,8 @@ for i = 1, 40 do Private.multiUnitUnits.raid["raidpet"..i] = true end +---@class Private +---@field dbm_types table Private.dbm_types = { [1] = L["Add"], [2] = L["AOE"], @@ -3661,6 +3978,8 @@ Private.dbm_types = { [7] = L["Important"] } +---@class Private +---@field weapon_enchant_types table Private.weapon_enchant_types = { showOnActive = L["Enchant Found"], showOnMissing = L["Enchant Missing"], @@ -3732,6 +4051,8 @@ Private.noreset_swing_spells = { --35474 Drums of Panic DO reset the swing timer, do not add } +---@class Private +---@field item_weapon_types table Private.item_weapon_types = {} local skippedWeaponTypes = {}