Skip to content

Commit 5c772fc

Browse files
committed
[Frame] Change Defaults and Don't Register Statuses Were They Don't Apply
1 parent 27f228e commit 5c772fc

File tree

1 file changed

+56
-21
lines changed

1 file changed

+56
-21
lines changed

Frame.lua

Lines changed: 56 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,19 @@ PlexusFrame.defaultDB = {
411411
PrivateAuraOffsetY = 0,
412412
}
413413

414+
if Plexus:IsRetailWow() then
415+
PlexusFrame.defaultDB.statusmap.healingBar = {
416+
alert_heals = false,
417+
alert_absorbs = false,
418+
}
419+
PlexusFrame.defaultDB.statusmap.ei_bar_bartwo = {
420+
alert_absorbs = true,
421+
}
422+
PlexusFrame.defaultDB.statusmap.ei_bar_barfour = {
423+
alert_heals = true,
424+
}
425+
end
426+
414427
------------------------------------------------------------------------
415428

416429
local reloadHandle
@@ -1787,6 +1800,20 @@ local IconNames = {
17871800
["ei_icon_right4"] = true,
17881801
}
17891802

1803+
local noIconStatuses = {
1804+
["afk"] = true,
1805+
["unit_altpower"] = true,
1806+
["groupnumber"] = true,
1807+
["alert_heal_absorbs"] = true,
1808+
["alert_heals"] = true,
1809+
["unit_health"] = true,
1810+
["alert_lowMana"] = true,
1811+
["mouseover"] = true,
1812+
["alert_me"] = true,
1813+
["alert_range"] = true,
1814+
["unit_resource"] = true,
1815+
}
1816+
17901817

17911818
function PlexusFrame:StatusForIndicator(_, guid, indicator)
17921819
local topPriority = 0
@@ -1992,27 +2019,35 @@ function PlexusFrame:UpdateOptionsForIndicator(indicator, name, order)
19922019

19932020
-- create entry for each registered status
19942021
for status, _, descr in PlexusStatus:RegisteredStatusIterator() do
1995-
-- needs to be local for the get/set closures
1996-
local indicatorType = indicator
1997-
local statusKey = status
1998-
1999-
self:Debug(indicator.type, status)
2000-
2001-
if not indicatorMenu[status] then
2002-
indicatorMenu[status] = {
2003-
name = descr,
2004-
desc = L["Toggle status display."],
2005-
width = "double",
2006-
type = "toggle",
2007-
get = function()
2008-
return PlexusFrame.db.profile.statusmap[indicatorType][statusKey]
2009-
end,
2010-
set = function(info, v) --luacheck: ignore 212
2011-
PlexusFrame.db.profile.statusmap[indicatorType][statusKey] = v
2012-
PlexusFrame:UpdateAllFrames()
2013-
end,
2014-
}
2015-
self:Debug("Added", indicator.type, status)
2022+
if (Plexus:IsRetailWow() and not ( (indicator == "healingBar" and (status == "alert_heals" or status == "alert_absorbs" or status == "alert_heal_absorbs")) or (IconNames[indicator] and noIconStatuses[status] ) )
2023+
or (not Plexus:IsRetailWow() and not (IconNames[indicator] and noIconStatuses[status]))
2024+
) then
2025+
-- needs to be local for the get/set closures
2026+
local indicatorType = indicator
2027+
local statusKey = status
2028+
2029+
self:Debug(indicator, status)
2030+
2031+
if not indicatorMenu[status] then
2032+
indicatorMenu[status] = {
2033+
name = descr,
2034+
desc = L["Toggle status display."],
2035+
width = "double",
2036+
type = "toggle",
2037+
get = function()
2038+
return PlexusFrame.db.profile.statusmap[indicatorType][statusKey]
2039+
end,
2040+
set = function(info, v) --luacheck: ignore 212
2041+
PlexusFrame.db.profile.statusmap[indicatorType][statusKey] = v
2042+
PlexusFrame:UpdateAllFrames()
2043+
end,
2044+
}
2045+
self:Debug("Added", indicator, status)
2046+
end
2047+
else
2048+
if Plexus:IsRetailWow() and PlexusFrame.db.profile.statusmap[indicator] and PlexusFrame.db.profile.statusmap[indicator][status] then
2049+
PlexusFrame.db.profile.statusmap[indicator][status] = nil
2050+
end
20162051
end
20172052
end
20182053
end

0 commit comments

Comments
 (0)