from retail
This commit is contained in:
@@ -1125,7 +1125,12 @@ local function modify(parent, region, data)
|
||||
end
|
||||
|
||||
-- Update texture settings
|
||||
local texturePath = SharedMedia:Fetch("statusbar", data.texture) or "";
|
||||
local texturePath
|
||||
if data.textureSource == "Picker" then
|
||||
texturePath = data.textureInput or ""
|
||||
else
|
||||
texturePath = SharedMedia:Fetch("statusbar", data.texture) or "";
|
||||
end
|
||||
bar:SetStatusBarTexture(texturePath);
|
||||
bar:SetBackgroundColor(data.backgroundColor[1], data.backgroundColor[2], data.backgroundColor[3], data.backgroundColor[4]);
|
||||
-- Update spark settings
|
||||
|
||||
@@ -631,6 +631,7 @@ local function modify(parent, region, data)
|
||||
region.UpdateTime = nil
|
||||
|
||||
function region:Update()
|
||||
region:UpdateProgress()
|
||||
region:UpdateIcon()
|
||||
end
|
||||
end
|
||||
|
||||
@@ -476,13 +476,14 @@ local function FrameTick(self)
|
||||
if (duration ~= 0) then
|
||||
local remaining = expirationTime - GetTime();
|
||||
progress = remaining / duration;
|
||||
local inversed = (not inverse and self.inverseDirection) or (inverse and not self.inverseDirection);
|
||||
local inversed = not inverse ~= not self.inverseDirection
|
||||
if(inversed) then
|
||||
progress = 1 - progress;
|
||||
end
|
||||
end
|
||||
|
||||
progress = progress > 0.0001 and progress or 0.0001;
|
||||
|
||||
if (self.useSmoothProgress) then
|
||||
self.smoothProgress:SetSmoothedValue(progress);
|
||||
else
|
||||
@@ -861,12 +862,13 @@ local function modify(parent, region, data)
|
||||
|
||||
region:Color(data.foregroundColor[1], data.foregroundColor[2], data.foregroundColor[3], data.foregroundColor[4]);
|
||||
|
||||
|
||||
function region:UpdateTime()
|
||||
local progress = 1;
|
||||
if (self.duration ~= 0) then
|
||||
local remaining = self.expirationTime - GetTime()
|
||||
progress = remaining / self.duration
|
||||
local inversed = self.inverse ~= region.inverseDirection
|
||||
local inversed = not self.inverse ~= not region.inverseDirection
|
||||
if(inversed) then
|
||||
progress = 1 - progress;
|
||||
end
|
||||
|
||||
@@ -379,8 +379,10 @@ local function UpdateProgressFromState(self, minMaxConfig, state, progressSource
|
||||
local pausedProperty = progressSource[6]
|
||||
local remainingProperty = progressSource[7]
|
||||
if progressType == "number" then
|
||||
local value = state[property] or 0
|
||||
local total = totalProperty and state[totalProperty] or 0
|
||||
local value = state[property]
|
||||
if type(value) ~= "number" then value = 0 end
|
||||
local total = totalProperty and state[totalProperty]
|
||||
if type(total) ~= "number" then total = 0 end
|
||||
-- We don't care about inverse or paused
|
||||
local adjustMin
|
||||
if minMaxConfig.adjustedMin then
|
||||
@@ -415,9 +417,12 @@ local function UpdateProgressFromState(self, minMaxConfig, state, progressSource
|
||||
local remaining
|
||||
if paused then
|
||||
remaining = remainingProperty and state[remainingProperty]
|
||||
expirationTime = GetTime() + (remaining or 0)
|
||||
expirationTime = GetTime() + (type(remaining) == "number" and remaining or 0)
|
||||
else
|
||||
expirationTime = state[property] or math.huge
|
||||
expirationTime = state[property]
|
||||
if type(expirationTime) ~= "number" then
|
||||
expirationTime = math.huge
|
||||
end
|
||||
end
|
||||
local duration = totalProperty and state[totalProperty] or 0
|
||||
local adjustMin
|
||||
|
||||
@@ -181,6 +181,7 @@ local function modify(parent, region, data)
|
||||
if region.state.texture then
|
||||
region.texture:SetTexture(region.state.texture);
|
||||
end
|
||||
region:UpdateProgress()
|
||||
end
|
||||
|
||||
function region:Color(r, g, b, a)
|
||||
|
||||
Reference in New Issue
Block a user