Quantcast

quick patches and new debugger

Munglunch [08-28-14 - 19:20]
quick patches and new debugger
Filename
Interface/AddOns/SVUI/SVUI.lua
Interface/AddOns/SVUI/packages/unit/elements/castbar.lua
Interface/AddOns/SVUI/system/database.lua
Interface/AddOns/SVUI/system/system.lua
Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua
Interface/AddOns/SVUI_StyleOMatic/addons/calendar.lua
diff --git a/Interface/AddOns/SVUI/SVUI.lua b/Interface/AddOns/SVUI/SVUI.lua
index d00ca9e..17249a6 100644
--- a/Interface/AddOns/SVUI/SVUI.lua
+++ b/Interface/AddOns/SVUI/SVUI.lua
@@ -595,6 +595,7 @@ SVUI.fubar = function() return end
 SVUI.class = select(2,UnitClass("player"));
 SVUI.ClassRole = "";
 SVUI.ConfigurationMode = false;
+SVUI.DebuggingMode = false
 --[[ MISC ]]--

 --[[ UTILITY FRAMES ]]--
diff --git a/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua b/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua
index f5ab9a0..9953a30 100644
--- a/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua
+++ b/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua
@@ -57,7 +57,7 @@ local ticks = {}
 local function SpellName(id)
 	local name, _, _, _, _, _, _, _, _ = GetSpellInfo(id)
 	if not name then
-		print('|cffFF9900SVUI:|r Spell not found: (#ID) '..id)
+		SuperVillain:Debugger('|cffFF9900SVUI:|r Spell not found: (#ID) '..id)
 		name = "Voodoo Doll";
 	end
 	return name
diff --git a/Interface/AddOns/SVUI/system/database.lua b/Interface/AddOns/SVUI/system/database.lua
index 6383a4e..a5c802a 100644
--- a/Interface/AddOns/SVUI/system/database.lua
+++ b/Interface/AddOns/SVUI/system/database.lua
@@ -171,7 +171,7 @@ DB BUILD HELPERS
 local function SpellName(id)
 	local name, _, _, _, _, _, _, _, _ = GetSpellInfo(id)
 	if not name then
-		print('|cffFF9900SVUI:|r Spell not found: (#ID) '..id)
+		SuperVillain:Debugger('|cffFF9900SVUI:|r Spell not found: (#ID) '..id)
 		name = "Voodoo Doll";
 	end
 	return name
@@ -836,7 +836,7 @@ local function safename(id)
 		if type(id) == "string" then
 			n = id
 		else
-			print('|cffFF9900SVUI:|r Spell not found: (#ID) '..id)
+			SuperVillain:Debugger('|cffFF9900SVUI:|r Spell not found: (#ID) '..id)
 			n = "Voodoo Doll";
 		end
 	end
diff --git a/Interface/AddOns/SVUI/system/system.lua b/Interface/AddOns/SVUI/system/system.lua
index 877b253..e4204e9 100644
--- a/Interface/AddOns/SVUI/system/system.lua
+++ b/Interface/AddOns/SVUI/system/system.lua
@@ -176,6 +176,12 @@ local function SendAddonMessage(msg, prefix)
     end
 end

+function SuperVillain:Debugger(msg)
+	if(not self.DebuggingMode) then return end
+    local outbound = ("|cffFF2F00%s:|r |cff992FFF%s:|r"):format("SVUI", "DEBUG")
+    SendAddonMessage(msg, outbound)
+end
+
 function SuperVillain:AddonMessage(msg)
     local outbound = ("|cffFF2F00%s:|r"):format("SVUI")
     SendAddonMessage(msg, outbound)
diff --git a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua
index c0e741c..2dce07f 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua
@@ -74,14 +74,14 @@ PLUGIN.OptionsCache = {
 			name = "Ace3"
 		},
 	}
-};
-PLUGIN.Debugging = false
+}
 --[[
 ##########################################################
 CORE FUNCTIONS
 ##########################################################
 ]]--
 local charming = {"Spiffy", "Pimped Out", "Fancy", "Awesome", "Bad Ass", "Sparkly", "Gorgeous", "Handsome", "Shiny"}
+local errorMessage = '%s: |cffff0000There was an error in the|r |cff0affff%s|r |cffff0000skin|r. |cffFF0000[[|r%s|cffFF0000]]|r'
 local styleMessage = '|cff00FF77%s|r Is Now %s!'

 local function SendAddonMessage(msg, prefix)
@@ -118,12 +118,7 @@ function PLUGIN:Style(style, fn, ...)
 		local verb = charming[math.random(1,#charming)]
 		self:AddonMessage(styleMessage:format(style, verb))
 	else
-		if self.Debugging then
-			local message = '%s: |cffff0000There was an error in the|r |cff0affff%s|r |cffff0000skin|r.'
-			SuperVillain:AddonMessage(message:format(version, style))
-			local errormessage = '%s Error: %s'
-			SuperVillain:AddonMessage(errormessage:format(style, error))
-		end
+		SuperVillain:Debugger(errorMessage:format(version, style, error))
 	end
 end

diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/calendar.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/calendar.lua
index 20c48c5..b3a2f40 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/addons/calendar.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/addons/calendar.lua
@@ -34,33 +34,39 @@ CALENDAR STYLER
 local function CalendarStyle()
 	if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.calendar ~= true then
 		 return
-	end;
+	end
 	_G["CalendarFrame"]:Formula409()
 	CalendarFrame:SetPanelTemplate("Halftone")
 	STYLE:ApplyCloseButtonStyle(CalendarCloseButton)
 	CalendarCloseButton:Point("TOPRIGHT", CalendarFrame, "TOPRIGHT", -4, -4)
 	STYLE:ApplyPaginationStyle(CalendarPrevMonthButton)
 	STYLE:ApplyPaginationStyle(CalendarNextMonthButton)
+
 	do
-		local d = CalendarFilterFrame;
-		local e = CalendarFilterButton;
-		d:Formula409()
-		d:Width(155)
-		_G[d:GetName().."Text"]:ClearAllPoints()
-		_G[d:GetName().."Text"]:Point("RIGHT", e, "LEFT", -2, 0)
-		e:ClearAllPoints()
-		e:Point("RIGHT", d, "RIGHT", -10, 3)
-		hooksecurefunc(e, "SetPoint", function(f, g, h, i, j, k)
-			if g ~= "RIGHT"or h ~= d or i ~= "RIGHT"or j ~= -10 or k ~= 3 then
-				 f:ClearAllPoints()
-				 f:Point("RIGHT", d, "RIGHT", -10, 3)
-			end
-		end)
-		STYLE:ApplyPaginationStyle(e, true)
-		d:SetPanelTemplate("Default")
-		d.Panel:Point("TOPLEFT", 20, 2)
-		d.Panel:Point("BOTTOMRIGHT", e, "BOTTOMRIGHT", 2, -2)
-	end;
+		local cfframe = _G["CalendarFilterFrame"];
+
+		if(cfframe) then
+			cfframe:Formula409()
+			cfframe:Width(155)
+			cfframe:SetPanelTemplate("Default")
+
+			local cftext = _G["CalendarFilterFrameText"]
+			if(cftext) then
+				cftext:ClearAllPoints()
+				cftext:Point("RIGHT", cfbutton, "LEFT", -2, 0)
+			end
+
+			local cfbutton = _G["CalendarFilterButton"];
+			if(cfbutton) then
+				cfbutton:ClearAllPoints()
+				cfbutton:Point("RIGHT", cfframe, "RIGHT", -10, 3)
+				STYLE:ApplyPaginationStyle(cfbutton, true)
+				cfframe.Panel:Point("TOPLEFT", 20, 2)
+				cfframe.Panel:Point("BOTTOMRIGHT", cfbutton, "BOTTOMRIGHT", 2, -2)
+			end
+		end
+	end
+
 	local l = CreateFrame("Frame", "CalendarFrameBackdrop", CalendarFrame)
 	l:SetFixedPanelTemplate("Default")
 	l:Point("TOPLEFT", 10, -72)
@@ -78,7 +84,7 @@ local function CalendarStyle()
 	end)
 	for u = 1, 42 do
 		 _G["CalendarDayButton"..u]:SetFrameLevel(_G["CalendarDayButton"..u]:GetFrameLevel()+1)
-	end;
+	end
 	CalendarCreateEventFrame:Formula409()
 	CalendarCreateEventFrame:SetFixedPanelTemplate("Transparent", true)
 	CalendarCreateEventFrame:Point("TOPLEFT", CalendarFrame, "TOPRIGHT", 3, -24)
@@ -117,7 +123,7 @@ local function CalendarStyle()
 			local F = e:GetNormalTexture()
 			F:SetTexture("Interface\\Glues\\CharacterCreate\\UI-CharacterCreate-Classes")
 			F:SetTexCoord(E[1]+0.015, E[2]-0.02, E[3]+0.018, E[4]-0.02)
-		end;
+		end
 		CalendarClassButton1:Point("TOPLEFT", CalendarClassButtonContainer, "TOPLEFT", 5, 0)
 		CalendarClassTotalsButton:Formula409()
 		CalendarClassTotalsButton:SetPanelTemplate("Default")
@@ -161,7 +167,7 @@ local function CalendarStyle()
 	STYLE:ApplyScrollStyle(CalendarViewEventInviteListScrollFrameScrollBar)
 	for _,btn in pairs(CalendarButtons)do
 		 _G[btn]:SetButtonTemplate()
-	end;
+	end
 	CalendarEventPickerFrame:Formula409()
 	CalendarEventPickerTitleFrame:Formula409()
 	CalendarEventPickerFrame:SetFixedPanelTemplate("Transparent", true)
@@ -170,7 +176,7 @@ local function CalendarStyle()
 	STYLE:ApplyScrollStyle(CalendarCreateEventDescriptionScrollFrameScrollBar)
 	STYLE:ApplyScrollStyle(CalendarCreateEventInviteListScrollFrameScrollBar)
 	STYLE:ApplyScrollStyle(CalendarViewEventDescriptionScrollFrameScrollBar)
-end;
+end
 --[[
 ##########################################################
 STYLE LOADING