Quantcast

fixing current issues

Munglunch [08-28-14 - 19:10]
fixing current issues
Filename
Interface/AddOns/SVUI/SVUI.lua
Interface/AddOns/SVUI/packages/bag/SVBag.lua
Interface/AddOns/SVUI/packages/stats/stats/guild.lua
Interface/AddOns/SVUI/packages/unit/elements/castbar.lua
Interface/AddOns/SVUI/scripts/questwatch.lua
Interface/AddOns/SVUI/scripts/raid.lua
Interface/AddOns/SVUI/system/database.lua
Interface/AddOns/SVUI/system/installer.lua
Interface/AddOns/SVUI/system/mentalo.lua
Interface/AddOns/SVUI/system/system.lua
Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua
Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.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/bag/SVBag.lua b/Interface/AddOns/SVUI/packages/bag/SVBag.lua
index 364ecfb..12bf448 100644
--- a/Interface/AddOns/SVUI/packages/bag/SVBag.lua
+++ b/Interface/AddOns/SVUI/packages/bag/SVBag.lua
@@ -173,11 +173,13 @@ local function BuildEquipmentMap()
 		gearSet = GetEquipmentSetLocations(set);
 		if(gearSet) then
 			for key, location in pairs(gearSet)do
-				player, bank, bags, _, index, bag = EquipmentManager_UnpackLocation(location);
-				if((bank or bags) and (index and bag)) then
-					loc = format("%d_%d", bag, index);
-					gearList[loc] = (gearList[loc] or {});
-					tinsert(gearList[loc], set);
+				if(type(location) ~= "string") then
+					player, bank, bags, _, index, bag = EquipmentManager_UnpackLocation(location);
+					if((bank or bags) and (index and bag)) then
+						loc = format("%d_%d", bag, index);
+						gearList[loc] = (gearList[loc] or {});
+						tinsert(gearList[loc], set);
+					end
 				end
 			end
 		end
diff --git a/Interface/AddOns/SVUI/packages/stats/stats/guild.lua b/Interface/AddOns/SVUI/packages/stats/stats/guild.lua
index e7d2370..a3a9734 100644
--- a/Interface/AddOns/SVUI/packages/stats/stats/guild.lua
+++ b/Interface/AddOns/SVUI/packages/stats/stats/guild.lua
@@ -255,11 +255,10 @@ local function Guild_OnEnter(self, _, ap)
 	local aq, ar = GetNumGuildMembers()
 	if #GuildStatMembers == 0 then GetGuildStatMembers() end;
 	SortGuildStatMembers(IsShiftKeyDown())
-	local as, at = GetGuildInfo('player')
-	local au = GetGuildLevel()
-	if as and at and au then
-		MOD.tooltip:AddDoubleLine(("%s [%d]"):format(as, au), guildFormattedName:format(GUILD, ar, aq), 0.4, 0.78, 1, 0.4, 0.78, 1)
-		MOD.tooltip:AddLine(at, 0.4, 0.78, 1)
+	local guildName, guildRankName, guildRankIndex = GetGuildInfo('player')
+	if guildName and guildRankName then
+		MOD.tooltip:AddDoubleLine(("%s "):format(guildName), guildFormattedName:format(GUILD, ar, aq), 0.4, 0.78, 1, 0.4, 0.78, 1)
+		MOD.tooltip:AddLine(guildRankName, 0.4, 0.78, 1)
 	end;
 	if GuildStatMOTD ~= "" then
 		MOD.tooltip:AddLine(' ')
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/scripts/questwatch.lua b/Interface/AddOns/SVUI/scripts/questwatch.lua
index 2249de9..a998db5 100644
--- a/Interface/AddOns/SVUI/scripts/questwatch.lua
+++ b/Interface/AddOns/SVUI/scripts/questwatch.lua
@@ -69,7 +69,7 @@ PRE VARS/FUNCTIONS
 ##########################################################
 ]]--

--- DO STUFF
+--[[NEEDS TESTING]]--

 --[[
 ##########################################################
diff --git a/Interface/AddOns/SVUI/scripts/raid.lua b/Interface/AddOns/SVUI/scripts/raid.lua
index afd86e4..253d144 100644
--- a/Interface/AddOns/SVUI/scripts/raid.lua
+++ b/Interface/AddOns/SVUI/scripts/raid.lua
@@ -236,6 +236,7 @@ local function LoadRaidUtility()
 	CompactRaidFrameManagerDisplayFrameLeaderOptionsInitiateRolePoll:SetPoint("BOTTOMRIGHT", CompactRaidFrameManagerDisplayFrameLeaderOptionsInitiateReadyCheck, "TOPRIGHT", 0, 1)

 	do
+		--[[NEEDS TESTING]]--
 		local buttons = {
 			"CompactRaidFrameManagerDisplayFrameLeaderOptionsRaidWorldMarkerButton",
 			"DisbandRaidButton",
@@ -246,15 +247,17 @@ local function LoadRaidUtility()
 			"RaidUtility_CloseButton"
 		}

-		for i, button in pairs(buttons) do
-			local f = _G[button]
-			_G[button.."Left"]:SetAlpha(0)
-			_G[button.."Middle"]:SetAlpha(0)
-			_G[button.."Right"]:SetAlpha(0)
-			f:Formula409()
-			f:SetFramedButtonTemplate()
-			f:HookScript("OnEnter", ButtonEnter)
-			f:HookScript("OnLeave", ButtonLeave)
+		for i, gName in pairs(buttons) do
+			local button = _G[gName]
+			if(button) then
+				_G[gName.."Left"]:SetAlpha(0)
+				_G[gName.."Middle"]:SetAlpha(0)
+				_G[gName.."Right"]:SetAlpha(0)
+				button:Formula409()
+				button:SetFramedButtonTemplate()
+				button:HookScript("OnEnter", ButtonEnter)
+				button:HookScript("OnLeave", ButtonLeave)
+			end
 		end
 	end
 end
diff --git a/Interface/AddOns/SVUI/system/database.lua b/Interface/AddOns/SVUI/system/database.lua
index 6383a4e..aa05e19 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
@@ -266,7 +266,7 @@ CONFIGS["media"] = {
 			["absorbs"] 		 = {1, 1, 0, 0.25}
 		},
 		["spellcolor"] = {
-			[SpellName(2825)] = {0.98, 0.57, 0.11}, 	--Bloodlust
+			[SpellName(2825)]  = {0.98, 0.57, 0.11}, --Bloodlust
 			[SpellName(32182)] = {0.98, 0.57, 0.11}, --Heroism
 			[SpellName(80353)] = {0.98, 0.57, 0.11}, --Time Warp
 			[SpellName(90355)] = {0.98, 0.57, 0.11}, --Ancient Hysteria
@@ -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/installer.lua b/Interface/AddOns/SVUI/system/installer.lua
index 772dceb..cc909bc 100644
--- a/Interface/AddOns/SVUI/system/installer.lua
+++ b/Interface/AddOns/SVUI/system/installer.lua
@@ -62,7 +62,6 @@ end
 local function forceCVars()
 	SetCVar("alternateResourceText",1)
 	SetCVar("statusTextDisplay","BOTH")
-	SetCVar("mapQuestDifficulty",1)
 	SetCVar("ShowClassColorInNameplate",1)
 	SetCVar("screenshotQuality",10)
 	SetCVar("chatMouseScroll",1)
diff --git a/Interface/AddOns/SVUI/system/mentalo.lua b/Interface/AddOns/SVUI/system/mentalo.lua
index 9a5e00e..e5c4575 100644
--- a/Interface/AddOns/SVUI/system/mentalo.lua
+++ b/Interface/AddOns/SVUI/system/mentalo.lua
@@ -236,6 +236,18 @@ theHand:SetFrameLevel(99)
 theHand:SetClampedToScreen(true)
 theHand:SetSize(128,128)
 theHand:SetPoint("CENTER")
+theHand.bg = theHand:CreateTexture(nil, "OVERLAY")
+theHand.bg:SetAllPoints(theHand)
+theHand.bg:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-HAND-OFF]])
+theHand.energy = theHand:CreateTexture(nil, "OVERLAY")
+theHand.energy:SetAllPoints(theHand)
+theHand.energy:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-ENERGY]])
+SuperVillain.Animate:Orbit(theHand.energy, 10)
+theHand.flash = theHand.energy.anim;
+theHand.energy:Hide()
+theHand.elapsedTime = 0;
+theHand.flash:Stop()
+theHand:Hide()
 --[[
 ##########################################################
 LOCAL FUNCTIONS
@@ -689,19 +701,6 @@ function SuperVillain:SetSVMovablesPositions()
 end

 function SuperVillain:LoadMovables()
-	theHand.bg = theHand:CreateTexture(nil, "OVERLAY")
-	theHand.bg:SetAllPoints(theHand)
-	theHand.bg:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-HAND-OFF]])
-	theHand.energy = theHand:CreateTexture(nil, "OVERLAY")
-	theHand.energy:SetAllPoints(theHand)
-	theHand.energy:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-ENERGY]])
-	self.Animate:Orbit(theHand.energy, 10)
-	theHand.flash = theHand.energy.anim;
-	theHand.energy:Hide()
-	theHand.elapsedTime = 0;
-	theHand.flash:Stop()
-	theHand:Hide()
-
 	for name, _ in pairs(self.MentaloFrames)do
 		local parent, text, overlay, snapoffset, postdrag;
 		for key, value in pairs(self.MentaloFrames[name])do
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_ArtOfWar/SVUI_ArtOfWar.lua b/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua
index f519e1f..38806d5 100644
--- a/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua
+++ b/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua
@@ -214,7 +214,9 @@ end
 local function ClearCacheScans()
 	wipe(EnemyCache)
 	wipe(AlertedCache)
-	PLUGIN.LogWindow:Clear();
+	if(PLUGIN.LogWindow) then
+		PLUGIN.LogWindow:Clear()
+	end
 end

 local function ClearSavedScans()
diff --git a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua
index c0e741c..3d60dd2 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua
@@ -75,13 +75,13 @@ PLUGIN.OptionsCache = {
 		},
 	}
 };
-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)
@@ -111,19 +111,13 @@ function PLUGIN:LoadAlert(MainText, Function)
 end

 function PLUGIN:Style(style, fn, ...)
-	-- self.Debugging = false
 	local pass, error = pcall(fn, ...)
 	if(pass and (not style:find("Blizzard")) and not self.StyledAddons[style]) then
 		self.StyledAddons[style] = true
 		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