- added optional scaling to spell icons on the cast bars, custom bars, and cooldown bars

This commit is contained in:
Parnic
2010-07-25 20:25:17 +00:00
parent 12093a32fa
commit 7e042dc3ec
3 changed files with 86 additions and 6 deletions

View File

@ -5,6 +5,8 @@ IceCustomCDBar = AceOO.Class(IceUnitBar)
local validDisplayModes = {"Always", "When ready", "When cooling down"}
local validBuffTimers = {"none", "seconds", "minutes:seconds", "minutes"}
local AuraIconWidth = 20
local AuraIconHeight = 20
IceCustomCDBar.prototype.cooldownDuration = 0
IceCustomCDBar.prototype.cooldownEndTime = 0
@ -28,6 +30,10 @@ function IceCustomCDBar.prototype:Enable(core)
self:Show(true)
if self.moduleSettings.auraIconScale == nil then
self.moduleSettings.auraIconScale = 1
end
self:UpdateCustomBar()
self:UpdateIcon()
self:EnableUpdates(false)
@ -82,6 +88,7 @@ function IceCustomCDBar.prototype:GetDefaultSettings()
settings["displayAuraIcon"] = false
settings["auraIconXOffset"] = 40
settings["auraIconYOffset"] = 0
settings["auraIconScale"] = 1
return settings
end
@ -93,8 +100,6 @@ function IceCustomCDBar.prototype:CreateBar()
self.barFrame.icon = self.barFrame:CreateTexture(nil, "LOW")
-- default texture so that 'config mode' can work without activating the bar first
self.barFrame.icon:SetTexture("Interface\\Icons\\Spell_Frost_Frost")
self.barFrame.icon:SetWidth(20)
self.barFrame.icon:SetHeight(20)
-- this cuts off the border around the buff icon
self.barFrame.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
self.barFrame.icon:SetDrawLayer("OVERLAY")
@ -109,6 +114,8 @@ function IceCustomCDBar.prototype:PositionIcons()
self.barFrame.icon:ClearAllPoints()
self.barFrame.icon:SetPoint("TOPLEFT", self.frame, "TOPLEFT", self.moduleSettings.auraIconXOffset, self.moduleSettings.auraIconYOffset)
self.barFrame.icon:SetWidth(AuraIconWidth * (self.moduleSettings.auraIconScale or 1))
self.barFrame.icon:SetHeight(AuraIconHeight * (self.moduleSettings.auraIconScale or 1))
end
function IceCustomCDBar.prototype:Redraw()
@ -327,6 +334,27 @@ function IceCustomCDBar.prototype:GetOptions()
order = 40.3,
}
opts["auraIconScale"] = {
type = 'range',
min = 0.1,
max = 3.0,
step = 0.05,
name = 'Aura icon scale',
desc = 'Adjusts the size of the aura icon for this bar',
get = function()
return self.moduleSettings.auraIconScale
end,
set = function(v)
self.moduleSettings.auraIconScale = v
self:PositionIcons()
end,
disabled = function()
return not self.moduleSettings.enabled or not self.moduleSettings.displayAuraIcon
end,
usage = "<adjusts the spell icon's size>",
order = 40.4,
}
return opts
end