Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions DBM-StatusBarTimers/DBT.lua
Original file line number Diff line number Diff line change
Expand Up @@ -848,14 +848,25 @@ function barPrototype:SetVariance()
local varianceTex = _G[frame_name.."BarVariance"]
local varianceTexBorder = _G[frame_name.."BarVarianceBorder"]
if DBT.Options.VarianceEnabled and self.hasVariance then
local varianceWidth = self.frame:GetWidth() * (self.varianceDuration / self.totalTime)
local varianceWidth
local isEnlarged = self.enlarged and not self.paused
if isEnlarged and DBT.Options.BarStyle == "NoAnim" then
local enlargeTime = DBT.Options.EnlargeBarTime or 11
varianceWidth = self.frame:GetWidth() * (self.varianceDuration / enlargeTime)
else
varianceWidth = self.frame:GetWidth() * (self.varianceDuration / self.totalTime)
end

if varianceWidth > self.frame:GetWidth() then
varianceWidth = self.frame:GetWidth()
end

varianceTex:SetWidth(varianceWidth)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove the comment?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed by accident. Only wanted to remove some comments from myself


-- change SetPoints based on fillUpBars
local bar = _G[frame_name.."Bar"]
varianceTex:ClearAllPoints()
varianceTexBorder:ClearAllPoints()
local isEnlarged = self.enlarged and not self.paused
local fillUpBars = isEnlarged and DBT.Options.FillUpLargeBars or not isEnlarged and DBT.Options.FillUpBars

if fillUpBars then
Expand Down Expand Up @@ -975,14 +986,14 @@ function barPrototype:Update(elapsed)
return self:Cancel()
else
if fillUpBars then
if currentStyle == "NoAnim" and timerValue <= enlargeTime and not enlargeHack and not self.varianceDuration then
if currentStyle == "NoAnim" and timerValue <= enlargeTime and not enlargeHack then
-- Simple/NoAnim Bar mimics BW in creating a new bar on large bar anchor instead of just moving the small bar
bar:SetValue(1 - timerValue/(totaltimeValue < enlargeTime and totaltimeValue or enlargeTime))
else
bar:SetValue(1 - timerValue/totaltimeValue)
end
else
if currentStyle == "NoAnim" and timerValue <= enlargeTime and not enlargeHack and not self.varianceDuration then
else
if currentStyle == "NoAnim" and timerValue <= enlargeTime and not enlargeHack then
-- Simple/NoAnim Bar mimics BW in creating a new bar on large bar anchor instead of just moving the small bar
bar:SetValue(timerValue/(totaltimeValue < enlargeTime and totaltimeValue or enlargeTime))
else
Expand Down Expand Up @@ -1073,7 +1084,7 @@ function barPrototype:Update(elapsed)
self:ApplyStyle()
DBT:UpdateBars(true)
end
if not paused and ((barOptions.VarianceEnabled and timerLowestValueFromVariance or timerValue) <= enlargeTime) and not self.small and not isEnlarged and isMoving ~= "enlarge" and enlargeEnabled then
if not paused and timerValue <= enlargeTime and not self.small and not isEnlarged and isMoving ~= "enlarge" and enlargeEnabled then
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, this was intended. The bar starts enlarging at the lowest possible time, not the highest possible.

self:RemoveFromList()
self:Enlarge()
end
Expand Down