mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 14:50:13 -05:00
- the player's cast bar can now optionally change color whenever the target goes out of range. this is currently enabled by default
This commit is contained in:
@ -11,6 +11,7 @@ function CastBar.prototype:init()
|
|||||||
CastBar.super.prototype.init(self, "CastBar")
|
CastBar.super.prototype.init(self, "CastBar")
|
||||||
|
|
||||||
self:SetDefaultColor("CastLag", 255, 0, 0)
|
self:SetDefaultColor("CastLag", 255, 0, 0)
|
||||||
|
self:SetDefaultColor("CastNotInRange", 200, 200, 200)
|
||||||
|
|
||||||
self.unit = "player"
|
self.unit = "player"
|
||||||
end
|
end
|
||||||
@ -30,6 +31,7 @@ function CastBar.prototype:GetDefaultSettings()
|
|||||||
settings["showBlizzCast"] = false
|
settings["showBlizzCast"] = false
|
||||||
settings["shouldAnimate"] = false
|
settings["shouldAnimate"] = false
|
||||||
settings["usesDogTagStrings"] = false
|
settings["usesDogTagStrings"] = false
|
||||||
|
settings["rangeColor"] = true
|
||||||
|
|
||||||
return settings
|
return settings
|
||||||
end
|
end
|
||||||
@ -181,6 +183,22 @@ function CastBar.prototype:GetOptions()
|
|||||||
order = 29
|
order = 29
|
||||||
}
|
}
|
||||||
|
|
||||||
|
opts["rangeColor"] = {
|
||||||
|
type = 'toggle',
|
||||||
|
name = 'Change color when not in range',
|
||||||
|
desc = 'Changes the bar color to the CastNotInRange color when the target goes out of range for the current spell.',
|
||||||
|
get = function()
|
||||||
|
return self.moduleSettings.rangeColor
|
||||||
|
end,
|
||||||
|
set = function(v)
|
||||||
|
self.moduleSettings.rangeColor = v
|
||||||
|
end,
|
||||||
|
disabled = function()
|
||||||
|
return not self.moduleSettings.enabled
|
||||||
|
end,
|
||||||
|
order = 30
|
||||||
|
}
|
||||||
|
|
||||||
opts["textSettings"] =
|
opts["textSettings"] =
|
||||||
{
|
{
|
||||||
type = 'group',
|
type = 'group',
|
||||||
@ -457,6 +475,27 @@ function CastBar.prototype:SpellCastChannelStart(unit)
|
|||||||
self.lagBar:SetPoint("BOTTOM", self.frame, "BOTTOM", 0, 0)
|
self.lagBar:SetPoint("BOTTOM", self.frame, "BOTTOM", 0, 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function CastBar.prototype:UpdateBar(scale, color, alpha)
|
||||||
|
local bCheckRange = true
|
||||||
|
local inRange
|
||||||
|
|
||||||
|
if not self.moduleSettings.rangeColor or not self.current or not self.action or not UnitExists("target") then
|
||||||
|
bCheckRange = false
|
||||||
|
else
|
||||||
|
inRange = IsSpellInRange(self.current, "target")
|
||||||
|
if inRange == nil then
|
||||||
|
bCheckRange = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if bCheckRange and inRange == 0 then
|
||||||
|
color = "CastNotInRange"
|
||||||
|
end
|
||||||
|
|
||||||
|
CastBar.super.prototype.UpdateBar(self, scale, color, alpha)
|
||||||
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
-- Load us up
|
-- Load us up
|
||||||
|
Reference in New Issue
Block a user