- separated alpha settings for "OOC and target" and "OOC and not full"; existing user settings are preserved (target gets copied to the new Not Full setting) the first time this version (or later) of the addon is loaded by a user with existing settings

This commit is contained in:
Parnic
2009-01-06 07:41:27 +00:00
parent 4df215afc8
commit 1a6ff9fe7f
4 changed files with 67 additions and 6 deletions

View File

@ -739,9 +739,12 @@ function IceBarElement.prototype:UpdateBar(scale, color, alpha)
if (self.combat) then if (self.combat) then
self.alpha = self.settings.alphaic self.alpha = self.settings.alphaic
self.backgroundAlpha = self.settings.alphaicbg self.backgroundAlpha = self.settings.alphaicbg
elseif (self.target or self:UseTargetAlpha(scale)) then elseif (self.target) then
self.alpha = self.settings.alphaTarget self.alpha = self.settings.alphaTarget
self.backgroundAlpha = self.settings.alphaTargetbg self.backgroundAlpha = self.settings.alphaTargetbg
elseif (self:UseTargetAlpha(scale)) then
self.alpha = self.settings.alphaNotFull
self.backgroundAlpha = self.settings.alphaNotFullbg
else else
self.alpha = self.settings.alphaooc self.alpha = self.settings.alphaooc
self.backgroundAlpha = self.settings.alphaoocbg self.backgroundAlpha = self.settings.alphaoocbg

View File

@ -52,10 +52,12 @@ function IceCore.prototype:SetupDefaults()
alphaooc = 0.3, alphaooc = 0.3,
alphaic = 0.6, alphaic = 0.6,
alphaTarget = 0.4, alphaTarget = 0.4,
alphaNotFull = 0.4,
alphaoocbg = 0.2, alphaoocbg = 0.2,
alphaicbg = 0.3, alphaicbg = 0.3,
alphaTargetbg = 0.25, alphaTargetbg = 0.25,
alphaNotFullbg = 0.25,
backgroundToggle = false, backgroundToggle = false,
backgroundColor = {r = 0.5, g = 0.5, b = 0.5}, backgroundColor = {r = 0.5, g = 0.5, b = 0.5},
@ -253,6 +255,8 @@ function IceCore.prototype:GetAlpha(mode)
return self.settings.alphaic return self.settings.alphaic
elseif (mode == "Target") then elseif (mode == "Target") then
return self.settings.alphaTarget return self.settings.alphaTarget
elseif (mode == "NotFull") then
return self.settings.alphaNotFull
else else
return self.settings.alphaooc return self.settings.alphaooc
end end
@ -262,6 +266,8 @@ function IceCore.prototype:SetAlpha(mode, value)
self.settings.alphaic = value self.settings.alphaic = value
elseif (mode == "Target") then elseif (mode == "Target") then
self.settings.alphaTarget = value self.settings.alphaTarget = value
elseif (mode == "NotFull") then
self.settings.alphaNotFull = value
else else
self.settings.alphaooc = value self.settings.alphaooc = value
end end
@ -274,6 +280,8 @@ function IceCore.prototype:GetAlphaBG(mode)
return self.settings.alphaicbg return self.settings.alphaicbg
elseif (mode == "Target") then elseif (mode == "Target") then
return self.settings.alphaTargetbg return self.settings.alphaTargetbg
elseif (mode == "NotFull") then
return self.settings.alphaNotFullbg
else else
return self.settings.alphaoocbg return self.settings.alphaoocbg
end end
@ -283,6 +291,8 @@ function IceCore.prototype:SetAlphaBG(mode, value)
self.settings.alphaicbg = value self.settings.alphaicbg = value
elseif (mode == "Target") then elseif (mode == "Target") then
self.settings.alphaTargetbg = value self.settings.alphaTargetbg = value
elseif (mode == "NotFull") then
self.settings.alphaNotFullbg = value
else else
self.settings.alphaoocbg = value self.settings.alphaoocbg = value
end end

View File

@ -215,9 +215,12 @@ function IceElement.prototype:UpdateAlpha()
if (self.combat) then if (self.combat) then
self.alpha = self.settings.alphaic self.alpha = self.settings.alphaic
self.backgroundAlpha = self.settings.alphaicbg self.backgroundAlpha = self.settings.alphaicbg
elseif (self.target or self:UseTargetAlpha(scale)) then elseif (self.target) then
self.alpha = self.settings.alphaTarget self.alpha = self.settings.alphaTarget
self.backgroundAlpha = self.settings.alphaTargetbg self.backgroundAlpha = self.settings.alphaTargetbg
elseif (self:UseTargetAlpha(scale)) then
self.alpha = self.settings.alphaNotFull
self.backgroundAlpha = self.settings.alphaNotFullbg
else else
self.alpha = self.settings.alphaooc self.alpha = self.settings.alphaooc
self.backgroundAlpha = self.settings.alphaoocbg self.backgroundAlpha = self.settings.alphaoocbg

View File

@ -145,8 +145,8 @@ IceHUD.options =
alphaTarget = { alphaTarget = {
type = 'range', type = 'range',
name = 'Alpha OOC and Target or not Full', name = 'Alpha OOC and Target',
desc = 'Bar alpha Out Of Combat with target accuired or bar not full', desc = 'Bar alpha Out Of Combat with target accuired (takes precedence over Not Full)',
get = function() get = function()
return IceHUD.IceCore:GetAlpha("Target") return IceHUD.IceCore:GetAlpha("Target")
end, end,
@ -160,6 +160,23 @@ IceHUD.options =
order = 13, order = 13,
}, },
alphaNotFull = {
type = 'range',
name = 'Alpha OOC and not full',
desc = 'Bar alpha Out Of Combat with target accuired or bar not full (Target takes precedence over this)',
get = function()
return IceHUD.IceCore:GetAlpha("NotFull")
end,
set = function(v)
IceHUD.IceCore:SetAlpha("NotFull", v)
end,
min = 0,
max = 1,
step = 0.05,
isPercent = true,
order = 14,
},
headerAlphaBackgroundBlank = { type = 'header', name = " ", order = 20 }, headerAlphaBackgroundBlank = { type = 'header', name = " ", order = 20 },
@ -205,8 +222,8 @@ IceHUD.options =
alphaTargetbg = { alphaTargetbg = {
type = 'range', type = 'range',
name = 'BG Alpha OOC and Target or not Full', name = 'BG Alpha OOC and Target',
desc = 'Background alpha for bars OOC and target accuired or bar not full', desc = 'Background alpha for bars OOC and target accuired (takes precedence over Not Full)',
get = function() get = function()
return IceHUD.IceCore:GetAlphaBG("Target") return IceHUD.IceCore:GetAlphaBG("Target")
end, end,
@ -220,6 +237,23 @@ IceHUD.options =
order = 23, order = 23,
}, },
alphaNotFullbg = {
type = 'range',
name = 'BG Alpha OOC and not Full',
desc = 'Background alpha for bars OOC and bar not full (Target takes precedence over this)',
get = function()
return IceHUD.IceCore:GetAlphaBG("NotFull")
end,
set = function(v)
IceHUD.IceCore:SetAlphaBG("NotFull", v)
end,
min = 0,
max = 1,
step = 0.05,
isPercent = true,
order = 24,
},
headerBarAdvancedBlank = { type = 'header', name = " ", order = 30 }, headerBarAdvancedBlank = { type = 'header', name = " ", order = 30 },
headerBarAdvanced = { headerBarAdvanced = {
@ -577,6 +611,8 @@ function IceHUD:OnInitialize()
-- Parnic - added /icehudcl to make rock config pick this up -- Parnic - added /icehudcl to make rock config pick this up
self:RegisterChatCommand({"/icehudcl"}, IceHUD.options) self:RegisterChatCommand({"/icehudcl"}, IceHUD.options)
self:RegisterChatCommand({ "/icehud" }, IceHUD.slashMenu) self:RegisterChatCommand({ "/icehud" }, IceHUD.slashMenu)
self:SyncSettingsVersions()
end end
@ -605,6 +641,15 @@ function IceHUD:ResetSettings()
ReloadUI() ReloadUI()
end end
-- add settings changes/updates here so that existing users don't lose their settings
function IceHUD:SyncSettingsVersions()
if not self.IceCore.settings.updatedOocNotFull then
self.IceCore.settings.updatedOocNotFull = true
self.IceCore.settings.alphaNotFull = self.IceCore.settings.alphaTarget
self.IceCore.settings.alphaNotFullbg = self.IceCore.settings.alphaTargetbg
end
end
-- fubar stuff -- fubar stuff
IceHUD.OnMenuRequest = IceHUD.options IceHUD.OnMenuRequest = IceHUD.options
IceHUD.hasIcon = "Interface\\Icons\\Spell_Frost_Frost" IceHUD.hasIcon = "Interface\\Icons\\Spell_Frost_Frost"