Quantcast

time report fixed

Steven Jackson [03-12-15 - 01:01]
time report fixed
Filename
SVUI_!Core/system/_reports/time.lua
diff --git a/SVUI_!Core/system/_reports/time.lua b/SVUI_!Core/system/_reports/time.lua
index f093f32..7934ab4 100644
--- a/SVUI_!Core/system/_reports/time.lua
+++ b/SVUI_!Core/system/_reports/time.lua
@@ -91,42 +91,6 @@ local function CalculateTimeValues(tooltip)
 		return ConvertTime(dateTable["hour"], dateTable["min"])
 	end
 end
-
-local int = 3
-local Time_OnUpdate = function(self, t)
-	int = int - t
-
-	if int > 0 then return end
-
-	if GameTimeFrame.flashInvite then
-		SV.Animate:Flash(self, 0.53)
-	else
-		SV.Animate:StopFlash(self)
-	end
-
-	if enteredFrame then
-		OnEnter(self)
-	end
-
-	local Hr, Min, AmPm = CalculateTimeValues(false)
-
-	-- no update quick exit
-	if (Hr == curHr and Min == curMin and AmPm == curAmPm) and not (int < -15000) then
-		int = 5
-		return
-	end
-
-	curHr = Hr
-	curMin = Min
-	curAmPm = AmPm
-
-	if AmPm == -1 then
-		self.text:SetFormattedText(TEXT_PATTERN1, Hr, Min)
-	else
-		self.text:SetFormattedText(TEXT_PATTERN2, Hr, Min, APM[AmPm])
-	end
-	int = 5
-end
 --[[
 ##########################################################
 REPORT TEMPLATE
@@ -234,4 +198,40 @@ Report.OnLeave = function(self, button)
 	enteredFrame = false;
 end

+local int = 3
+local Time_OnUpdate = function(self, t)
+	int = int - t
+
+	if int > 0 then return end
+
+	if GameTimeFrame.flashInvite then
+		SV.Animate:Flash(self, 0.53)
+	else
+		SV.Animate:StopFlash(self)
+	end
+
+	if enteredFrame then
+		Report.OnEnter(self)
+	end
+
+	local Hr, Min, AmPm = CalculateTimeValues(false)
+
+	-- no update quick exit
+	if (Hr == curHr and Min == curMin and AmPm == curAmPm) and not (int < -15000) then
+		int = 5
+		return
+	end
+
+	curHr = Hr
+	curMin = Min
+	curAmPm = AmPm
+
+	if AmPm == -1 then
+		self.text:SetFormattedText(TEXT_PATTERN1, Hr, Min)
+	else
+		self.text:SetFormattedText(TEXT_PATTERN2, Hr, Min, APM[AmPm])
+	end
+	int = 5
+end
+
 Report.OnUpdate = Time_OnUpdate
\ No newline at end of file