From b7dac42f5a3a365d2128494be1b59e26c6e13de0 Mon Sep 17 00:00:00 2001 From: NoM0Re <1629787+NoM0Re@users.noreply.github.com> Date: Sun, 7 Jul 2024 05:34:25 +0200 Subject: [PATCH] add lead/assist and maintank/mainassist load options --- WeakAuras/Locales/deDE.lua | 5 +++++ WeakAuras/Locales/enUS.lua | 3 +++ WeakAuras/Locales/esES.lua | 3 +++ WeakAuras/Locales/esMX.lua | 3 +++ WeakAuras/Locales/frFR.lua | 5 +++++ WeakAuras/Locales/itIT.lua | 5 +++++ WeakAuras/Locales/koKR.lua | 3 +++ WeakAuras/Locales/ptBR.lua | 5 +++++ WeakAuras/Locales/ruRU.lua | 3 +++ WeakAuras/Locales/zhCN.lua | 3 +++ WeakAuras/Locales/zhTW.lua | 3 +++ WeakAuras/Prototypes.lua | 28 ++++++++++++++++++++++++++++ WeakAuras/Types.lua | 12 ++++++++++++ WeakAuras/WeakAuras.lua | 19 ++++++++++++++++--- 14 files changed, 97 insertions(+), 3 deletions(-) diff --git a/WeakAuras/Locales/deDE.lua b/WeakAuras/Locales/deDE.lua index c89373e..551b378 100644 --- a/WeakAuras/Locales/deDE.lua +++ b/WeakAuras/Locales/deDE.lua @@ -155,6 +155,7 @@ L["Armor Rating"] = "Armor Rating" L["Array"] = "Array" L["Ascending"] = "Aufsteigend" L["Assigned Role"] = "Zugewiesene Rolle" +L["Assist"] = "Assist" L["At Least One Enemy"] = "Zumindest ein Feind" --[[Translation missing --]] L["At missing Value"] = "At missing Value" @@ -578,6 +579,8 @@ L["Grid"] = "Grid" L["Grobbulus"] = "Grobbulus" L["Group"] = "Gruppe" L["Group Arrangement"] = "Gruppenanordnung" +--[[Translation missing --]] +L["Group Leader/Assist"] = "Group Leader/Assist" L["Grow"] = "Wachsen" L["GTFO Alert"] = "GTFO-Warnung" L["Guardian"] = "Wächter" @@ -729,6 +732,8 @@ L["Large"] = "Large" --[[Translation missing --]] L["Latency"] = "Latency" --[[Translation missing --]] +L["Leader"] = "Leader" +--[[Translation missing --]] L["Least remaining time"] = "Least remaining time" L["Leaving"] = "Verlassen" L["Leech"] = "Saugen (LEECH)" diff --git a/WeakAuras/Locales/enUS.lua b/WeakAuras/Locales/enUS.lua index 7a94a6d..a46854f 100644 --- a/WeakAuras/Locales/enUS.lua +++ b/WeakAuras/Locales/enUS.lua @@ -114,6 +114,7 @@ L["Armor Rating"] = "Armor Rating" L["Array"] = "Array" L["Ascending"] = "Ascending" L["Assigned Role"] = "Assigned Role" +L["Assist"] = "Assist" L["At Least One Enemy"] = "At Least One Enemy" L["At missing Value"] = "At missing Value" L["At Percent"] = "At Percent" @@ -421,6 +422,7 @@ L["Grid"] = "Grid" L["Grobbulus"] = "Grobbulus" L["Group"] = "Group" L["Group Arrangement"] = "Group Arrangement" +L["Group Leader/Assist"] = "Group Leader/Assist" L["Grow"] = "Grow" L["GTFO Alert"] = "GTFO Alert" L["Guardian"] = "Guardian" @@ -524,6 +526,7 @@ L["Kel'Thuzad"] = "Kel'Thuzad" L["Kurinnaxx"] = "Kurinnaxx" L["Large"] = "Large" L["Latency"] = "Latency" +L["Leader"] = "Leader" L["Least remaining time"] = "Least remaining time" L["Leaving"] = "Leaving" L["Leech"] = "Leech" diff --git a/WeakAuras/Locales/esES.lua b/WeakAuras/Locales/esES.lua index 4c3ac32..5d45dd2 100644 --- a/WeakAuras/Locales/esES.lua +++ b/WeakAuras/Locales/esES.lua @@ -133,6 +133,7 @@ L["Array"] = "Array" L["Ascending"] = "Ascendente" --[[Translation missing --]] L["Assigned Role"] = "Assigned Role" +L["Assist"] = "Ayudante" L["At Least One Enemy"] = "Como Mínimo un Enemigo" --[[Translation missing --]] L["At missing Value"] = "At missing Value" @@ -623,6 +624,7 @@ L["Grobbulus"] = "Grobbulus" L["Group"] = "Grupo" --[[Translation missing --]] L["Group Arrangement"] = "Group Arrangement" +L["Group Leader/Assist"] = "Líder/ayudante de grupo" L["Grow"] = "Crecer" L["GTFO Alert"] = "Alerta GTFO" --[[Translation missing --]] @@ -797,6 +799,7 @@ L["Kurinnaxx"] = "Kurinnaxx" L["Large"] = "Large" --[[Translation missing --]] L["Latency"] = "Latency" +L["Leader"] = "Líder" --[[Translation missing --]] L["Least remaining time"] = "Least remaining time" --[[Translation missing --]] diff --git a/WeakAuras/Locales/esMX.lua b/WeakAuras/Locales/esMX.lua index 891c9f3..8271447 100644 --- a/WeakAuras/Locales/esMX.lua +++ b/WeakAuras/Locales/esMX.lua @@ -139,6 +139,7 @@ L["Array"] = "Array" L["Ascending"] = "Ascendente" --[[Translation missing --]] L["Assigned Role"] = "Assigned Role" +L["Assist"] = "Ayudante" L["At Least One Enemy"] = "Mínimo un enemigo" --[[Translation missing --]] L["At missing Value"] = "At missing Value" @@ -605,6 +606,7 @@ L["Grobbulus"] = "Grobbulus" L["Group"] = "Grupo" --[[Translation missing --]] L["Group Arrangement"] = "Group Arrangement" +L["Group Leader/Assist"] = "Líder/ayudante de grupo" L["Grow"] = "Crecer" L["GTFO Alert"] = "Alerta de GTFO" --[[Translation missing --]] @@ -771,6 +773,7 @@ L["Kurinnaxx"] = "Kurinnaxx" L["Large"] = "Large" --[[Translation missing --]] L["Latency"] = "Latency" +L["Leader"] = "Líder" --[[Translation missing --]] L["Least remaining time"] = "Least remaining time" L["Leaving"] = "Abandonar" diff --git a/WeakAuras/Locales/frFR.lua b/WeakAuras/Locales/frFR.lua index 6250a22..e89e281 100644 --- a/WeakAuras/Locales/frFR.lua +++ b/WeakAuras/Locales/frFR.lua @@ -135,6 +135,7 @@ L["Ascending"] = "Croissant" --[[Translation missing --]] L["Assigned Role"] = "Assigned Role" L["At Least One Enemy"] = "Au moins un ennemi" +L["Assist"] = "Assist" --[[Translation missing --]] L["At missing Value"] = "At missing Value" --[[Translation missing --]] @@ -537,6 +538,8 @@ L["Grid"] = "Grille" L["Grobbulus"] = "Grobbulus" L["Group"] = "Groupe" L["Group Arrangement"] = "Arrangement du Groupe" +--[[Translation missing --]] +L["Group Leader/Assist"] = "Group Leader/Assist" L["Grow"] = "Grandir" L["GTFO Alert"] = "Alerte GTFO" --[[Translation missing --]] @@ -675,6 +678,8 @@ L["Kurinnaxx"] = "Kurinnaxx" L["Large"] = "Large" --[[Translation missing --]] L["Latency"] = "Latency" +--[[Translation missing --]] +L["Leader"] = "Leader" L["Least remaining time"] = "Moins de temps restant" L["Leaving"] = "Quitter" L["Leech"] = "Drain" diff --git a/WeakAuras/Locales/itIT.lua b/WeakAuras/Locales/itIT.lua index ae9ae06..9aff568 100644 --- a/WeakAuras/Locales/itIT.lua +++ b/WeakAuras/Locales/itIT.lua @@ -137,6 +137,7 @@ L["Ascending"] = "Crescente" --[[Translation missing --]] L["Assigned Role"] = "Assigned Role" L["At Least One Enemy"] = "Almeno un nemico" +L["Assist"] = "Assist" --[[Translation missing --]] L["At missing Value"] = "At missing Value" --[[Translation missing --]] @@ -664,6 +665,8 @@ L["Group"] = "Group" --[[Translation missing --]] L["Group Arrangement"] = "Group Arrangement" --[[Translation missing --]] +L["Group Leader/Assist"] = "Group Leader/Assist" +--[[Translation missing --]] L["Grow"] = "Grow" --[[Translation missing --]] L["GTFO Alert"] = "GTFO Alert" @@ -870,6 +873,8 @@ L["Large"] = "Large" --[[Translation missing --]] L["Latency"] = "Latency" --[[Translation missing --]] +L["Leader"] = "Leader" +--[[Translation missing --]] L["Least remaining time"] = "Least remaining time" --[[Translation missing --]] L["Leaving"] = "Leaving" diff --git a/WeakAuras/Locales/koKR.lua b/WeakAuras/Locales/koKR.lua index c0c82b6..4b216d6 100644 --- a/WeakAuras/Locales/koKR.lua +++ b/WeakAuras/Locales/koKR.lua @@ -119,6 +119,7 @@ L["Array"] = "정렬" L["Ascending"] = "오름차순" L["Assigned Role"] = "할당된 역할" L["At Least One Enemy"] = "최소 1명의 적 대상" +L["Assist"] = "부공격대장" --[[Translation missing --]] L["At missing Value"] = "At missing Value" --[[Translation missing --]] @@ -469,6 +470,7 @@ L["Grid"] = "Grid" L["Grobbulus"] = "그라불루스" L["Group"] = "그룹" L["Group Arrangement"] = "그룹 편성" +L["Group Leader/Assist"] = "공격대장/부공격대장" L["Grow"] = "성장" L["GTFO Alert"] = "GTFO 경보" --[[Translation missing --]] @@ -583,6 +585,7 @@ L["Kurinnaxx"] = "쿠린낙스" L["Large"] = "큰" --[[Translation missing --]] L["Latency"] = "Latency" +L["Leader"] = "공격대장" L["Least remaining time"] = "최소 남은 시간" L["Leaving"] = "떠남" L["Leech"] = "마력 흡수" diff --git a/WeakAuras/Locales/ptBR.lua b/WeakAuras/Locales/ptBR.lua index 1d332b9..ad6d34f 100644 --- a/WeakAuras/Locales/ptBR.lua +++ b/WeakAuras/Locales/ptBR.lua @@ -127,6 +127,7 @@ L["Array"] = "Arranjo" L["Ascending"] = "Ascendente" L["Assigned Role"] = "Função Atribuída" L["At Least One Enemy"] = "Pelo Menos Um Inimigo" +L["Assist"] = "Assist" L["At missing Value"] = "No valor ausente" L["At Percent"] = "Na porcentagem" L["At Value"] = "Em valor" @@ -600,6 +601,8 @@ L["Group"] = "Group" --[[Translation missing --]] L["Group Arrangement"] = "Group Arrangement" --[[Translation missing --]] +L["Group Leader/Assist"] = "Group Leader/Assist" +--[[Translation missing --]] L["Grow"] = "Grow" --[[Translation missing --]] L["GTFO Alert"] = "GTFO Alert" @@ -803,6 +806,8 @@ L["Large"] = "Large" --[[Translation missing --]] L["Latency"] = "Latency" --[[Translation missing --]] +L["Leader"] = "Leader" +--[[Translation missing --]] L["Least remaining time"] = "Least remaining time" --[[Translation missing --]] L["Leaving"] = "Leaving" diff --git a/WeakAuras/Locales/ruRU.lua b/WeakAuras/Locales/ruRU.lua index 2ffadfd..97b834c 100644 --- a/WeakAuras/Locales/ruRU.lua +++ b/WeakAuras/Locales/ruRU.lua @@ -151,6 +151,7 @@ L["Array"] = "Массив" L["Ascending"] = "По возрастанию" L["Assigned Role"] = "Выбранная роль" L["At Least One Enemy"] = "Хотя бы один противник" +L["Assist"] = "Помощник" L["At missing Value"] = "От недостающего значения" L["At Percent"] = "В процентах" L["At Value"] = "От значения" @@ -479,6 +480,7 @@ L["Grid"] = "Сетка" L["Grobbulus"] = "Гроббулус" L["Group"] = "Группа" L["Group Arrangement"] = "Порядок и позиции индикаций в группе" +L["Group Leader/Assist"] = "Лидер / Помощник группы" --[[Translation missing --]] L["Group Type"] = "Group Type" L["Grow"] = "Рост" @@ -585,6 +587,7 @@ L["Kel'Thuzad"] = "Кел'Тузад" L["Kurinnaxx"] = "Куриннакс" L["Large"] = "Крупный" L["Latency"] = "Задержка" +L["Leader"] = "Лидер" L["Least remaining time"] = "Наименьшее оставшееся время" L["Leaving"] = "Выход" L["Leech"] = "Похищение" diff --git a/WeakAuras/Locales/zhCN.lua b/WeakAuras/Locales/zhCN.lua index 699ef1b..c0358ee 100644 --- a/WeakAuras/Locales/zhCN.lua +++ b/WeakAuras/Locales/zhCN.lua @@ -113,6 +113,7 @@ L["Armor Rating"] = "护甲等级" L["Array"] = "数组" L["Ascending"] = "升序" L["Assigned Role"] = "团队职责" +L["Assist"] = "团队助理" L["At Least One Enemy"] = "至少一个敌人" L["At missing Value"] = "于缺失值" L["At Percent"] = "于百分比" @@ -417,6 +418,7 @@ L["Grid"] = "表格" L["Grobbulus"] = "格罗布鲁斯" L["Group"] = "群组/队伍" L["Group Arrangement"] = "群组排列" +L["Group Leader/Assist"] = "团队领袖/助理" L["Grow"] = "生长" L["GTFO Alert"] = "GTFO 警报" L["Guardian"] = "守护者" @@ -520,6 +522,7 @@ L["Kel'Thuzad"] = "克尔苏加德" L["Kurinnaxx"] = "库林纳克斯" L["Large"] = "大" L["Latency"] = "延迟" +L["Leader"] = "团队领袖" L["Least remaining time"] = "最小剩余时间" L["Leaving"] = "离开" L["Leech"] = "吸取" diff --git a/WeakAuras/Locales/zhTW.lua b/WeakAuras/Locales/zhTW.lua index 8e51703..0e44dc4 100644 --- a/WeakAuras/Locales/zhTW.lua +++ b/WeakAuras/Locales/zhTW.lua @@ -114,6 +114,7 @@ L["Armor Rating"] = "護甲值分數" L["Array"] = "陣列" L["Ascending"] = "升冪" L["Assigned Role"] = "指派的角色" +L["Assist"] = "助理" L["At Least One Enemy"] = "至少一個敵人" L["At missing Value"] = "在缺少數值" L["At Percent"] = "在百分比" @@ -420,6 +421,7 @@ L["Grid"] = "網格" L["Grobbulus"] = "葛羅巴斯" L["Group"] = "群組" L["Group Arrangement"] = "群組排列" +L["Group Leader/Assist"] = "隊長/助理" L["Grow"] = "延伸" L["GTFO Alert"] = "GTFO 警示" L["Guardian"] = "守護者" @@ -525,6 +527,7 @@ L["Kurinnaxx"] = "庫林納克斯" L["Large"] = "大" --[[Translation missing --]] L["Latency"] = "Latency" +L["Leader"] = "隊長" L["Least remaining time"] = "最小剩餘時間" L["Leaving"] = "離開" L["Leech"] = "吸取" diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index bbea367..31267ed 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -609,6 +609,16 @@ function WeakAuras.ValidateNumericOrPercent(info, val) return true end +function WeakAuras.CheckGroupMemberType(loadSetting, currentFlags) + if loadSetting == "LEADER" then + return bit.band(currentFlags, 1) == 1 + elseif loadSetting == "ASSIST" then + return bit.band(currentFlags, 2) == 2 + else + return currentFlags == 0 + end +end + function WeakAuras.CheckChargesDirection(direction, triggerDirection) return triggerDirection == "CHANGED" or (triggerDirection == "GAINED" and direction > 0) @@ -807,6 +817,14 @@ Private.load_prototype = { optional = true, events = {"VEHICLE_UPDATE", "UNIT_ENTERED_VEHICLE", "UNIT_EXITED_VEHICLE"} }, + { + name = "raid_role", + display = L["Raid Role"], + type = "multiselect", + values = "raid_role_types", + init = "arg", + events = {"PLAYER_ROLES_ASSIGNED"} + }, { name = "ingroup", display = L["Group Type"], @@ -903,6 +921,16 @@ Private.load_prototype = { init = "arg", events = {"PLAYER_LEVEL_UP"} }, + { + name = "group_leader", + display = WeakAuras.newFeatureString .. L["Group Leader/Assist"], + type = "multiselect", + init = "arg", + events = {"PARTY_LEADER_CHANGED", "RAID_ROSTER_UPDATE"}, + values = "group_member_types", + test = "WeakAuras.CheckGroupMemberType(%s, group_leader)", + optional = true, + }, { name = "zone", display = L["Zone Name"], diff --git a/WeakAuras/Types.lua b/WeakAuras/Types.lua index 5ff5f45..47402dc 100644 --- a/WeakAuras/Types.lua +++ b/WeakAuras/Types.lua @@ -1928,6 +1928,18 @@ Private.difficulty_types = { heroic = PLAYER_DIFFICULTY2 } +Private.raid_role_types = { + MAINTANK = "|TInterface\\GroupFrame\\UI-Group-maintankIcon:16:16|t "..MAINTANK, + MAINASSIST = "|TInterface\\GroupFrame\\UI-Group-mainassistIcon:16:16|t "..MAINASSIST, + NONE = L["Other"] +} + +Private.group_member_types = { + LEADER = L["Leader"], + ASSIST = L["Assist"], + NONE = L["None"] +} + Private.classification_types = { worldboss = L["World Boss"], rareelite = L["Rare Elite"], diff --git a/WeakAuras/WeakAuras.lua b/WeakAuras/WeakAuras.lua index d1f3f54..ef66a73 100644 --- a/WeakAuras/WeakAuras.lua +++ b/WeakAuras/WeakAuras.lua @@ -1241,7 +1241,11 @@ local function scanForLoadsImpl(toCheck, event, arg1, ...) local player, realm, zone, subzone = UnitName("player"), GetRealmName(), GetRealZoneText(), GetSubZoneText(); local faction = UnitFactionGroup("player") local zoneId = GetCurrentMapAreaID() - + local raidRole = false; + local raidID = UnitInRaid("player") + if raidID then + raidRole = select(10, GetRaidRosterInfo(raidID + 1)) + end local _, class = UnitClass("player"); local inCombat = UnitAffectingCombat("player") -- or UnitAffectingCombat("pet"); @@ -1250,6 +1254,13 @@ local function scanForLoadsImpl(toCheck, event, arg1, ...) local vehicle = UnitInVehicle("player") or UnitOnTaxi("player") local vehicleUi = UnitHasVehicleUI("player") + local raidMemberType = 0 + if UnitIsPartyLeader("player") then + raidMemberType = raidMemberType + 1 + elseif UnitIsRaidOfficer("player") then + raidMemberType = raidMemberType + 2 + end + local size, difficulty, instanceType = GetInstanceTypeAndSize() local group = WeakAuras.GroupType() @@ -1264,8 +1275,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, group, player, realm, class, faction, playerLevel, zone, zoneId, subzone, size, difficulty); - couldBeLoaded = loadOpt and loadOpt("ScanForLoads_Auras", inCombat, alive, pvp, vehicle, vehicleUi, group, player, realm, class, faction, playerLevel, zone, zoneId, subzone, size, difficulty); + shouldBeLoaded = loadFunc and loadFunc("ScanForLoads_Auras", inCombat, alive, pvp, vehicle, vehicleUi, raidRole, group, player, realm, class, faction, playerLevel, raidMemberType, zone, zoneId, subzone, size, difficulty); + couldBeLoaded = loadOpt and loadOpt("ScanForLoads_Auras", inCombat, alive, pvp, vehicle, vehicleUi, raidRole, group, player, realm, class, faction, playerLevel, raidMemberType, zone, zoneId, subzone, size, difficulty); if(shouldBeLoaded and not loaded[id]) then changed = changed + 1; @@ -1351,6 +1362,7 @@ loadFrame:RegisterEvent("ZONE_CHANGED_NEW_AREA"); loadFrame:RegisterEvent("PLAYER_LEVEL_UP"); loadFrame:RegisterEvent("PLAYER_REGEN_DISABLED"); loadFrame:RegisterEvent("PLAYER_REGEN_ENABLED"); +loadFrame:RegisterEvent("PLAYER_ROLES_ASSIGNED"); loadFrame:RegisterEvent("SPELLS_CHANGED"); loadFrame:RegisterEvent("UNIT_INVENTORY_CHANGED") loadFrame:RegisterEvent("PLAYER_EQUIPMENT_CHANGED") @@ -1358,6 +1370,7 @@ loadFrame:RegisterEvent("PLAYER_DEAD") loadFrame:RegisterEvent("PLAYER_ALIVE") loadFrame:RegisterEvent("PLAYER_UNGHOST") loadFrame:RegisterEvent("PLAYER_FLAGS_CHANGED") +loadFrame:RegisterEvent("PARTY_LEADER_CHANGED") local unitLoadFrame = CreateFrame("FRAME"); WeakAuras.unitLoadFrame = unitLoadFrame;