Bugfixes & improved RoundBar texture

This commit is contained in:
iceroth
2006-08-26 13:50:55 +00:00
parent 7050788344
commit 439b3fecec
19 changed files with 123 additions and 62 deletions

View File

@ -74,6 +74,9 @@ function IceBarElement.prototype:GetOptions()
self:Redraw()
end,
validate = { "Left", "Right" },
disabled = function()
return not self.moduleSettings.enabled
end,
order = 30
}
@ -92,6 +95,9 @@ function IceBarElement.prototype:GetOptions()
self.moduleSettings.offset = value
self:Redraw()
end,
disabled = function()
return not self.moduleSettings.enabled
end,
order = 31
}
@ -101,6 +107,9 @@ function IceBarElement.prototype:GetOptions()
name = '|c' .. self.configColor .. 'Text Settings|r',
desc = 'Settings related to texts',
order = 32,
disabled = function()
return not self.moduleSettings.enabled
end,
args = {
fontsize = {
type = 'range',
@ -368,8 +377,6 @@ function IceBarElement.prototype:SetScale(texture, scale)
else
texture:SetTexCoord(0, 1, 1-scale, 1)
end
self.full = (scale == 1)
end
@ -385,7 +392,7 @@ function IceBarElement.prototype:UpdateBar(scale, color, alpha)
if (self.combat) then
self.alpha = self.settings.alphaic
self.backgroundAlpha = self.settings.alphaicbg
elseif (self.target or (scale < 1)) then
elseif (self.target or self:UseTargetAlpha(scale)) then
self.alpha = self.settings.alphaTarget
self.backgroundAlpha = self.settings.alphaTargetbg
else
@ -400,6 +407,10 @@ function IceBarElement.prototype:UpdateBar(scale, color, alpha)
end
function IceBarElement.prototype:UseTargetAlpha(scale)
return (scale and (scale < 1))
end
-- Bottom line 1
function IceBarElement.prototype:SetBottomText1(text, color)

View File

@ -73,14 +73,13 @@ end
function IceCore.prototype:Enable()
self.settings = self.db.account
IceElement.Alpha = self.settings.bar
self:DrawFrame()
for i = 1, table.getn(self.elements) do
self.elements[i]:SetDatabase(self.settings)
self.elements[i]:Create(self.IceHUDFrame)
if (self.elements[i]:IsEnabled()) then
self.elements[i]:Enable()
self.elements[i]:Enable(true)
end
end
@ -91,7 +90,7 @@ end
function IceCore.prototype:Disable()
for i = 1, table.getn(self.elements) do
if (self.elements[i]:IsEnabled()) then
self.elements[i]:Disable()
self.elements[i]:Disable(true)
end
end

View File

@ -71,17 +71,24 @@ function IceElement.prototype:IsEnabled()
end
function IceElement.prototype:Enable()
function IceElement.prototype:Enable(core)
if (not core) then
self.moduleSettings.enabled = true
end
self.frame:Show()
end
function IceElement.prototype:Disable()
function IceElement.prototype:Disable(core)
if (not core) then
self.moduleSettings.enabled = false
end
self.frame:Hide()
self:UnregisterAllEvents()
end
-- inherting classes should override this and provide
-- make sure they refresh any changes made to them
function IceElement.prototype:Redraw()
@ -104,7 +111,7 @@ function IceElement.prototype:GetOptions()
set = function(value)
self.moduleSettings.enabled = value
if (value) then
self:Enable()
self:Enable(true)
else
self:Disable()
end
@ -129,6 +136,9 @@ function IceElement.prototype:GetOptions()
self.moduleSettings.scale = value
self:Redraw()
end,
disabled = function()
return not self.moduleSettings.enabled
end,
order = 21
}

View File

@ -1,4 +1,4 @@
## Interface: 11100
## Interface: 11200
## Author: Iceroth
## Name: IceHUD
## Title: IceHUD |cff7fff7f -Ace2-|r

View File

@ -42,8 +42,8 @@ end
function CastBar.prototype:Enable()
CastBar.super.prototype.Enable(self)
function CastBar.prototype:Enable(core)
CastBar.super.prototype.Enable(self, core)
self:RegisterEvent("SPELLCAST_START", "CastStart")
self:RegisterEvent("SPELLCAST_STOP", "CastStop")
@ -63,8 +63,8 @@ function CastBar.prototype:Enable()
end
function CastBar.prototype:Disable()
CastBar.super.prototype.Disable(self)
function CastBar.prototype:Disable(core)
CastBar.super.prototype.Disable(self, core)
CastingBarFrame:RegisterEvent("SPELLCAST_START");
CastingBarFrame:RegisterEvent("SPELLCAST_STOP");

View File

@ -35,6 +35,9 @@ function ComboPoints.prototype:GetOptions()
min = -300,
max = 200,
step = 10,
disabled = function()
return not self.moduleSettings.enabled
end,
order = 31
}
@ -52,6 +55,9 @@ function ComboPoints.prototype:GetOptions()
min = 10,
max = 40,
step = 1,
disabled = function()
return not self.moduleSettings.enabled
end,
order = 32
}
@ -67,6 +73,9 @@ function ComboPoints.prototype:GetOptions()
self:Redraw()
end,
validate = { "Numeric", "Graphical" },
disabled = function()
return not self.moduleSettings.enabled
end,
order = 33
}
@ -94,8 +103,8 @@ end
-- OVERRIDE
function ComboPoints.prototype:Enable()
ComboPoints.super.prototype.Enable(self)
function ComboPoints.prototype:Enable(core)
ComboPoints.super.prototype.Enable(self, core)
self:RegisterEvent("PLAYER_TARGET_CHANGED", "UpdateComboPoints")
self:RegisterEvent("PLAYER_COMBO_POINTS", "UpdateComboPoints")
@ -149,7 +158,7 @@ function ComboPoints.prototype:CreateComboFrame()
self.frame.graphicalBG[i]:SetWidth(self.comboSize)
self.frame.graphicalBG[i]:SetHeight(self.comboSize)
self.frame.graphicalBG[i]:SetPoint("TOPLEFT", (i-1) * (self.comboSize-5) + (i-1), 0)
self.frame.graphicalBG[i]:SetAlpha(0.3)
self.frame.graphicalBG[i]:SetAlpha(0.15)
self.frame.graphicalBG[i]:SetStatusBarColor(self:GetColor("combo"))
self.frame.graphicalBG[i]:Hide()
@ -164,9 +173,7 @@ function ComboPoints.prototype:CreateComboFrame()
self.frame.graphical[i]:SetFrameStrata("BACKGROUND")
self.frame.graphical[i]:SetAllPoints(self.frame.graphicalBG[i])
local r, g, b = self:GetColor("combo")
g = g - (0.15*i)
self.frame.graphical[i]:SetStatusBarColor(r, g, b)
self.frame.graphical[i]:SetStatusBarColor(self:GetColor("combo"))
self.frame.graphical[i]:Hide()
end

View File

@ -27,8 +27,8 @@ function DruidMana.prototype:GetDefaultSettings()
end
function DruidMana.prototype:Enable()
DruidMana.super.prototype.Enable(self)
function DruidMana.prototype:Enable(core)
DruidMana.super.prototype.Enable(self, core)
if (IsAddOnLoaded("SoleManax")) then
self.mode = "SoleManax"
@ -47,8 +47,8 @@ function DruidMana.prototype:Enable()
end
function DruidMana.prototype:Disable()
DruidMana.super.prototype.Disable(self)
function DruidMana.prototype:Disable(core)
DruidMana.super.prototype.Disable(self, core)
if (IsAddOnLoaded("SoleManax")) then
SoleManax.DelUser(self.UpdateSoleManax)

View File

@ -38,8 +38,8 @@ function MirrorBar.prototype:UpdatePosition(side, offset)
end
function MirrorBar.prototype:Enable()
MirrorBar.super.prototype.Enable(self)
function MirrorBar.prototype:Enable(core)
MirrorBar.super.prototype.Enable(self, core)
self.frame.bottomUpperText:SetWidth(200)
self.frame.bottomLowerText:SetWidth(200)
@ -316,8 +316,8 @@ function MirrorBarHandler.prototype:GetOptions()
end
function MirrorBarHandler.prototype:Enable()
MirrorBarHandler.super.prototype.Enable(self)
function MirrorBarHandler.prototype:Enable(core)
MirrorBarHandler.super.prototype.Enable(self, core)
self:RegisterEvent("MIRROR_TIMER_START", "MirrorStart")
self:RegisterEvent("MIRROR_TIMER_STOP", "MirrorStop")
self:RegisterEvent("MIRROR_TIMER_PAUSE", "MirrorPause")
@ -327,8 +327,8 @@ function MirrorBarHandler.prototype:Enable()
end
function MirrorBarHandler.prototype:Disable()
MirrorBarHandler.super.prototype.Disable(self)
function MirrorBarHandler.prototype:Disable(core)
MirrorBarHandler.super.prototype.Disable(self, core)
UIParent:RegisterEvent("MIRROR_TIMER_START");
end

View File

@ -38,8 +38,8 @@ function PetHealth.prototype:CreateFrame()
end
function PetHealth.prototype:Enable()
PetHealth.super.prototype.Enable(self)
function PetHealth.prototype:Enable(core)
PetHealth.super.prototype.Enable(self, core)
self:RegisterEvent("PET_UI_UPDATE", "CheckPet");
self:RegisterEvent("PLAYER_PET_CHANGED", "CheckPet");

View File

@ -41,8 +41,8 @@ function PetMana.prototype:CreateFrame()
end
function PetMana.prototype:Enable()
PetMana.super.prototype.Enable(self)
function PetMana.prototype:Enable(core)
PetMana.super.prototype.Enable(self, core)
self:RegisterEvent("PET_UI_UPDATE", "CheckPet");
self:RegisterEvent("PLAYER_PET_CHANGED", "CheckPet");

View File

@ -18,8 +18,8 @@ function PlayerHealth.prototype:GetDefaultSettings()
end
function PlayerHealth.prototype:Enable()
PlayerHealth.super.prototype.Enable(self)
function PlayerHealth.prototype:Enable(core)
PlayerHealth.super.prototype.Enable(self, core)
self:RegisterEvent("UNIT_HEALTH", "Update")
self:RegisterEvent("UNIT_MAXHEALTH", "Update")

View File

@ -42,6 +42,9 @@ function PlayerMana.prototype:GetOptions()
self.moduleSettings.tickerEnabled = value
self:ManaType(self.unit)
end,
disabled = function()
return not self.moduleSettings.enabled
end,
order = 51
}
@ -60,6 +63,9 @@ function PlayerMana.prototype:GetOptions()
self.moduleSettings.tickerAlpha = value
self.tickerFrame:SetStatusBarColor(self:GetColor("playerEnergy", self.moduleSettings.tickerAlpha))
end,
disabled = function()
return not self.moduleSettings.enabled
end,
order = 52
}
@ -67,8 +73,8 @@ function PlayerMana.prototype:GetOptions()
end
function PlayerMana.prototype:Enable()
PlayerMana.super.prototype.Enable(self)
function PlayerMana.prototype:Enable(core)
PlayerMana.super.prototype.Enable(self, core)
self:CreateTickerFrame()
@ -93,6 +99,16 @@ function PlayerMana.prototype:Redraw()
end
-- OVERRIDE
function PlayerMana.prototype:UseTargetAlpha(scale)
if (self.manaType == 1) then
return (scale and (scale > 0))
else
return PlayerMana.super.prototype.UseTargetAlpha(self, scale)
end
end
function PlayerMana.prototype:ManaType(unit)
if (unit ~= self.unit) then
return

View File

@ -42,6 +42,9 @@ function TargetHealth.prototype:GetOptions()
disabled = function()
return (MobHealth3 == nil)
end,
disabled = function()
return not self.moduleSettings.enabled
end,
order = 40
}
@ -49,8 +52,8 @@ function TargetHealth.prototype:GetOptions()
end
function TargetHealth.prototype:Enable()
TargetHealth.super.prototype.Enable(self)
function TargetHealth.prototype:Enable(core)
TargetHealth.super.prototype.Enable(self, core)
self:RegisterEvent("UNIT_HEALTH", "Update")
self:RegisterEvent("UNIT_MAXHEALTH", "Update")
@ -59,8 +62,8 @@ function TargetHealth.prototype:Enable()
end
function TargetHealth.prototype:Disable()
TargetHealth.super.prototype.Disable(self)
function TargetHealth.prototype:Disable(core)
TargetHealth.super.prototype.Disable(self, core)
end

View File

@ -38,6 +38,9 @@ function TargetInfo.prototype:GetOptions()
min = -300,
max = 300,
step = 10,
disabled = function()
return not self.moduleSettings.enabled
end,
order = 31
}
@ -55,6 +58,9 @@ function TargetInfo.prototype:GetOptions()
min = 8,
max = 20,
step = 1,
disabled = function()
return not self.moduleSettings.enabled
end,
order = 32
}
@ -79,8 +85,8 @@ function TargetInfo.prototype:Redraw()
end
function TargetInfo.prototype:Enable()
TargetInfo.super.prototype.Enable(self)
function TargetInfo.prototype:Enable(core)
TargetInfo.super.prototype.Enable(self, core)
self:RegisterEvent("PLAYER_TARGET_CHANGED", "TargetChanged")
self:RegisterEvent("UNIT_AURA", "AuraChanged")

View File

@ -22,8 +22,8 @@ function TargetMana.prototype:GetDefaultSettings()
end
function TargetMana.prototype:Enable()
TargetMana.super.prototype.Enable(self)
function TargetMana.prototype:Enable(core)
TargetMana.super.prototype.Enable(self, core)
self:RegisterEvent("UNIT_MANA", "Update")
self:RegisterEvent("UNIT_MAXMANA", "Update")

View File

@ -39,6 +39,9 @@ function TargetOfTarget.prototype:GetOptions()
min = -300,
max = 300,
step = 10,
disabled = function()
return not self.moduleSettings.enabled
end,
order = 31
}
@ -53,6 +56,9 @@ function TargetOfTarget.prototype:GetOptions()
self.moduleSettings.showDebuffs = value
self:UpdateBuffs()
end,
disabled = function()
return not self.moduleSettings.enabled
end,
order = 32
}
@ -70,6 +76,9 @@ function TargetOfTarget.prototype:GetOptions()
min = 8,
max = 20,
step = 1,
disabled = function()
return not self.moduleSettings.enabled
end,
order = 33
}
@ -95,8 +104,8 @@ function TargetOfTarget.prototype:Redraw()
end
function TargetOfTarget.prototype:Enable()
TargetOfTarget.super.prototype.Enable(self)
function TargetOfTarget.prototype:Enable(core)
TargetOfTarget.super.prototype.Enable(self, core)
self:RegisterEvent("PLAYER_TARGET_CHANGED", "Update")
@ -107,8 +116,8 @@ function TargetOfTarget.prototype:Enable()
end
function TargetOfTarget.prototype:Disable()
TargetOfTarget.super.prototype.Disable(self)
function TargetOfTarget.prototype:Disable(core)
TargetOfTarget.super.prototype.Disable(self, core)
self:UnregisterMetro(self.name)
end

View File

@ -22,8 +22,8 @@ function TimerBar.prototype:GetDefaultSettings()
end
function TimerBar.prototype:Enable()
TimerBar.super.prototype.Enable(self)
function TimerBar.prototype:Enable(core)
TimerBar.super.prototype.Enable(self, core)
self.frame.bottomUpperText:SetWidth(180)
self.frame:Hide()
@ -32,8 +32,8 @@ function TimerBar.prototype:Enable()
end
function TimerBar.prototype:Disable()
TimerBar.super.prototype.Disable(self)
function TimerBar.prototype:Disable(core)
TimerBar.super.prototype.Disable(self, core)
self:Unhook(ToFu, "OnTextUpdate")
end

Binary file not shown.

Binary file not shown.