diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6732599..2e7afe1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,5 +28,5 @@ jobs: if: '!contains( github.ref, ''beta'')' - name: Create Pre-Release Package - run: curl -s https://raw.githubusercontent.com/BigWigsMods/packager/master/release.sh | bash -s -- -p 0 -w 0; + run: curl -s https://raw.githubusercontent.com/BigWigsMods/packager/master/release.sh | bash -s -- -p 0 -w 0 -a 0; if: 'contains( github.ref, ''beta'')' diff --git a/Aptechka.lua b/Aptechka.lua index f5e2f47..408a288 100644 --- a/Aptechka.lua +++ b/Aptechka.lua @@ -263,6 +263,9 @@ local defaults = { nameColorByClass = true, useCustomBackgroundColor = false, customBackgroundColor = {1,0,0}, + powerColor = {0.5, 0.5, 1}, + useCustomBackgroundColorPower = false, + customBackgroundColorPower = {0.5, 0.5, 1}, petColor = {1, 0.5, 0.5}, alphaOutOfRange = 0.45, diff --git a/Options/ProfileSettings.lua b/Options/ProfileSettings.lua index 7b1b581..4626908 100644 --- a/Options/ProfileSettings.lua +++ b/Options/ProfileSettings.lua @@ -729,6 +729,45 @@ function ns.MakeProfileSettings() Aptechka:RefreshAllUnitsColors() end, }, + powerColor = { + name = L"Power Color", + type = 'color', + width = 3, + order = 7.21, + get = function(info) + local r,g,b = unpack(Aptechka.db.profile.powerColor) + return r,g,b + end, + set = function(info, r, g, b) + Aptechka.db.profile.powerColor = {r,g,b} + Aptechka:RefreshAllUnitsColors() + end, + }, + usePowerBGColor = { + name = L"Use Separate power Background Color", + type = "toggle", + width = 2, + get = function(info) return Aptechka.db.profile.useCustomBackgroundColorPower end, + set = function(info, v) + Aptechka.db.profile.useCustomBackgroundColorPower = not Aptechka.db.profile.useCustomBackgroundColorPower + Aptechka:RefreshAllUnitsColors() + end, + order = 7.22, + }, + powerbgColor = { + name = L"Power BG Color", + type = 'color', + order = 7.23, + disabled = function() return not Aptechka.db.profile.useCustomBackgroundColorPower end, + get = function(info) + local r,g,b = unpack(Aptechka.db.profile.customBackgroundColorPower) + return r,g,b + end, + set = function(info, r, g, b) + Aptechka.db.profile.customBackgroundColorPower = {r,g,b} + Aptechka:RefreshAllUnitsColors() + end, + }, nameColorClassColor = { name = L"Use Name Class Color", type = "toggle", diff --git a/frame.lua b/frame.lua index eeb03cf..44de0bb 100644 --- a/frame.lua +++ b/frame.lua @@ -617,6 +617,30 @@ local SetJob_HealthBar = function(self, job, state, contentType, ...) self.bg:SetColor(r2,g2,b2, bgAlpha,mulBG) end end +local SetJob_PowerBar = function(self, job, state, contentType, ...) + local profile = Aptechka.db.profile + local r,g,b,a + local r2,g2,b2 + if contentType == "PowerBar" then + r,g,b = unpack(profile.powerColor) + if profile.useCustomBackgroundColorPower then + r2,g2,b2 = unpack(profile.customBackgroundColorPower) + else + r2,g2,b2 = r,g,b + end + else + local timerType, cur, max, count, icon, text, rC,gC,bC, texture, texCoords, isReversed = NormalizeContent(job, state, contentType, ...) + r,g,b,a = rC,gC,bC,1 + r2,g2,b2 = r,g,b + end + if b then + local mulFG = profile.fgColorMultiplier or 1 + local mulBG = profile.bgColorMultiplier or 0.2 + local bgAlpha = profile.bgAlpha + self:SetColor(r,g,b,a,mulFG) + self.bg:SetColor(r2,g2,b2, bgAlpha,mulBG) + end +end local PowerBar_OnPowerTypeChange = function(powerbar, powerType, isDead) local self = powerbar:GetParent() @@ -3064,7 +3088,7 @@ AptechkaDefaultConfig.GridSkin = function(self) powerbar:SetMinMaxValues(0,100) powerbar:SetOrientation("VERTICAL") -- powerbar:SetStatusBarColor(0.5,0.5,1) - powerbar.SetJob = SetJob_HealthBar + powerbar.SetJob = SetJob_PowerBar powerbar.OnPowerTypeChange = PowerBar_OnPowerTypeChange powerbar.SetColor = HealthBarSetColorFG