diff --git a/WeakAuras/RegionTypes/ProgressTexture.lua b/WeakAuras/RegionTypes/ProgressTexture.lua index 488b5df..36d41a7 100644 --- a/WeakAuras/RegionTypes/ProgressTexture.lua +++ b/WeakAuras/RegionTypes/ProgressTexture.lua @@ -163,14 +163,6 @@ WeakAuras.regionPrototype.AddProperties(properties, default); local spinnerFunctions = {}; -function spinnerFunctions.SetWidth(self, width) - self.wedge:SetWidth(width); -end - -function spinnerFunctions.SetHeight(self, height) - self.wedge:SetHeight(height); -end - function spinnerFunctions.SetTexture(self, texture) for i = 1, 4 do self.circularTextures[i]:SetTexture(texture); @@ -203,6 +195,14 @@ function spinnerFunctions.Hide(self) self.wedge:Hide(); end +function spinnerFunctions.SetWidth(self, width) + self.wedge:SetWidth(width); +end + +function spinnerFunctions.SetHeight(self, height) + self.wedge:SetHeight(height); +end + function spinnerFunctions.Color(self, r, g, b, a) for i = 1, 4 do self.circularTextures[i]:SetVertexColor(r, g, b, a); @@ -238,9 +238,7 @@ local function animRotate(object, degrees, anchor, regionRotate, aspect) -- Create AnimationGroup and rotation animation if (not object.animationGroup) then object.animationGroup = object:CreateAnimationGroup(); - object.animationGroup:SetScript("OnUpdate", function() - Transform(object, -0.5, -0.5, -object.degrees + object.regionRotate, object.aspect) - end); + object.animationGroup:SetLooping("REPEAT") end object.animationGroup.rotate = object.animationGroup.rotate or object.animationGroup:CreateAnimation("rotation"); @@ -249,12 +247,13 @@ local function animRotate(object, degrees, anchor, regionRotate, aspect) rotate:SetOrigin(anchor, 0, 0); rotate:SetDegrees(degrees); rotate:SetDuration( 0 ); - rotate:SetEndDelay(900); -- 2147483647 + rotate:SetEndDelay(15); -- 2147483647 + Transform(object, -0.5, -0.5, -degrees + regionRotate, aspect) object.animationGroup:Play(); end function spinnerFunctions.SetProgress(self, region, startAngle, endAngle, progress, clockwise) - local pAngle = progress * (endAngle - startAngle) + startAngle; + local pAngle = (endAngle - startAngle) * progress + startAngle; -- Show/hide necessary textures if we need to for i = 1, 4 do @@ -638,7 +637,13 @@ local function modify(parent, region, data) function region:SetValue(progress) progress = progress or 0; region.progress = progress; - + if (progress < 0) then + progress = 0; + end + + if (progress > 1) then + progress = 1; + end foregroundSpinner:SetProgress(region, startAngle, endAngle, progress, clockwise); end end diff --git a/WeakAurasOptions/RegionOptions/ProgressTexture.lua b/WeakAurasOptions/RegionOptions/ProgressTexture.lua index ddf651d..5016db5 100644 --- a/WeakAurasOptions/RegionOptions/ProgressTexture.lua +++ b/WeakAurasOptions/RegionOptions/ProgressTexture.lua @@ -411,21 +411,8 @@ local function createThumbnail() local foreground = region:CreateTexture(nil, "ART"); borderframe.foreground = foreground; - local OrgSetTexture = foreground.SetTexture; - -- WORKAROUND, setting the same texture with a different wrap mode does not change the wrap mode - foreground.SetTexture = function(self, texture, horWrapMode, verWrapMode) - local needToClear = (self.horWrapMode and self.horWrapMode ~= horWrapMode) or (self.verWrapMode and self.verWrapMode ~= verWrapMode); - self.horWrapMode = horWrapMode; - self.verWrapMode = verWrapMode; - if (needToClear) then - OrgSetTexture(self, nil); - end - OrgSetTexture(self, texture, horWrapMode, verWrapMode); - end - background.SetTexture = foreground.SetTexture; - - borderframe.backgroundSpinner = WeakAuras.createSpinner(region, "BACKGROUND", 1); - borderframe.foregroundSpinner = WeakAuras.createSpinner(region, "ARTWORK", 1); + borderframe.foregroundSpinner = WeakAuras.createSpinner(region, "ARTWORK", region:GetFrameLevel() + 2); + borderframe.backgroundSpinner = WeakAuras.createSpinner(region, "BACKGROUND", region:GetFrameLevel() + 1); return borderframe; end