Convert a few more checks into feature flags

This commit is contained in:
Parnic
2022-09-08 19:41:03 -05:00
parent f04c5db493
commit c804ba178b
4 changed files with 6 additions and 6 deletions

View File

@ -190,6 +190,6 @@ function EclipseBar.prototype:MyOnUpdate()
end
local _, unitClass = UnitClass("player")
if (unitClass == "DRUID" and IceHUD.WowVer >= 40000 and IceHUD.WowVer < 70000) then
if (unitClass == "DRUID" and GetEclipseDirection) then
IceHUD.EclipseBar = EclipseBar:new()
end

View File

@ -367,7 +367,7 @@ function PlayerHealth.prototype:GetOptions()
self:Update()
end,
disabled = function()
return not (self.moduleSettings.enabled and IceHUD.WowVer >= 70000)
return not (self.moduleSettings.enabled and UnitGetTotalAbsorbs)
end,
order = 43.8
}
@ -954,7 +954,7 @@ function PlayerHealth.prototype:CreateAbsorbBar()
self:UpdateBar(1, "undef")
if not self.moduleSettings.showAbsorbs or UnitGetTotalAbsorbs == nil then
if not self.moduleSettings.showAbsorbs or not UnitGetTotalAbsorbs then
self.absorbFrame.bar:Hide()
end
end

View File

@ -79,7 +79,7 @@ end
-- Load for tanks only
local _, unitClass = UnitClass("player")
if ((unitClass == "DEATHKNIGHT" or unitClass == "DRUID" or unitClass == "PALADIN" or unitClass == "WARRIOR" or unitClass == "MONK")
and IceHUD.WowVer >= 60000 and IceHUD.WowVer < 70000) then
if (unitClass == "DEATHKNIGHT" or unitClass == "DRUID" or unitClass == "PALADIN" or unitClass == "WARRIOR" or unitClass == "MONK")
and GetSpellInfo(RESOLVE_SPELL_ID) then
IceHUD.Resolve = Resolve:new()
end

View File

@ -15,7 +15,7 @@ local RUNETYPE_CHROMATIC = 4;
local RUNETYPE_LEGION = 5; -- not real, but makes for an easy update
local GetRuneType = GetRuneType
if IceHUD.WowVer >= 70000 and IceHUD.WowVer < 70300 and RUNETYPE_LEGION then
if IceHUD.WowVer >= 70000 and IceHUD.WowVer < 70300 then
GetRuneType = function() return RUNETYPE_LEGION end
elseif IceHUD.WowVer >= 70300 and GetSpecialization then
GetRuneType = function() return GetSpecialization() end