Quantcast

Saves debug status between sessions

BillLive [01-26-16 - 04:10]
Saves debug status between sessions
Filename
Elementarist.lua
diff --git a/Elementarist.lua b/Elementarist.lua
index 4963a49..2411110 100755
--- a/Elementarist.lua
+++ b/Elementarist.lua
@@ -33,7 +33,6 @@ Elementarist.lastPersonTablePurged = 0.0;
 Elementarist.configPanel = nil
 Elementarist.prevDB = {}
 Elementarist.DPSTable = {}
-Elementarist.DebugMode = false
 Elementarist.DebugChat = DEFAULT_CHAT_FRAME
 Elementarist.inParty = 0
 Elementarist.OmniCC = _G['OmniCC']
@@ -171,7 +170,7 @@ Elementarist.eventFrame:RegisterEvent("PLAYER_EQUIPMENT_CHANGED");
 Elementarist.events = {}

 function Elementarist:Debug(statictxt,msg)
-	if (Elementarist.DebugMode) and (Elementarist.DebugChat) then
+	if (ElementaristDB.DebugMode) and (Elementarist.DebugChat) then
 		if (msg) then
 			Elementarist.DebugChat:AddMessage( statictxt  .. " : " .. msg)
 		else
@@ -252,12 +251,12 @@ function Elementarist.events.ADDON_LOADED(addon)
 	-- add slash command
 	SlashCmdList["Elementarist"] = function(msg)
 		if (msg=='debug') then
-			if (Elementarist.DebugMode) then
+			if (ElementaristDB.DebugMode) then
 				Elementarist:Debug("Debug ended", GetTime())
 			end
-			Elementarist.DebugMode = not ( Elementarist.DebugMode )
+			ElementaristDB.DebugMode = not ( ElementaristDB.DebugMode )
 			local debugStatus = "disabled"
-			if (Elementarist.DebugMode) then
+			if (ElementaristDB.DebugMode) then
 				Elementarist.DebugChat = Elementarist:GetDebugFrame()
 				debugStatus = "enabled. Using frame: " .. Elementarist.DebugChat:GetID()
 				Elementarist:Debug("Debug started", GetTime())
@@ -360,6 +359,7 @@ function Elementarist:InitSettings()
 	if not ElementaristDB.debuffy then ElementaristDB.debuffy = -100 end
 	if not ElementaristDB.debuffrelativePoint then ElementaristDB.debuffrelativePoint = "CENTER" end
 	if not ElementaristDB.shieldrelativePoint then ElementaristDB.shieldrelativePoint = "CENTER" end
+	if not ElementaristDB.DebugMode then ElementaristDB.DebugMode = false end
 end

 function Elementarist:HasSetBonus(spellID,minCount)