mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 14:50:13 -05:00
- super temp hax to make the custom cd bar work with "Holy Word: Aspire". none of the spell api functions work when that spell is passed by name but they do work with the spell id, so i built a table of names => ids that gets checked before calling any api's
This commit is contained in:
@ -12,7 +12,9 @@ IceCustomCDBar.prototype.cooldownDuration = 0
|
|||||||
IceCustomCDBar.prototype.cooldownEndTime = 0
|
IceCustomCDBar.prototype.cooldownEndTime = 0
|
||||||
IceCustomCDBar.prototype.coolingDown = false
|
IceCustomCDBar.prototype.coolingDown = false
|
||||||
|
|
||||||
|
-- super temp...remove this when blizzard fixes these spells to work by name with GetSpellCooldown()
|
||||||
|
local brokenSpellsNameToId = {}
|
||||||
|
table.insert(brokenSpellsNameToId, {"Holy Word: Aspire",88682})
|
||||||
|
|
||||||
-- Constructor --
|
-- Constructor --
|
||||||
function IceCustomCDBar.prototype:init()
|
function IceCustomCDBar.prototype:init()
|
||||||
@ -385,6 +387,8 @@ end
|
|||||||
-- 'Protected' methods --------------------------------------------------------
|
-- 'Protected' methods --------------------------------------------------------
|
||||||
|
|
||||||
function IceCustomCDBar.prototype:GetCooldownDuration(buffName)
|
function IceCustomCDBar.prototype:GetCooldownDuration(buffName)
|
||||||
|
buffName = self:GetSpellNameOrId(buffName)
|
||||||
|
|
||||||
local now = GetTime()
|
local now = GetTime()
|
||||||
local localDuration = nil
|
local localDuration = nil
|
||||||
local localStart, localRemaining, hasCooldown = GetSpellCooldown(buffName)
|
local localStart, localRemaining, hasCooldown = GetSpellCooldown(buffName)
|
||||||
@ -551,10 +555,11 @@ end
|
|||||||
|
|
||||||
function IceCustomCDBar.prototype:IsReady()
|
function IceCustomCDBar.prototype:IsReady()
|
||||||
local is_ready = nil
|
local is_ready = nil
|
||||||
|
local checkSpell = self:GetSpellNameOrId(self.moduleSettings.cooldownToTrack)
|
||||||
|
|
||||||
if (IsUsableSpell(self.moduleSettings.cooldownToTrack) == 1) then
|
if (IsUsableSpell(checkSpell) == 1) then
|
||||||
if SpellHasRange(self.moduleSettings.cooldownToTrack) then
|
if SpellHasRange(checkSpell) then
|
||||||
if (UnitExists("target") and IsSpellInRange(self.moduleSettings.cooldownToTrack, "target") == 1) then
|
if (UnitExists("target") and IsSpellInRange(checkSpell, "target") == 1) then
|
||||||
is_ready = 1
|
is_ready = 1
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -565,6 +570,18 @@ function IceCustomCDBar.prototype:IsReady()
|
|||||||
return is_ready
|
return is_ready
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function IceCustomCDBar.prototype:GetSpellNameOrId(spellName)
|
||||||
|
-- super temp hax. certain spells (the new 'morphing' spells) do not work by name with GetSpellCooldown(), only id.
|
||||||
|
for i=1,#brokenSpellsNameToId do
|
||||||
|
if spellName == brokenSpellsNameToId[i][1] then
|
||||||
|
spellName = brokenSpellsNameToId[i][2]
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return spellName
|
||||||
|
end
|
||||||
|
|
||||||
function IceCustomCDBar.prototype:Show(bShouldShow, bForceHide)
|
function IceCustomCDBar.prototype:Show(bShouldShow, bForceHide)
|
||||||
if self.moduleSettings.enabled and not bForceHide then
|
if self.moduleSettings.enabled and not bForceHide then
|
||||||
if (self.moduleSettings.displayMode == "Always") then
|
if (self.moduleSettings.displayMode == "Always") then
|
||||||
|
Reference in New Issue
Block a user