From dbdfffbf6726cdef1b19cf1bacc4215218f472c2 Mon Sep 17 00:00:00 2001 From: NoM0Re Date: Sat, 15 Feb 2025 17:34:53 +0100 Subject: [PATCH] from retail --- WeakAuras/Prototypes.lua | 20 ++++++++++++++------ WeakAuras/Types.lua | 9 +++++++-- WeakAuras/WeakAuras.lua | 5 ++--- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 6826a66..2c26d65 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -928,7 +928,7 @@ Private.load_prototype = { display = L["Never"], type = "toggle", width = WeakAuras.normalWidth, - init = "false", + test = "false", }, { name = "alive", @@ -966,6 +966,7 @@ Private.load_prototype = { optional = true, events = {"VEHICLE_UPDATE", "UNIT_ENTERED_VEHICLE", "UNIT_EXITED_VEHICLE"} }, + --[[ { -- broken, fix later COMPANION_UPDATE fires too early for an check, needs some custom stuff name = "mounted", display = L["Mounted"], @@ -975,6 +976,7 @@ Private.load_prototype = { optional = true, --events = {"PLAYER_MOUNT_DISPLAY_CHANGED"} }, + ]] { name ="playerTitle", display = L["Player"], @@ -1102,6 +1104,14 @@ Private.load_prototype = { init = "arg", events = {"PLAYER_TALENT_UPDATE", "PLAYER_ROLES_ASSIGNED", "SPELL_UPDATE_USABLE", "WA_DELAYED_PLAYER_ENTERING_WORLD"} }, + { + name = "spec_position", + display = WeakAuras.newFeatureString .. L["Spec Position"], + type = "multiselect", + values = "spec_position_types", + init = "arg", + events = {"PLAYER_TALENT_UPDATE", "PLAYER_ROLES_ASSIGNED", "SPELL_UPDATE_USABLE", "WA_DELAYED_PLAYER_ENTERING_WORLD"} + }, { name = "raid_role", display = L["Raid Role"], @@ -5050,10 +5060,8 @@ Private.event_prototypes = { local ret = [[ local itemName = %s local exactSpellMatch = %s - local name = GetItemInfo(itemName) or "Invalid" - local icon = GetItemIcon(itemName) or "" if not exactSpellMatch and tonumber(itemName) then - itemName = name + itemName = GetItemInfo(itemName) end local count = GetItemCount(itemName or "", %s, %s); ]]; @@ -5148,14 +5156,14 @@ Private.event_prototypes = { }, { name = "icon", - init = "icon or ''", + init = "GetItemIcon(itemName or '')", hidden = true, store = true, test = "true" }, { name = "name", - init = "name or itemName", + init = "itemName and itemName ~= '' and GetItemInfo(itemName) or itemName", hidden = true, store = true, test = "true" diff --git a/WeakAuras/Types.lua b/WeakAuras/Types.lua index 35377c2..c25746d 100644 --- a/WeakAuras/Types.lua +++ b/WeakAuras/Types.lua @@ -60,6 +60,11 @@ Private.character_types = { npc = L["Non-player Character"] } +Private.spec_position_types = { + caster = L["Ranged"], + melee = L["Melee"] +} + Private.group_sort_types = { ascending = L["Ascending"], descending = L["Descending"], @@ -2317,8 +2322,8 @@ Private.raid_role_types = { Private.role_types = { tank = "|TInterface\\LFGFrame\\UI-LFG-ICON-PORTRAITROLES:16:16:0:0:64:64:0:19:22:41|t "..TANK, - melee = "|TInterface\\LFGFrame\\UI-LFG-ICON-PORTRAITROLES:16:16:0:0:64:64:20:39:22:41|t "..MELEE, - caster = "|TInterface\\LFGFrame\\UI-LFG-ICON-PORTRAITROLES:16:16:0:0:64:64:20:39:22:41|t "..L["Caster"], + melee = "|TInterface\\LFGFrame\\UI-LFG-ICON-PORTRAITROLES:16:16:0:0:64:64:20:39:22:41|t "..L["Melee"], + caster = "|TInterface\\LFGFrame\\UI-LFG-ICON-PORTRAITROLES:16:16:0:0:64:64:20:39:22:41|t "..L["Ranged"], healer = "|TInterface\\LFGFrame\\UI-LFG-ICON-PORTRAITROLES:16:16:0:0:64:64:20:39:1:20|t "..HEALER, } diff --git a/WeakAuras/WeakAuras.lua b/WeakAuras/WeakAuras.lua index 17a8ce5..28266d5 100644 --- a/WeakAuras/WeakAuras.lua +++ b/WeakAuras/WeakAuras.lua @@ -1406,7 +1406,6 @@ local function scanForLoadsImpl(toCheck, event, arg1, ...) raidMemberType = raidMemberType + 2 end - local mounted = IsMounted() local size, difficulty, instanceType = GetInstanceTypeAndSize() local group = Private.ExecEnv.GroupType() local groupSize = GetNumGroupMembers() @@ -1422,8 +1421,8 @@ local function scanForLoadsImpl(toCheck, event, arg1, ...) if (data and not data.controlledChildren) then local loadFunc = loadFuncs[id]; local loadOpt = loadFuncsForOptions[id]; - shouldBeLoaded = loadFunc and loadFunc("ScanForLoads_Auras", inCombat, alive, pvp, vehicle, vehicleUi, mounted, player, realm, class, race, faction, playerLevel, role, raidRole, group, groupSize, raidMemberType, zone, zoneId, subzone, size, difficulty); - couldBeLoaded = loadOpt and loadOpt("ScanForLoads_Auras", inCombat, alive, pvp, vehicle, vehicleUi, mounted, player, realm, class, race, faction, playerLevel, role, raidRole, group, groupSize, raidMemberType, zone, zoneId, subzone, size, difficulty); + shouldBeLoaded = loadFunc and loadFunc("ScanForLoads_Auras", inCombat, alive, pvp, vehicle, vehicleUi, player, realm, class, race, faction, playerLevel, role, role, raidRole, group, groupSize, raidMemberType, zone, zoneId, subzone, size, difficulty); + couldBeLoaded = loadOpt and loadOpt("ScanForLoads_Auras", inCombat, alive, pvp, vehicle, vehicleUi, player, realm, class, race, faction, playerLevel, role, role, raidRole, group, groupSize, raidMemberType, zone, zoneId, subzone, size, difficulty); if(shouldBeLoaded and not loaded[id]) then changed = changed + 1;