unrestrict nameplate units, we dont have restrictions with awesomewotlk
This commit is contained in:
@@ -115,11 +115,7 @@ WeakAuras.HideOverlayGlow = LCG.ButtonGlow_Stop
|
||||
|
||||
local LGF = LibStub("LibGetFrame-1.0")
|
||||
WeakAuras.GetUnitFrame = LGF.GetUnitFrame
|
||||
WeakAuras.GetNamePlateForUnit = function(unit)
|
||||
if Private.multiUnitUnits.nameplate[unit] then
|
||||
return LGF.GetUnitNameplate(unit)
|
||||
end
|
||||
end
|
||||
WeakAuras.GetNamePlateForUnit = LGF.GetUnitNameplate
|
||||
|
||||
local blockedFunctions = {
|
||||
-- Lua functions that may allow breaking out of the environment
|
||||
|
||||
@@ -282,7 +282,8 @@ local function CreateTestForCondition(uid, input, allConditionsTemplate, usedSta
|
||||
local found = 0
|
||||
local op = %q
|
||||
local range = %s
|
||||
for i = 1, 40 do
|
||||
local max = C_NamePlate and C_NamePlate.GetNamePlates and #C_NamePlate.GetNamePlates or 40
|
||||
for i = 1, max do
|
||||
local unit = "nameplate" .. i
|
||||
if UnitExists(unit) and UnitCanAttack("player", unit) and WeakAuras.CheckRange(unit, range, op) then
|
||||
found = found + 1
|
||||
|
||||
@@ -995,7 +995,8 @@ local function MultiUnitLoop(Func, unit, includePets, ...)
|
||||
Func(unit..i, ...)
|
||||
end
|
||||
elseif unit == "nameplate" then
|
||||
for i = 1, 40 do
|
||||
local max = C_NamePlate and C_NamePlate.GetNamePlates and #C_NamePlate.GetNamePlates or 40
|
||||
for i = 1, max do
|
||||
Func(unit..i, ...)
|
||||
end
|
||||
elseif unit == "group" then
|
||||
|
||||
+2
-2
@@ -2677,8 +2677,8 @@ end
|
||||
for i = 1, 40 do
|
||||
Private.baseUnitId["raid"..i] = true
|
||||
Private.baseUnitId["raidpet"..i] = true
|
||||
Private.baseUnitId["nameplate"..i] = true
|
||||
Private.multiUnitUnits.nameplate["nameplate"..i] = true
|
||||
--Private.baseUnitId["nameplate"..i] = true -- no need to restrict it, blizzard only allows 40 nameplates, we can get all.
|
||||
--Private.multiUnitUnits.nameplate["nameplate"..i] = true -- no need to restrict it, blizzard only allows 40 nameplates, we can get all.
|
||||
Private.multiUnitUnits.group["raid"..i] = true
|
||||
Private.multiUnitUnits.raid["raid"..i] = true
|
||||
Private.multiUnitUnits.group["raidpet"..i] = true
|
||||
|
||||
@@ -4655,11 +4655,10 @@ do
|
||||
for i = 1, 40 do
|
||||
trackableUnits["raid" .. i] = true
|
||||
trackableUnits["raidpet" .. i] = true
|
||||
trackableUnits["nameplate" .. i] = true
|
||||
end
|
||||
|
||||
function WeakAuras.UntrackableUnit(unit)
|
||||
return not trackableUnits[unit]
|
||||
return not (trackableUnits[unit] or string.match(unit, "^nameplate%d+$"))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ local function GetCustomTriggerOptions(data, triggernum)
|
||||
end
|
||||
elseif trueEvent:match("^UNIT_") then
|
||||
local unit = string.lower(i)
|
||||
if not OptionsPrivate.Private.baseUnitId[unit] and not OptionsPrivate.Private.multiUnitId[unit] then
|
||||
if not (OptionsPrivate.Private.baseUnitId[unit] or string.find(unit, "^nameplate%d+$")) and not OptionsPrivate.Private.multiUnitId[unit] then
|
||||
return "|cFFFF0000"..L["Unit %s is not a valid unit for RegisterUnitEvent"]:format(unit)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user