Quantcast

Manipulate the Ovale trace/bug flags more accurately.

Johnny C. Lam [07-18-14 - 18:51]
Manipulate the Ovale trace/bug flags more accurately.

Add a new method ResetTrace() that resets the trace/bug state and is
called prior to a script being compiled.

Rename the PostRefresh() method to "UpdateTrace" to more accurately
reflect its actions.
Filename
Ovale.lua
OvaleCompile.lua
OvaleFrame.lua
diff --git a/Ovale.lua b/Ovale.lua
index dad6c31..b0ce159 100644
--- a/Ovale.lua
+++ b/Ovale.lua
@@ -284,7 +284,13 @@ function Ovale:UpdateFrame()
 	self:UpdateVisibility()
 end

-function Ovale:PostRefresh()
+function Ovale:ResetTrace()
+	self.trace = false
+	self_traced = false
+	self_bug = false
+end
+
+function Ovale:UpdateTrace()
 	-- If trace flag is set here, then flag that we just traced one frame.
 	if self.trace then
 		self_traced = true
diff --git a/OvaleCompile.lua b/OvaleCompile.lua
index 19844dd..ad9a4be 100644
--- a/OvaleCompile.lua
+++ b/OvaleCompile.lua
@@ -461,6 +461,8 @@ function OvaleCompile:EventHandler(event)
 end

 function OvaleCompile:CompileScript(event)
+	-- Reset the trace state if we compile a new script.
+	Ovale:ResetTrace()
 	-- Compile the selected script from the profile.
 	local profile = OvaleOptions:GetProfile()
 	local source = profile.source
diff --git a/OvaleFrame.lua b/OvaleFrame.lua
index f49dc05..adcc00d 100644
--- a/OvaleFrame.lua
+++ b/OvaleFrame.lua
@@ -282,7 +282,7 @@ do
 		end

 		wipe(Ovale.refreshNeeded)
-		Ovale:PostRefresh()
+		Ovale:UpdateTrace()
 		Ovale:PrintOneTimeMessages()
 	end