Version 0.4

- New bar type
- More configuration options
This commit is contained in:
iceroth
2006-08-06 05:45:56 +00:00
parent 0887e36186
commit 2f51443091
15 changed files with 568 additions and 177 deletions

View File

@ -35,15 +35,35 @@ function CastBar.prototype:GetDefaultSettings()
local settings = CastBar.super.prototype.GetDefaultSettings(self)
settings["side"] = IceCore.Side.Left
settings["offset"] = 0
settings["alwaysShowText"] = true
return settings
end
-- OVERRIDE
function CastBar.prototype:GetOptions()
local opts = CastBar.super.prototype.GetOptions(self)
opts["alwaysShowText"] =
{
type = 'toggle',
name = 'Always Show Text',
desc = 'Overrides possible text hiding option',
get = function()
return self.moduleSettings.alwaysShowText
end,
set = function(value)
self.moduleSettings.alwaysShowText = value
self:Redraw()
end,
order = 50
}
return opts
end
function CastBar.prototype:Enable()
CastBar.super.prototype.Enable(self)
self.frame.bottomUpperText:SetWidth(180)
self:RegisterEvent("SPELLCAST_START", "CastStart")
self:RegisterEvent("SPELLCAST_STOP", "CastStop")
self:RegisterEvent("SPELLCAST_FAILED", "CastFailed")
@ -80,13 +100,23 @@ end
function CastBar.prototype:Redraw()
CastBar.super.prototype.Redraw(self)
self.frame.bottomUpperText:SetWidth(180)
if (self.moduleSettings.alwaysShowText) then
self.frame.bottomUpperText:Show()
end
end
-- 'Protected' methods --------------------------------------------------------
-- OVERRIDE
function CastBar.prototype:CreateFrame()
CastBar.super.prototype.CreateFrame(self)
self.frame.bottomUpperText:SetWidth(self.settings.gap + 30)
end
function CastBar.prototype:OnUpdate()
local taken = GetTime() - self.startTime