mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 22:51:53 -05:00
- add an option to the player cast bar to show the default cast bar or not
This commit is contained in:
@ -19,11 +19,14 @@ end
|
|||||||
-- OVERRIDE
|
-- OVERRIDE
|
||||||
function CastBar.prototype:GetDefaultSettings()
|
function CastBar.prototype:GetDefaultSettings()
|
||||||
local settings = CastBar.super.prototype.GetDefaultSettings(self)
|
local settings = CastBar.super.prototype.GetDefaultSettings(self)
|
||||||
|
|
||||||
settings["side"] = IceCore.Side.Left
|
settings["side"] = IceCore.Side.Left
|
||||||
settings["offset"] = 0
|
settings["offset"] = 0
|
||||||
settings["flashInstants"] = "Caster"
|
settings["flashInstants"] = "Caster"
|
||||||
settings["flashFailures"] = "Caster"
|
settings["flashFailures"] = "Caster"
|
||||||
settings["lagAlpha"] = 0.7
|
settings["lagAlpha"] = 0.7
|
||||||
|
settings["showBlizzCast"] = false
|
||||||
|
|
||||||
return settings
|
return settings
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -89,6 +92,24 @@ function CastBar.prototype:GetOptions()
|
|||||||
order = 42
|
order = 42
|
||||||
}
|
}
|
||||||
|
|
||||||
|
opts["showBlizzCast"] =
|
||||||
|
{
|
||||||
|
type = 'toggle',
|
||||||
|
name = 'Show default cast bar',
|
||||||
|
desc = 'Whether or not to show the default cast bar.',
|
||||||
|
get = function()
|
||||||
|
return self.moduleSettings.showBlizzCast
|
||||||
|
end,
|
||||||
|
set = function(value)
|
||||||
|
self.moduleSettings.showBlizzCast = value
|
||||||
|
self:ToggleBlizzCast(self.moduleSettings.showBlizzCast)
|
||||||
|
end,
|
||||||
|
disabled = function()
|
||||||
|
return not self.moduleSettings.enabled
|
||||||
|
end,
|
||||||
|
order = 43
|
||||||
|
}
|
||||||
|
|
||||||
opts["textSettings"] =
|
opts["textSettings"] =
|
||||||
{
|
{
|
||||||
type = 'group',
|
type = 'group',
|
||||||
@ -153,14 +174,22 @@ end
|
|||||||
function CastBar.prototype:Enable(core)
|
function CastBar.prototype:Enable(core)
|
||||||
CastBar.super.prototype.Enable(self, core)
|
CastBar.super.prototype.Enable(self, core)
|
||||||
|
|
||||||
-- remove blizz cast bar
|
if self.moduleSettings.enabled and not self.moduleSettings.showBlizzCast then
|
||||||
CastingBarFrame:UnregisterAllEvents()
|
self:ToggleBlizzCast(false)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function CastBar.prototype:Disable(core)
|
function CastBar.prototype:Disable(core)
|
||||||
CastBar.super.prototype.Disable(self, core)
|
CastBar.super.prototype.Disable(self, core)
|
||||||
|
|
||||||
|
if self.moduleSettings.showBlizzCast then
|
||||||
|
self:ToggleBlizzCast(true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function CastBar.prototype:ToggleBlizzCast(on)
|
||||||
|
if on then
|
||||||
-- restore blizz cast bar
|
-- restore blizz cast bar
|
||||||
CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_SENT");
|
CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_SENT");
|
||||||
CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_START");
|
CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_START");
|
||||||
@ -174,6 +203,10 @@ function CastBar.prototype:Disable(core)
|
|||||||
CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START");
|
CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START");
|
||||||
CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_CHANNEL_UPDATE");
|
CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_CHANNEL_UPDATE");
|
||||||
CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_CHANNEL_STOP");
|
CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_CHANNEL_STOP");
|
||||||
|
else
|
||||||
|
-- remove blizz cast bar
|
||||||
|
CastingBarFrame:UnregisterAllEvents()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user