mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 14:50:13 -05:00
Updated to hide SnD unless we have the SnD ability (which implies Outlaw spec in 7.0)
Theoretically we could reuse this module for Roll the Bones as well, but the nature of its effects makes the duration bar portion difficult and not terribly informative to the user since each of the 6 possible buffs can be activated with different durations depending on when RtB was used.
This commit is contained in:
@ -244,7 +244,7 @@ end
|
|||||||
|
|
||||||
local function SNDGetComboPoints(unit)
|
local function SNDGetComboPoints(unit)
|
||||||
if IceHUD.WowVer >= 60000 then
|
if IceHUD.WowVer >= 60000 then
|
||||||
return UnitPower(unit, 4)
|
return UnitPower(unit, SPELL_POWER_COMBO_POINTS)
|
||||||
elseif IceHUD.WowVer >= 30000 then
|
elseif IceHUD.WowVer >= 30000 then
|
||||||
return GetComboPoints(unit, "target")
|
return GetComboPoints(unit, "target")
|
||||||
else
|
else
|
||||||
@ -252,6 +252,20 @@ local function SNDGetComboPoints(unit)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- use this to figure out if Roll the Bones is available or not. neither IsSpellKnown nor IsPlayerSpell are correct for it
|
||||||
|
-- when SnD is known, but this is.
|
||||||
|
local function HasSpell(id)
|
||||||
|
local spell = GetSpellInfo(id)
|
||||||
|
return spell == GetSpellInfo(spell)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function ShouldHide()
|
||||||
|
return --[[(IceHUD.WowVer < 70000 or not IsSpellKnown(193316)) and]] not IsPlayerSpell(5171) -- IsSpellKnown returns incorrect info for SnD in 7.0
|
||||||
|
-- commented code is here in case we decide we'd like to use this module for Roll the Bones.
|
||||||
|
-- if we do, though, the "active" check gets way more complicated since it can activate any number of 6 different abilities
|
||||||
|
-- with different durations
|
||||||
|
end
|
||||||
|
|
||||||
function SliceAndDice.prototype:UpdateSliceAndDice(event, unit, fromUpdate)
|
function SliceAndDice.prototype:UpdateSliceAndDice(event, unit, fromUpdate)
|
||||||
if unit and unit ~= self.unit then
|
if unit and unit ~= self.unit then
|
||||||
return
|
return
|
||||||
@ -284,12 +298,12 @@ function SliceAndDice.prototype:UpdateSliceAndDice(event, unit, fromUpdate)
|
|||||||
else
|
else
|
||||||
self:UpdateBar(0, "SliceAndDice")
|
self:UpdateBar(0, "SliceAndDice")
|
||||||
|
|
||||||
if SNDGetComboPoints(self.unit) == 0 or (not UnitExists("target") and not self.moduleSettings.bShowWithNoTarget) then
|
if SNDGetComboPoints(self.unit) == 0 or (not UnitExists("target") and not self.moduleSettings.bShowWithNoTarget) or ShouldHide() then
|
||||||
if self.bIsVisible then
|
if self.bIsVisible then
|
||||||
self.bUpdateSnd = nil
|
self.bUpdateSnd = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
if not self.moduleSettings.alwaysFullAlpha then
|
if not self.moduleSettings.alwaysFullAlpha or ShouldHide() then
|
||||||
self:Show(false)
|
self:Show(false)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -329,7 +343,8 @@ function SliceAndDice.prototype:UpdateDurationBar(event, unit)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- player doesn't want to show the percent of max or the alpha is zeroed out, so don't bother with the duration bar
|
-- player doesn't want to show the percent of max or the alpha is zeroed out, so don't bother with the duration bar
|
||||||
if not self.moduleSettings.showAsPercentOfMax or self.moduleSettings.durationAlpha == 0 or (points == 0 and not self:IsVisible()) then
|
if not self.moduleSettings.showAsPercentOfMax or self.moduleSettings.durationAlpha == 0 or (points == 0 and not self:IsVisible())
|
||||||
|
or ShouldHide() then
|
||||||
self.durationFrame:Hide()
|
self.durationFrame:Hide()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user