diff --git a/WeakAuras/SubRegionTypes/CircularProgressTexture.lua b/WeakAuras/SubRegionTypes/CircularProgressTexture.lua index 3a041a5984..1e77aa9422 100644 --- a/WeakAuras/SubRegionTypes/CircularProgressTexture.lua +++ b/WeakAuras/SubRegionTypes/CircularProgressTexture.lua @@ -55,6 +55,11 @@ local properties = { setter = "SetDesaturated", type = "bool", }, + circularTextureInverse = { + display = L["Inverse"], + setter = "SetInverse", + type = "bool", + }, circularTextureColor = { display = L["Color"], setter = "SetColor", @@ -195,15 +200,24 @@ local funcs = { if progressData.total ~= 0 then progress = progressData.value / progressData.total end + if self.inverse then + progress = 1 - progress + end self.circularTexture:SetProgress(self:ProgressToAngles(progress)) elseif progressData.progressType == "timed" then if progressData.paused then local remaining = self.progressData.remaining local progress = remaining / self.progressData.duration + if self.inverse then + progress = 1 - progress + end self.circularTexture:SetProgress(self:ProgressToAngles(progress)) else local remaining = self.progressData.expirationTime - GetTime() local progress = remaining / self.progressData.duration + if self.inverse then + progress = 1 - progress + end self.circularTexture:SetProgress(self:ProgressToAngles(progress)) end end @@ -220,6 +234,10 @@ local funcs = { self.circularTexture:SetHeight(h) self.circularTexture:UpdateTextures() end, + SetInverse = function(self, inverse) + self.inverse = inverse + self:UpdateFrame() + end } local function create() @@ -265,6 +283,8 @@ local function modify(parent, region, parentData, data, first) region:OnSizeChanged() end + region.inverse = data.circularTextureInverse + Private.CircularProgressTextureBase.modify(region.circularTexture, { crop_x = 1 + data.circularTextureCrop_x, crop_y = 1 + data.circularTextureCrop_y, diff --git a/WeakAurasOptions/SubRegionOptions/CircularProgressTexture.lua b/WeakAurasOptions/SubRegionOptions/CircularProgressTexture.lua index 2a1b20e211..edee31f64f 100644 --- a/WeakAurasOptions/SubRegionOptions/CircularProgressTexture.lua +++ b/WeakAurasOptions/SubRegionOptions/CircularProgressTexture.lua @@ -83,11 +83,11 @@ local function createOptions(parentData, data, index, subIndex) order = 8, values = OptionsPrivate.Private.blend_types }, - space = { - type = "description", - name = "", - order = 8.5, + circularTextureInverse = { + type = "toggle", width = WeakAuras.normalWidth, + name = L["Inverse"], + order = 8.5, }, circularTextureStartAngle = { type = "range",