Skip to content

Commit 44e05b4

Browse files
committed
Update Ranged for Retail
1 parent 56a889b commit 44e05b4

File tree

7 files changed

+44
-12
lines changed

7 files changed

+44
-12
lines changed

Frame.lua

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,16 @@ local COORDS_FULL = { left = 0, right = 1, top = 0, bottom = 1 }
229229

230230
function PlexusFrame.prototype:SetIndicator(id, color, text, value, maxValue, texture, start, duration, count, texCoords, expirationTime)
231231

232+
if type(value) == "boolean" and id ~= "frameAlpha" then
233+
return
234+
end
232235
if not color then
233236
color = COLOR_WHITE
234237
end
235-
if value and not maxValue then
236-
maxValue = 100
238+
if not Plexus:issecretvalue(value) then
239+
if value and not maxValue then
240+
maxValue = 100
241+
end
237242
end
238243
if texture and not texCoords then
239244
texCoords = COORDS_FULL

Indicators/AbsorbBar.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ local function Reset(self) -- luacheck: ignore 432
9898
end
9999

100100
local function SetStatus(self, color, _, value, maxValue, _, _, _, start, duration) -- luacheck: ignore 432
101+
if type(value) ~= "number" then
102+
return
103+
end
101104
local profile = PlexusFrame.db.profile
102105

103106
if profile.ExtraBarTrackDuration and type(duration) == "number" and duration > 0 and type(start) == "number" and start > 0 then --luacheck: ignore 631

Indicators/Alpha.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@ PlexusFrame:RegisterIndicator("frameAlpha", L["Frame Alpha"],
1919
nil,
2020

2121
-- SetStatus
22-
function(self, color)
22+
function(self, color, _, value)
2323
if not color then return end
2424

2525
local frame = self.__owner
26-
frame:SetAlpha(color.a or 1)
26+
if Plexus:IsRetailWow() and type(value) == "boolean" then
27+
frame:SetAlphaFromBoolean(value, 1, 0.3)
28+
else
29+
frame:SetAlpha(color.a or 1)
30+
end
2731
end,
2832

2933
-- ClearStatus

Indicators/HealingAbsorbBar.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ local function Reset(self) -- luacheck: ignore 432
100100
end
101101

102102
local function SetStatus(self, color, _, value, maxValue, _, _, _, start, duration) -- luacheck: ignore 432
103-
local profile = PlexusFrame.db.profile
103+
if type(value) ~= "number" then
104+
return
105+
end
106+
local profile = PlexusFrame.db.profile
104107

105108
if profile.ExtraBarTrackDuration and type(duration) == "number" and duration > 0 and type(start) == "number" and start > 0 then --luacheck: ignore 631
106109
self.ProcessingDuration = true

Indicators/HealingBar.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ PlexusFrame:RegisterIndicator("healingBar", L["Healing Bar"],
5757

5858
-- SetStatus
5959
function(self, color, _, value, maxValue)
60+
if type(value) ~= "number" then
61+
return
62+
end
6063
if not Plexus:issecretvalue(value) then
6164
if not value or not maxValue or value == 0 or maxValue == 0 then
6265
return self:Hide()

Indicators/IncomingHealingBar.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ local function Reset(self) -- luacheck: ignore 432
9696
end
9797

9898
local function SetStatus(self, color, _, value, maxValue, _, _, _, start, duration) -- luacheck: ignore 432
99-
local profile = PlexusFrame.db.profile
99+
if type(value) ~= "number" then
100+
return
101+
end
102+
local profile = PlexusFrame.db.profile
100103

101104
if profile.ExtraBarTrackDuration and type(duration) == "number" and duration > 0 and type(start) == "number" and start > 0 then --luacheck: ignore 631
102105
self.ProcessingDuration = true

Statuses/Range.lua

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ local function GroupRangeCheck(_, unit)
206206
local inRange, checkedRange = UnitInRange(unit)
207207
if not Plexus:issecretvalue(checkedRange) and checkedRange then
208208
return inRange
209+
elseif Plexus:IsRetailWow() then
210+
return inRange
209211
elseif Plexus:issecretvalue(checkedRange) then
210212
inRange = getFriendly() and IsSpellInRange(getFriendly(), unit)
211213
if inRange == nil then
@@ -223,14 +225,23 @@ PlexusStatusRange.UnitInRange = GroupRangeCheck
223225
function PlexusStatusRange:CheckRange()
224226
local settings = self.db.profile.alert_range
225227
for guid, unit in PlexusRoster:IterateRoster() do
226-
if self:UnitInRange(unit) then
227-
self.core:SendStatusLost(guid, "alert_range")
228-
else
228+
if Plexus:IsRetailWow() then
229229
self.core:SendStatusGained(guid, "alert_range",
230230
settings.priority,
231-
false,
232-
settings.color,
233-
settings.text)
231+
nil,
232+
nil,
233+
nil,
234+
self:UnitInRange(unit))
235+
else
236+
if self:UnitInRange(unit) then
237+
self.core:SendStatusLost(guid, "alert_range")
238+
else
239+
self.core:SendStatusGained(guid, "alert_range",
240+
settings.priority,
241+
false,
242+
settings.color,
243+
settings.text)
244+
end
234245
end
235246
end
236247
end

0 commit comments

Comments
 (0)