Commit 680650ab authored by NihilisticPandemonium's avatar NihilisticPandemonium

Player Can Attack/Player Can Not Attack Style Filter unit conditions.

parent 84318d06
### Version 11.19 [ ]
**New Additions:**
Added Player Can Attack and Player Can Not Attack unit conditions to Nameplate Style Filters.
**Bug Fixes:**
......
......@@ -31,6 +31,7 @@ local UnitLevel = UnitLevel
local UnitPower = UnitPower
local UnitPowerMax = UnitPowerMax
local UnitThreatSituation = UnitThreatSituation
local UnitCanAttack = UnitCanAttack
local hooksecurefunc = hooksecurefunc
local C_Timer_NewTimer = C_Timer.NewTimer
......@@ -697,6 +698,12 @@ function mod:StyleFilterConditionCheck(frame, filter, trigger)
if (trigger.inVehicleUnit and frame.inVehicle) or (trigger.outOfVehicleUnit and not frame.inVehicle) then passed = true else return end
end
-- Player Can Attack
if trigger.playerCanAttack or trigger.playerCanNotAttack then
local canAttack = UnitCanAttack("player", frame.unit)
if (trigger.playerCanAttack and canAttack) or (trigger.playerCanNotAttack and not canAttack) then passed = true else return end
end
-- Classification
if trigger.classification.worldboss or trigger.classification.rareelite or trigger.classification.elite or trigger.classification.rare or trigger.classification.normal or trigger.classification.trivial or trigger.classification.minus then
if trigger.classification[frame.classification] then passed = true else return end
......
......@@ -255,6 +255,8 @@ E.StyleFilterDefaults = {
isNotPvP = false,
isTapDenied = false,
isNotTapDenied = false,
playerCanAttack = false,
playerCanNotAttack = false,
-- combat
inCombat = false,
outOfCombat = false,
......
......@@ -600,6 +600,8 @@ L["If enabled then the filter will only activate if the level of the unit matche
L["If enabled then the filter will only activate if the unit is casting interruptible spells."] = "Wenn eingeschaltet, wird der Filter nur aktiviert wenn die Einheit einen unterbrechbaren Zauber wirkt."
L["If enabled then the filter will only activate if the unit is casting not interruptible spells."] = "Wenn eingeschaltet, wird der Filter nur aktiviert wenn die Einheit einen nicht unterbrechbaren Zauber wirkt."
L["If enabled then the filter will only activate if the unit is not casting or channeling one of the selected spells."] = "Wenn eingeschaltet, wird der Filter nur aktiviert wenn die Einheit nicht am Zaubern oder Kanalisieren vom ausgwähltem Zauber ist."
L["If enabled then the filter will only activate when the unit can be atacked by the active player."] = true
L["If enabled then the filter will only activate when the unit can not be atacked by the active player."] = true
L["If enabled then the filter will only activate when the unit is a player's pet."] = "Wenn eingeschaltet, wird der Filter nur aktiviert wenn die Einheit ein Spieler Begleiter ist."
L["If enabled then the filter will only activate when the unit is not a player's pet."] = "Wenn eingeschaltet, wird der Filter nur aktiviert wenn die Einheit kein Spieler Begleiter ist."
L["If enabled then the filter will only activate when the unit is controlled by the player."] = "Wenn eingeschaltet, wird der Filter nur aktiviert wenn die Einheit vom Spieler kontrolliert wird."
......@@ -874,6 +876,8 @@ L["Pets"] = "Begleiter"
L["PetTarget"] = "Begleiter Ziel"
L["Phase Indicator"] = "Phasen Indikator"
L["Pin Voice Buttons"] = "Pin Sprachtasten"
L["Player Can Attack"] = true
L["Player Can Not Attack"] = true
L["Player Frame Aura Bars"] = "Spielerfenster Aurenleiste"
L["Player Health"] = "Spieler Gesundheit"
L["Player in Combat"] = "Spieler im Kampf"
......
......@@ -601,6 +601,8 @@ L["If enabled then the filter will only activate if the level of the unit matche
L["If enabled then the filter will only activate if the unit is casting interruptible spells."] = true
L["If enabled then the filter will only activate if the unit is casting not interruptible spells."] = true
L["If enabled then the filter will only activate if the unit is not casting or channeling one of the selected spells."] = true
L["If enabled then the filter will only activate when the unit can be atacked by the active player."] = true
L["If enabled then the filter will only activate when the unit can not be atacked by the active player."] = true
L["If enabled then the filter will only activate when the unit is a player's pet."] = true
L["If enabled then the filter will only activate when the unit is not a player's pet."] = true
L["If enabled then the filter will only activate when the unit is controlled by the player."] = true
......@@ -876,6 +878,8 @@ L["Pets"] = true
L["PetTarget"] = true
L["Phase Indicator"] = true
L["Pin Voice Buttons"] = true
L["Player Can Attack"] = true
L["Player Can Not Attack"] = true
L["Player Frame Aura Bars"] = true
L["Player Health"] = true
L["Player in Combat"] = true
......
......@@ -597,6 +597,8 @@ L["If enabled then the filter will only activate if the level of the unit matche
L["If enabled then the filter will only activate if the unit is casting interruptible spells."] = true
L["If enabled then the filter will only activate if the unit is casting not interruptible spells."] = true
L["If enabled then the filter will only activate if the unit is not casting or channeling one of the selected spells."] = true
L["If enabled then the filter will only activate when the unit can be atacked by the active player."] = true
L["If enabled then the filter will only activate when the unit can not be atacked by the active player."] = true
L["If enabled then the filter will only activate when the unit is a player's pet."] = true
L["If enabled then the filter will only activate when the unit is not a player's pet."] = true
L["If enabled then the filter will only activate when the unit is controlled by the player."] = true
......@@ -871,6 +873,8 @@ L["Pets"] = true
L["PetTarget"] = true
L["Phase Indicator"] = true
L["Pin Voice Buttons"] = true
L["Player Can Attack"] = true
L["Player Can Not Attack"] = true
L["Player Frame Aura Bars"] = true
L["Player Health"] = true
L["Player in Combat"] = true
......
......@@ -598,6 +598,8 @@ L["If enabled then the filter will only activate if the level of the unit matche
L["If enabled then the filter will only activate if the unit is casting interruptible spells."] = true
L["If enabled then the filter will only activate if the unit is casting not interruptible spells."] = true
L["If enabled then the filter will only activate if the unit is not casting or channeling one of the selected spells."] = true
L["If enabled then the filter will only activate when the unit can be atacked by the active player."] = true
L["If enabled then the filter will only activate when the unit can not be atacked by the active player."] = true
L["If enabled then the filter will only activate when the unit is a player's pet."] = true
L["If enabled then the filter will only activate when the unit is not a player's pet."] = true
L["If enabled then the filter will only activate when the unit is controlled by the player."] = true
......@@ -872,6 +874,8 @@ L["Pets"] = true
L["PetTarget"] = true
L["Phase Indicator"] = true
L["Pin Voice Buttons"] = true
L["Player Can Attack"] = true
L["Player Can Not Attack"] = true
L["Player Frame Aura Bars"] = "Barre d'aura du joueur"
L["Player Health"] = true
L["Player in Combat"] = "Joueur en combat"
......
......@@ -597,6 +597,8 @@ L["If enabled then the filter will only activate if the level of the unit matche
L["If enabled then the filter will only activate if the unit is casting interruptible spells."] = "활성화하면 유닛이 차단 가능한 주문을 시전하고 있을 경우에만 필터가 작동합니다."
L["If enabled then the filter will only activate if the unit is casting not interruptible spells."] = "활성화하면 유닛이 차단 불가능한 주문을 시전하고 있을 경우에만 필터가 작동합니다."
L["If enabled then the filter will only activate if the unit is not casting or channeling one of the selected spells."] = true
L["If enabled then the filter will only activate when the unit can be atacked by the active player."] = true
L["If enabled then the filter will only activate when the unit can not be atacked by the active player."] = true
L["If enabled then the filter will only activate when the unit is a player's pet."] = true
L["If enabled then the filter will only activate when the unit is not a player's pet."] = true
L["If enabled then the filter will only activate when the unit is controlled by the player."] = true
......@@ -871,6 +873,8 @@ L["Pets"] = true
L["PetTarget"] = true
L["Phase Indicator"] = "단계 표시기"
L["Pin Voice Buttons"] = true
L["Player Can Attack"] = true
L["Player Can Not Attack"] = true
L["Player Frame Aura Bars"] = true
L["Player Health"] = "플레이어 생명력"
L["Player in Combat"] = "플레이어 전투중"
......
......@@ -598,6 +598,8 @@ L["If enabled then the filter will only activate if the level of the unit matche
L["If enabled then the filter will only activate if the unit is casting interruptible spells."] = true
L["If enabled then the filter will only activate if the unit is casting not interruptible spells."] = true
L["If enabled then the filter will only activate if the unit is not casting or channeling one of the selected spells."] = true
L["If enabled then the filter will only activate when the unit can be atacked by the active player."] = true
L["If enabled then the filter will only activate when the unit can not be atacked by the active player."] = true
L["If enabled then the filter will only activate when the unit is a player's pet."] = true
L["If enabled then the filter will only activate when the unit is not a player's pet."] = true
L["If enabled then the filter will only activate when the unit is controlled by the player."] = true
......@@ -872,6 +874,8 @@ L["Pets"] = true
L["PetTarget"] = true
L["Phase Indicator"] = true
L["Pin Voice Buttons"] = true
L["Player Can Attack"] = true
L["Player Can Not Attack"] = true
L["Player Frame Aura Bars"] = true
L["Player Health"] = true
L["Player in Combat"] = true
......
......@@ -597,6 +597,8 @@ L["If enabled then the filter will only activate if the level of the unit matche
L["If enabled then the filter will only activate if the unit is casting interruptible spells."] = "Если включено, то фильтр будет активирован, когда юнит произносит прерываемое заклинание."
L["If enabled then the filter will only activate if the unit is casting not interruptible spells."] = "Если включено, то фильтр будет активирован, когда юнит произносит не прерываемое заклинание."
L["If enabled then the filter will only activate if the unit is not casting or channeling one of the selected spells."] = "Если включено, то фильтр будет активирован, когда юнит не произносит или поддерживает одно из выбранных заклинаний."
L["If enabled then the filter will only activate when the unit can be atacked by the active player."] = true
L["If enabled then the filter will only activate when the unit can not be atacked by the active player."] = true
L["If enabled then the filter will only activate when the unit is a player's pet."] = "Если включено, то фильтр будет активирован, когда юнит является питомцем игрока."
L["If enabled then the filter will only activate when the unit is not a player's pet."] = "Если включено, то фильтр будет активирован, когда юнит не является питомцем игрока."
L["If enabled then the filter will only activate when the unit is controlled by the player."] = "Если включено, то фильтр будет активирован, когда юнит под контролем игрока."
......@@ -871,6 +873,8 @@ L["Pets"] = "Питомцы"
L["PetTarget"] = "Цель питомца"
L["Phase Indicator"] = "Индикатор фазы"
L["Pin Voice Buttons"] = "Закрепить голосовой чат"
L["Player Can Attack"] = true
L["Player Can Not Attack"] = true
L["Player Frame Aura Bars"] = "Полосы аур рамки игрока"
L["Player Health"] = "Здоровье игрока"
L["Player in Combat"] = "Игрок в бою"
......
......@@ -599,6 +599,8 @@ L["If enabled then the filter will only activate if the level of the unit matche
L["If enabled then the filter will only activate if the unit is casting interruptible spells."] = "启用后过滤器仅在单位施放可打断技能的时候激活."
L["If enabled then the filter will only activate if the unit is casting not interruptible spells."] = "启用后过滤器仅在单位施放不可打断技能的时候激活."
L["If enabled then the filter will only activate if the unit is not casting or channeling one of the selected spells."] = "启用后过滤器仅在单位未施放或引导任一勾选的技能时激活."
L["If enabled then the filter will only activate when the unit can be atacked by the active player."] = true
L["If enabled then the filter will only activate when the unit can not be atacked by the active player."] = true
L["If enabled then the filter will only activate when the unit is a player's pet."] = true
L["If enabled then the filter will only activate when the unit is not a player's pet."] = true
L["If enabled then the filter will only activate when the unit is controlled by the player."] = true
......@@ -873,6 +875,8 @@ L["Pets"] = "宠物"
L["PetTarget"] = "宠物的目标"
L["Phase Indicator"] = "位面指示器"
L["Pin Voice Buttons"] = "固定语音按钮"
L["Player Can Attack"] = true
L["Player Can Not Attack"] = true
L["Player Frame Aura Bars"] = "玩家框架光环条"
L["Player Health"] = "玩家血量"
L["Player in Combat"] = "玩家在战斗中"
......
......@@ -599,6 +599,8 @@ L["If enabled then the filter will only activate if the level of the unit matche
L["If enabled then the filter will only activate if the unit is casting interruptible spells."] = "如果選中則過濾器只會在單位施放可打斷技能的時候啟動"
L["If enabled then the filter will only activate if the unit is casting not interruptible spells."] = "如果選中則過濾器只會在單位施放不可打斷技能的時候啟動"
L["If enabled then the filter will only activate if the unit is not casting or channeling one of the selected spells."] = true
L["If enabled then the filter will only activate when the unit can be atacked by the active player."] = true
L["If enabled then the filter will only activate when the unit can not be atacked by the active player."] = true
L["If enabled then the filter will only activate when the unit is a player's pet."] = true
L["If enabled then the filter will only activate when the unit is not a player's pet."] = true
L["If enabled then the filter will only activate when the unit is controlled by the player."] = true
......@@ -873,6 +875,8 @@ L["Pets"] = "寵物"
L["PetTarget"] = "寵物目標"
L["Phase Indicator"] = "位面指示器"
L["Pin Voice Buttons"] = "釘住語音按鈕"
L["Player Can Attack"] = true
L["Player Can Not Attack"] = true
L["Player Frame Aura Bars"] = "玩家框架光環條"
L["Player Health"] = "玩家血量"
L["Player in Combat"] = "玩家戰鬥中"
......
......@@ -1222,7 +1222,19 @@ local function UpdateFilterGroup()
name = L["Unit is Not Tap Denied"],
desc = L["If enabled then the filter will only activate when the unit is not tap denied."],
order = 21
}
},
playerCanAttack = {
type = "toggle",
name = L["Player Can Attack"],
desc = L["If enabled then the filter will only activate when the unit can be atacked by the active player."],
order = 22
},
playerCanNotAttack = {
type = "toggle",
name = L["Player Can Not Attack"],
desc = L["If enabled then the filter will only activate when the unit can not be atacked by the active player."],
order = 23
},
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment