Shaladownlands Launch
This commit is contained in:
+20
-16
@@ -534,14 +534,14 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local OnMouseDown = function (frame, button)
|
||||
local capsule = frame.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnMouseDown", frame, button, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
if (not frame.MyObject.container.isLocked and frame.MyObject.container:IsMovable()) then
|
||||
if (not frame.isLocked and frame:IsMovable()) then
|
||||
frame.MyObject.container.isMoving = true
|
||||
@@ -549,14 +549,14 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local OnMouseUp = function (frame, button)
|
||||
local capsule = frame.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnMouseUp", frame, button, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
if (frame.MyObject.container.isMoving) then
|
||||
frame.MyObject.container:StopMovingOrSizing()
|
||||
frame.MyObject.container.isMoving = false
|
||||
@@ -565,14 +565,14 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--> timer
|
||||
|
||||
|
||||
function BarMetaFunctions:OnTimerEnd()
|
||||
local capsule = self
|
||||
local kill = capsule:RunHooksForWidget ("OnTimerEnd", self.widget, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
self.timer_texture:Hide()
|
||||
self.timer_textureR:Hide()
|
||||
self.div_timer:Hide()
|
||||
@@ -580,7 +580,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
|
||||
self.timer = false
|
||||
end
|
||||
|
||||
function BarMetaFunctions:CancelTimerBar (no_timer_end)
|
||||
function BarMetaFunctions:CancelTimerBar(no_timer_end)
|
||||
if (not self.HasTimer) then
|
||||
return
|
||||
end
|
||||
@@ -592,7 +592,11 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
|
||||
self.statusbar:SetScript ("OnUpdate", nil)
|
||||
end
|
||||
end
|
||||
|
||||
self.righttext = ""
|
||||
self.timer_texture:Hide()
|
||||
self.timer_textureR:Hide()
|
||||
|
||||
if (not no_timer_end) then
|
||||
self:OnTimerEnd()
|
||||
end
|
||||
@@ -601,6 +605,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
|
||||
local OnUpdate = function (self, elapsed)
|
||||
--> percent of elapsed
|
||||
local pct = abs (self.end_timer - GetTime() - self.tempo) / self.tempo
|
||||
|
||||
if (self.inverse) then
|
||||
self.t:SetWidth (self.total_size * pct)
|
||||
else
|
||||
@@ -624,7 +629,6 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
|
||||
end
|
||||
|
||||
function BarMetaFunctions:SetTimer (tempo, end_at)
|
||||
|
||||
if (end_at) then
|
||||
self.statusbar.tempo = end_at - tempo
|
||||
self.statusbar.remaining = end_at - GetTime()
|
||||
@@ -637,13 +641,13 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
|
||||
|
||||
self.statusbar.total_size = self.statusbar:GetWidth()
|
||||
self.statusbar.inverse = self.BarIsInverse
|
||||
|
||||
self (0)
|
||||
|
||||
|
||||
self(0)
|
||||
|
||||
self.div_timer:Show()
|
||||
self.background:Show()
|
||||
self:Show()
|
||||
|
||||
|
||||
if (self.LeftToRight) then
|
||||
self.timer_texture:Hide()
|
||||
self.timer_textureR:Show()
|
||||
@@ -659,19 +663,19 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
|
||||
self.timer_texture:SetPoint ("left", self.statusbar, "left")
|
||||
self.div_timer:SetPoint ("left", self.timer_texture, "right", -16, -1)
|
||||
end
|
||||
|
||||
|
||||
if (self.BarIsInverse) then
|
||||
self.statusbar.t:SetWidth (1)
|
||||
else
|
||||
self.statusbar.t:SetWidth (self.statusbar.total_size)
|
||||
end
|
||||
|
||||
|
||||
self.timer = true
|
||||
|
||||
|
||||
self.HasTimer = true
|
||||
self.TimerScheduled = DF:ScheduleTimer ("StartTimeBarAnimation", 0.1, self)
|
||||
end
|
||||
|
||||
|
||||
function DF:StartTimeBarAnimation (timebar)
|
||||
timebar.TimerScheduled = nil
|
||||
timebar.statusbar:SetScript ("OnUpdate", OnUpdate)
|
||||
|
||||
Reference in New Issue
Block a user