diff --git a/IceBarElement.lua b/IceBarElement.lua index a74d6ec..66cd12f 100644 --- a/IceBarElement.lua +++ b/IceBarElement.lua @@ -739,9 +739,12 @@ 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 self:UseTargetAlpha(scale)) then + elseif (self.target) then self.alpha = self.settings.alphaTarget self.backgroundAlpha = self.settings.alphaTargetbg + elseif (self:UseTargetAlpha(scale)) then + self.alpha = self.settings.alphaNotFull + self.backgroundAlpha = self.settings.alphaNotFullbg else self.alpha = self.settings.alphaooc self.backgroundAlpha = self.settings.alphaoocbg diff --git a/IceCore.lua b/IceCore.lua index e68b889..1e1e2a5 100644 --- a/IceCore.lua +++ b/IceCore.lua @@ -52,10 +52,12 @@ function IceCore.prototype:SetupDefaults() alphaooc = 0.3, alphaic = 0.6, alphaTarget = 0.4, + alphaNotFull = 0.4, alphaoocbg = 0.2, alphaicbg = 0.3, alphaTargetbg = 0.25, + alphaNotFullbg = 0.25, backgroundToggle = false, backgroundColor = {r = 0.5, g = 0.5, b = 0.5}, @@ -253,6 +255,8 @@ function IceCore.prototype:GetAlpha(mode) return self.settings.alphaic elseif (mode == "Target") then return self.settings.alphaTarget + elseif (mode == "NotFull") then + return self.settings.alphaNotFull else return self.settings.alphaooc end @@ -262,6 +266,8 @@ function IceCore.prototype:SetAlpha(mode, value) self.settings.alphaic = value elseif (mode == "Target") then self.settings.alphaTarget = value + elseif (mode == "NotFull") then + self.settings.alphaNotFull = value else self.settings.alphaooc = value end @@ -274,6 +280,8 @@ function IceCore.prototype:GetAlphaBG(mode) return self.settings.alphaicbg elseif (mode == "Target") then return self.settings.alphaTargetbg + elseif (mode == "NotFull") then + return self.settings.alphaNotFullbg else return self.settings.alphaoocbg end @@ -283,6 +291,8 @@ function IceCore.prototype:SetAlphaBG(mode, value) self.settings.alphaicbg = value elseif (mode == "Target") then self.settings.alphaTargetbg = value + elseif (mode == "NotFull") then + self.settings.alphaNotFullbg = value else self.settings.alphaoocbg = value end diff --git a/IceElement.lua b/IceElement.lua index 4089c3b..a231b82 100644 --- a/IceElement.lua +++ b/IceElement.lua @@ -215,9 +215,12 @@ function IceElement.prototype:UpdateAlpha() if (self.combat) then self.alpha = self.settings.alphaic self.backgroundAlpha = self.settings.alphaicbg - elseif (self.target or self:UseTargetAlpha(scale)) then + elseif (self.target) then self.alpha = self.settings.alphaTarget self.backgroundAlpha = self.settings.alphaTargetbg + elseif (self:UseTargetAlpha(scale)) then + self.alpha = self.settings.alphaNotFull + self.backgroundAlpha = self.settings.alphaNotFullbg else self.alpha = self.settings.alphaooc self.backgroundAlpha = self.settings.alphaoocbg diff --git a/IceHUD.lua b/IceHUD.lua index 2ccb875..10e61ce 100644 --- a/IceHUD.lua +++ b/IceHUD.lua @@ -145,8 +145,8 @@ IceHUD.options = alphaTarget = { type = 'range', - name = 'Alpha OOC and Target or not Full', - desc = 'Bar alpha Out Of Combat with target accuired or bar not full', + name = 'Alpha OOC and Target', + desc = 'Bar alpha Out Of Combat with target accuired (takes precedence over Not Full)', get = function() return IceHUD.IceCore:GetAlpha("Target") end, @@ -160,6 +160,23 @@ IceHUD.options = 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 }, @@ -205,8 +222,8 @@ IceHUD.options = alphaTargetbg = { type = 'range', - name = 'BG Alpha OOC and Target or not Full', - desc = 'Background alpha for bars OOC and target accuired or bar not full', + name = 'BG Alpha OOC and Target', + desc = 'Background alpha for bars OOC and target accuired (takes precedence over Not Full)', get = function() return IceHUD.IceCore:GetAlphaBG("Target") end, @@ -220,6 +237,23 @@ IceHUD.options = 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 }, headerBarAdvanced = { @@ -577,6 +611,8 @@ function IceHUD:OnInitialize() -- Parnic - added /icehudcl to make rock config pick this up self:RegisterChatCommand({"/icehudcl"}, IceHUD.options) self:RegisterChatCommand({ "/icehud" }, IceHUD.slashMenu) + + self:SyncSettingsVersions() end @@ -605,6 +641,15 @@ function IceHUD:ResetSettings() ReloadUI() 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 IceHUD.OnMenuRequest = IceHUD.options IceHUD.hasIcon = "Interface\\Icons\\Spell_Frost_Frost"