- 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

@ -16,6 +16,8 @@ IceCastBar.prototype.actionMessage = nil
IceCastBar.prototype.unit = nil IceCastBar.prototype.unit = nil
IceCastBar.prototype.current = nil IceCastBar.prototype.current = nil
local AuraIconWidth = 20
local AuraIconHeight = 20
-- Constructor -- -- Constructor --
function IceCastBar.prototype:init(name) function IceCastBar.prototype:init(name)
@ -65,6 +67,7 @@ function IceCastBar.prototype:GetDefaultSettings()
settings["displayAuraIcon"] = false settings["displayAuraIcon"] = false
settings["auraIconXOffset"] = 40 settings["auraIconXOffset"] = 40
settings["auraIconYOffset"] = 0 settings["auraIconYOffset"] = 0
settings["auraIconScale"] = 1
settings["reverseChannel"] = true settings["reverseChannel"] = true
return settings return settings
@ -178,6 +181,27 @@ function IceCastBar.prototype:GetOptions()
usage = "<adjusts the spell icon's vertical position>", usage = "<adjusts the spell icon's vertical position>",
order = 53, order = 53,
} }
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 = 54,
}
opts["reverseChannel"] = { opts["reverseChannel"] = {
type = 'toggle', type = 'toggle',
@ -212,8 +236,6 @@ function IceCastBar.prototype:CreateFrame()
self.barFrame.icon = self.barFrame:CreateTexture(nil, "LOW") self.barFrame.icon = self.barFrame:CreateTexture(nil, "LOW")
-- default texture so that 'config mode' can work without activating the bar first -- 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: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 -- this cuts off the border around the buff icon
self.barFrame.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) self.barFrame.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
self.barFrame.icon:SetDrawLayer("OVERLAY") self.barFrame.icon:SetDrawLayer("OVERLAY")
@ -228,6 +250,8 @@ function IceCastBar.prototype:PositionIcons()
self.barFrame.icon:ClearAllPoints() self.barFrame.icon:ClearAllPoints()
self.barFrame.icon:SetPoint("TOPLEFT", self.frame, "TOPLEFT", self.moduleSettings.auraIconXOffset, self.moduleSettings.auraIconYOffset) self.barFrame.icon:SetPoint("TOPLEFT", self.frame, "TOPLEFT", self.moduleSettings.auraIconXOffset, self.moduleSettings.auraIconYOffset)
self.barFrame.icon:SetWidth(AuraIconWidth * self.moduleSettings.auraIconScale)
self.barFrame.icon:SetHeight(AuraIconHeight * self.moduleSettings.auraIconScale)
end end

View File

@ -5,6 +5,8 @@ IceCustomBar = AceOO.Class(IceUnitBar)
local validUnits = {"player", "target", "focus", "pet", "vehicle", "targettarget", "main hand weapon", "off hand weapon"} local validUnits = {"player", "target", "focus", "pet", "vehicle", "targettarget", "main hand weapon", "off hand weapon"}
local buffOrDebuff = {"buff", "debuff"} local buffOrDebuff = {"buff", "debuff"}
local validBuffTimers = {"none", "seconds", "minutes:seconds", "minutes"} local validBuffTimers = {"none", "seconds", "minutes:seconds", "minutes"}
local AuraIconWidth = 20
local AuraIconHeight = 20
IceCustomBar.prototype.auraDuration = 0 IceCustomBar.prototype.auraDuration = 0
IceCustomBar.prototype.auraEndTime = 0 IceCustomBar.prototype.auraEndTime = 0
@ -25,6 +27,10 @@ function IceCustomBar.prototype:Enable(core)
self:RegisterEvent("PLAYER_PET_CHANGED", "UpdateCustomBar") self:RegisterEvent("PLAYER_PET_CHANGED", "UpdateCustomBar")
self:RegisterEvent("PLAYER_FOCUS_CHANGED", "UpdateCustomBar") self:RegisterEvent("PLAYER_FOCUS_CHANGED", "UpdateCustomBar")
if self.moduleSettings.auraIconScale == nil then
self.moduleSettings.auraIconScale = 1
end
self:Show(true) self:Show(true)
self.unit = self.moduleSettings.myUnit self.unit = self.moduleSettings.myUnit
@ -79,6 +85,7 @@ function IceCustomBar.prototype:GetDefaultSettings()
settings["displayAuraIcon"] = false settings["displayAuraIcon"] = false
settings["auraIconXOffset"] = 40 settings["auraIconXOffset"] = 40
settings["auraIconYOffset"] = 0 settings["auraIconYOffset"] = 0
settings["auraIconScale"] = 1
settings["exactMatch"] = false settings["exactMatch"] = false
return settings return settings
@ -91,8 +98,6 @@ function IceCustomBar.prototype:CreateBar()
self.barFrame.icon = self.barFrame:CreateTexture(nil, "LOW") self.barFrame.icon = self.barFrame:CreateTexture(nil, "LOW")
-- default texture so that 'config mode' can work without activating the bar first -- 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: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 -- this cuts off the border around the buff icon
self.barFrame.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) self.barFrame.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
self.barFrame.icon:SetDrawLayer("OVERLAY") self.barFrame.icon:SetDrawLayer("OVERLAY")
@ -108,6 +113,8 @@ function IceCustomBar.prototype:PositionIcons()
self.barFrame.icon:ClearAllPoints() self.barFrame.icon:ClearAllPoints()
self.barFrame.icon:SetPoint("TOPLEFT", self.frame, "TOPLEFT", self.moduleSettings.auraIconXOffset, self.moduleSettings.auraIconYOffset) 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 end
function IceCustomBar.prototype:Redraw() function IceCustomBar.prototype:Redraw()
@ -405,6 +412,27 @@ function IceCustomBar.prototype:GetOptions()
usage = "<adjusts the spell icon's vertical position>", usage = "<adjusts the spell icon's vertical position>",
order = 40.3, 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 return opts
end end

View File

@ -5,6 +5,8 @@ IceCustomCDBar = AceOO.Class(IceUnitBar)
local validDisplayModes = {"Always", "When ready", "When cooling down"} local validDisplayModes = {"Always", "When ready", "When cooling down"}
local validBuffTimers = {"none", "seconds", "minutes:seconds", "minutes"} local validBuffTimers = {"none", "seconds", "minutes:seconds", "minutes"}
local AuraIconWidth = 20
local AuraIconHeight = 20
IceCustomCDBar.prototype.cooldownDuration = 0 IceCustomCDBar.prototype.cooldownDuration = 0
IceCustomCDBar.prototype.cooldownEndTime = 0 IceCustomCDBar.prototype.cooldownEndTime = 0
@ -28,6 +30,10 @@ function IceCustomCDBar.prototype:Enable(core)
self:Show(true) self:Show(true)
if self.moduleSettings.auraIconScale == nil then
self.moduleSettings.auraIconScale = 1
end
self:UpdateCustomBar() self:UpdateCustomBar()
self:UpdateIcon() self:UpdateIcon()
self:EnableUpdates(false) self:EnableUpdates(false)
@ -82,6 +88,7 @@ function IceCustomCDBar.prototype:GetDefaultSettings()
settings["displayAuraIcon"] = false settings["displayAuraIcon"] = false
settings["auraIconXOffset"] = 40 settings["auraIconXOffset"] = 40
settings["auraIconYOffset"] = 0 settings["auraIconYOffset"] = 0
settings["auraIconScale"] = 1
return settings return settings
end end
@ -93,8 +100,6 @@ function IceCustomCDBar.prototype:CreateBar()
self.barFrame.icon = self.barFrame:CreateTexture(nil, "LOW") self.barFrame.icon = self.barFrame:CreateTexture(nil, "LOW")
-- default texture so that 'config mode' can work without activating the bar first -- 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: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 -- this cuts off the border around the buff icon
self.barFrame.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) self.barFrame.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
self.barFrame.icon:SetDrawLayer("OVERLAY") self.barFrame.icon:SetDrawLayer("OVERLAY")
@ -109,6 +114,8 @@ function IceCustomCDBar.prototype:PositionIcons()
self.barFrame.icon:ClearAllPoints() self.barFrame.icon:ClearAllPoints()
self.barFrame.icon:SetPoint("TOPLEFT", self.frame, "TOPLEFT", self.moduleSettings.auraIconXOffset, self.moduleSettings.auraIconYOffset) 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 end
function IceCustomCDBar.prototype:Redraw() function IceCustomCDBar.prototype:Redraw()
@ -327,6 +334,27 @@ function IceCustomCDBar.prototype:GetOptions()
order = 40.3, 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 return opts
end end