make sure fadeout behaves correctly with locking and changing the bar alpha
This commit is contained in:
@@ -291,6 +291,11 @@ function Bar:Unlock()
|
|||||||
else
|
else
|
||||||
self.overlay:SetBackdropColor(0, 1, 0, 0.5)
|
self.overlay:SetBackdropColor(0, 1, 0, 0.5)
|
||||||
end
|
end
|
||||||
|
if self.config.fadeout then
|
||||||
|
self:SetScript("OnUpdate", nil)
|
||||||
|
self.faded = nil
|
||||||
|
self:SetConfigAlpha()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Bar:Lock()
|
function Bar:Lock()
|
||||||
@@ -301,6 +306,8 @@ function Bar:Lock()
|
|||||||
self:ConfigureShowStates()
|
self:ConfigureShowStates()
|
||||||
|
|
||||||
self.overlay:Hide()
|
self.overlay:Hide()
|
||||||
|
|
||||||
|
self:SetFadeOut()
|
||||||
end
|
end
|
||||||
|
|
||||||
function Bar:LoadPosition()
|
function Bar:LoadPosition()
|
||||||
@@ -369,7 +376,9 @@ function Bar:SetConfigAlpha(alpha)
|
|||||||
if alpha then
|
if alpha then
|
||||||
self.config.alpha = alpha
|
self.config.alpha = alpha
|
||||||
end
|
end
|
||||||
self:SetAlpha(self.config.alpha)
|
if not self.faded then
|
||||||
|
self:SetAlpha(self.config.alpha)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Bar:GetConfigScale()
|
function Bar:GetConfigScale()
|
||||||
@@ -394,8 +403,11 @@ function Bar:SetFadeOut(fadeout)
|
|||||||
end
|
end
|
||||||
if self.config.fadeout then
|
if self.config.fadeout then
|
||||||
self:SetScript("OnUpdate", barOnUpdateFunc)
|
self:SetScript("OnUpdate", barOnUpdateFunc)
|
||||||
|
self:ControlFadeOut()
|
||||||
else
|
else
|
||||||
self:SetScript("OnUpdate", nil)
|
self:SetScript("OnUpdate", nil)
|
||||||
|
self.faded = nil
|
||||||
|
self:SetConfigAlpha()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user