Quantcast

misc fixes

failcoder [07-10-15 - 18:27]
misc fixes
Filename
SVUI_QuestTracker/SVUI_QuestTracker.lua
SVUI_QuestTracker/SVUI_QuestTracker.xml
SVUI_QuestTracker/components/achievements.lua
SVUI_QuestTracker/components/active.lua
SVUI_QuestTracker/components/bonus.lua
SVUI_QuestTracker/components/button.lua
SVUI_QuestTracker/components/popups.lua
SVUI_QuestTracker/components/quests.lua
SVUI_QuestTracker/components/scenario.lua
SVUI_UnitFrames/groups.lua
diff --git a/SVUI_QuestTracker/SVUI_QuestTracker.lua b/SVUI_QuestTracker/SVUI_QuestTracker.lua
index 1720abf..f5b984d 100644
--- a/SVUI_QuestTracker/SVUI_QuestTracker.lua
+++ b/SVUI_QuestTracker/SVUI_QuestTracker.lua
@@ -7,42 +7,11 @@ LOCALIZED LUA FUNCTIONS
 ]]--
 --[[ GLOBALS ]]--
 local _G = _G;
-local unpack    = _G.unpack;
-local select    = _G.select;
 local pairs     = _G.pairs;
-local ipairs    = _G.ipairs;
-local type      = _G.type;
-local error     = _G.error;
-local pcall     = _G.pcall;
-local tostring  = _G.tostring;
-local tonumber  = _G.tonumber;
-local tinsert 	= _G.tinsert;
-local string 	= _G.string;
-local math 		= _G.math;
-local table 	= _G.table;
---[[ STRING METHODS ]]--
-local format = string.format;
---[[ MATH METHODS ]]--
-local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round;
---[[ TABLE METHODS ]]--
-local tremove, twipe = table.remove, table.wipe;
 --BLIZZARD API
 local CreateFrame           = _G.CreateFrame;
-local InCombatLockdown      = _G.InCombatLockdown;
-local GameTooltip           = _G.GameTooltip;
-local hooksecurefunc        = _G.hooksecurefunc;
-local IsAltKeyDown          = _G.IsAltKeyDown;
-local IsShiftKeyDown        = _G.IsShiftKeyDown;
-local IsControlKeyDown      = _G.IsControlKeyDown;
-local IsModifiedClick       = _G.IsModifiedClick;
-local PlaySound             = _G.PlaySound;
-local PlaySoundFile         = _G.PlaySoundFile;
-local PlayMusic             = _G.PlayMusic;
-local StopMusic             = _G.StopMusic;
 local GetTime               = _G.GetTime;
 local PERCENTAGE_STRING     = _G.PERCENTAGE_STRING;
-local RAID_CLASS_COLORS     = _G.RAID_CLASS_COLORS;
-local CUSTOM_CLASS_COLORS   = _G.CUSTOM_CLASS_COLORS;
 local GetTimeStringFromSeconds = _G.GetTimeStringFromSeconds;
 local GetQuestProgressBarPercent = _G.GetQuestProgressBarPercent;
 --[[
@@ -51,8 +20,6 @@ GET ADDON DATA
 ##########################################################
 ]]--
 local SV = _G['SVUI']
-local L = SV.L
-local LSM = _G.LibStub("LibSharedMedia-3.0")
 local MOD = SV.QuestTracker;
 if(not MOD) then return end;
 MOD.DOCK_IS_FADED = false;
@@ -66,7 +33,7 @@ local ROW_HEIGHT = 24;
 local INNER_HEIGHT = ROW_HEIGHT - 4;
 local LARGE_ROW_HEIGHT = ROW_HEIGHT * 2;
 local LARGE_INNER_HEIGHT = LARGE_ROW_HEIGHT - 4;
-local OBJ_ICON_ACTIVE = [[Interface\COMMON\Indicator-Yellow]];
+--local OBJ_ICON_ACTIVE = [[Interface\COMMON\Indicator-Yellow]];
 local OBJ_ICON_COMPLETE = [[Interface\COMMON\Indicator-Green]];
 local OBJ_ICON_INCOMPLETE = [[Interface\COMMON\Indicator-Gray]];
 --[[
@@ -100,7 +67,7 @@ local OBJECTIVE_StopProgress = function(self)
 	self:UnregisterEvent("QUEST_LOG_UPDATE")
 end

-local OBJECTIVE_UpdateProgress = function(self, event, ...)
+local OBJECTIVE_UpdateProgress = function(self)
 	if(not self.Status) then
 		self:UnregisterEvent("QUEST_LOG_UPDATE")
 		return
@@ -132,7 +99,7 @@ local OBJECTIVE_StartTimer = function(self, ...)
 	self:SetScript("OnUpdate", self.UpdateTimer);
 end

-local OBJECTIVE_StopTimer = function(self, ...)
+local OBJECTIVE_StopTimer = function(self)
 	if(not self.Status) then return end
 	local status = self.Status;
 	status:SetAlpha(0);
@@ -146,7 +113,7 @@ local OBJECTIVE_StopTimer = function(self, ...)
 	self:SetScript("OnUpdate", nil);
 end

-local OBJECTIVE_UpdateTimer = function(self, ...)
+local OBJECTIVE_UpdateTimer = function(self)
 	if(not self.Status) then
 		self:SetScript("OnUpdate", nil);
 		return
@@ -241,44 +208,6 @@ local OBJECTIVE_GetStatus = function(self)
 end
 --[[
 ##########################################################
-OBJECTIVE CONSTRUCTOR
-##########################################################
-]]--
-function MOD:NewObjectiveRow(header, index)
-	local yOffset = (index * (ROW_HEIGHT)) - ROW_HEIGHT;
-
-	local objective = CreateFrame("Frame", nil, header);
-	objective:SetPoint("TOPLEFT", header, "TOPLEFT", 22, -yOffset);
-	objective:SetPoint("TOPRIGHT", header, "TOPRIGHT", 0, -yOffset);
-	objective:SetHeight(ROW_HEIGHT);
-
-	objective.Icon = objective:CreateTexture(nil,"OVERLAY");
-	objective.Icon:SetPoint("TOPLEFT", objective, "TOPLEFT", 4, -2);
-	objective.Icon:SetPoint("BOTTOMLEFT", objective, "BOTTOMLEFT", 4, 2);
-	objective.Icon:SetWidth(16);
-	objective.Icon:SetTexture(OBJ_ICON_INCOMPLETE);
-
-	objective.Text = objective:CreateFontString(nil,"OVERLAY");
-	objective.Text:SetPoint("TOPLEFT", objective, "TOPLEFT", 20 + 6, -2);
-	objective.Text:SetPoint("TOPRIGHT", objective, "TOPRIGHT", 0, -2);
-	objective.Text:SetHeight(INNER_HEIGHT);
-	objective.Text:SetFontObject(SVUI_Font_Quest);
-	objective.Text:SetJustifyH('LEFT')
-	objective.Text:SetTextColor(0.6,0.6,0.6);
-	objective.Text:SetText('');
-
-	objective.StartProgress = OBJECTIVE_StartProgress;
-	objective.StopProgress = OBJECTIVE_StopProgress;
-	objective.UpdateProgress = OBJECTIVE_UpdateProgress;
-	objective.StartTimer = OBJECTIVE_StartTimer;
-	objective.StopTimer = OBJECTIVE_StopTimer;
-	objective.UpdateTimer = OBJECTIVE_UpdateTimer;
-	objective.GetStatus = OBJECTIVE_GetStatus;
-
-	return objective;
-end
---[[
-##########################################################
 OBJECTIVE HEADER METHODS
 ##########################################################
 ]]--
@@ -304,7 +233,36 @@ end

 local OBJECTIVE_HEADER_Get = function(self, index)
 	if(not self.Rows[index]) then
-		local objective = MOD:NewObjectiveRow(self, index);
+		local yOffset = (index * (ROW_HEIGHT)) - ROW_HEIGHT;
+
+		local objective = CreateFrame("Frame", nil, self);
+		objective:SetPoint("TOPLEFT", self, "TOPLEFT", 22, -yOffset);
+		objective:SetPoint("TOPRIGHT", self, "TOPRIGHT", 0, -yOffset);
+		objective:SetHeight(ROW_HEIGHT);
+
+		objective.Icon = objective:CreateTexture(nil,"OVERLAY");
+		objective.Icon:SetPoint("TOPLEFT", objective, "TOPLEFT", 4, -2);
+		objective.Icon:SetPoint("BOTTOMLEFT", objective, "BOTTOMLEFT", 4, 2);
+		objective.Icon:SetWidth(16);
+		objective.Icon:SetTexture(OBJ_ICON_INCOMPLETE);
+
+		objective.Text = objective:CreateFontString(nil,"OVERLAY");
+		objective.Text:SetPoint("TOPLEFT", objective, "TOPLEFT", 20 + 6, -2);
+		objective.Text:SetPoint("TOPRIGHT", objective, "TOPRIGHT", 0, -2);
+		objective.Text:SetHeight(INNER_HEIGHT);
+		objective.Text:SetFontObject(SVUI_Font_Quest);
+		objective.Text:SetJustifyH('LEFT')
+		objective.Text:SetTextColor(0.6,0.6,0.6);
+		objective.Text:SetText('');
+
+		objective.StartProgress = OBJECTIVE_StartProgress;
+		objective.StopProgress = OBJECTIVE_StopProgress;
+		objective.UpdateProgress = OBJECTIVE_UpdateProgress;
+		objective.StartTimer = OBJECTIVE_StartTimer;
+		objective.StopTimer = OBJECTIVE_StopTimer;
+		objective.UpdateTimer = OBJECTIVE_UpdateTimer;
+		objective.GetStatus = OBJECTIVE_GetStatus;
+
 		self.Rows[index] = objective;
 		return objective;
 	end
@@ -364,8 +322,8 @@ end
 OBJECTIVE CONSTRUCTOR
 ##########################################################
 ]]--
-function MOD:NewObjectiveHeader(parent)
-	local header = CreateFrame("Frame", nil, parent);
+function MOD:NewObjectiveHeader()
+	local header = CreateFrame("Frame", nil, self);
 	header.Rows = {};

 	header.Reset = OBJECTIVE_HEADER_Reset;
diff --git a/SVUI_QuestTracker/SVUI_QuestTracker.xml b/SVUI_QuestTracker/SVUI_QuestTracker.xml
index 8834264..2688d4a 100644
--- a/SVUI_QuestTracker/SVUI_QuestTracker.xml
+++ b/SVUI_QuestTracker/SVUI_QuestTracker.xml
@@ -42,11 +42,10 @@

     <Script file="Loader.lua"/>
     <Script file='SVUI_QuestTracker.lua'/>
-    <!-- <Script file='components\button.lua'/> -->
     <Script file='components\popups.lua'/>
     <Script file='components\active.lua'/>
     <Script file='components\scenario.lua'/>
     <Script file='components\quests.lua'/>
     <Script file='components\bonus.lua'/>
     <Script file='components\achievements.lua'/>
-</Ui>
\ No newline at end of file
+</Ui>
diff --git a/SVUI_QuestTracker/components/achievements.lua b/SVUI_QuestTracker/components/achievements.lua
index aac57c0..4c2b417 100644
--- a/SVUI_QuestTracker/components/achievements.lua
+++ b/SVUI_QuestTracker/components/achievements.lua
@@ -197,7 +197,7 @@ local GetAchievementRow = function(self, index)

 		row.Badge.Button.Link = row.Button

-		row.Objectives = MOD:NewObjectiveHeader(row);
+		row.Objectives = MOD.NewObjectiveHeader(row);
 		row.Objectives:SetPoint("TOPLEFT", row, "BOTTOMLEFT", 0, 0);
 		row.Objectives:SetPoint("TOPRIGHT", row, "BOTTOMRIGHT", 0, 0);
 		row.Objectives:SetHeight(1);
diff --git a/SVUI_QuestTracker/components/active.lua b/SVUI_QuestTracker/components/active.lua
index 1250a37..1823f06 100644
--- a/SVUI_QuestTracker/components/active.lua
+++ b/SVUI_QuestTracker/components/active.lua
@@ -9,70 +9,30 @@ LOCALIZED LUA FUNCTIONS
 local _G = _G;
 local unpack    = _G.unpack;
 local select    = _G.select;
-local pairs     = _G.pairs;
-local ipairs    = _G.ipairs;
 local type      = _G.type;
-local error     = _G.error;
-local pcall     = _G.pcall;
-local tostring  = _G.tostring;
-local tonumber  = _G.tonumber;
-local tinsert 	= _G.tinsert;
-local string 	= _G.string;
-local math 		= _G.math;
-local table 	= _G.table;
---[[ STRING METHODS ]]--
-local format = string.format;
---[[ MATH METHODS ]]--
-local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round;
---[[ TABLE METHODS ]]--
-local tremove, twipe = table.remove, table.wipe;
 --BLIZZARD API
-local CreateFrame           = _G.CreateFrame;
-local InCombatLockdown      = _G.InCombatLockdown;
-local GameTooltip           = _G.GameTooltip;
-local hooksecurefunc        = _G.hooksecurefunc;
-local IsAltKeyDown          = _G.IsAltKeyDown;
-local IsShiftKeyDown        = _G.IsShiftKeyDown;
-local IsControlKeyDown      = _G.IsControlKeyDown;
-local IsModifiedClick       = _G.IsModifiedClick;
-local PlaySound             = _G.PlaySound;
-local PlaySoundFile         = _G.PlaySoundFile;
-local PlayMusic             = _G.PlayMusic;
-local StopMusic             = _G.StopMusic;
-local GetTime               = _G.GetTime;
-local IsQuestTask   		= _G.IsQuestTask;
-local GetQuestLink  		= _G.GetQuestLink;
-local GetQuestLogTitle  	= _G.GetQuestLogTitle;
-local SetSuperTrackedQuestID= _G.SetSuperTrackedQuestID;
-local GetNumQuestWatches  	= _G.GetNumQuestWatches;
-local GetQuestWatchInfo  	= _G.GetQuestWatchInfo;
-local GetQuestWatchIndex  	= _G.GetQuestWatchIndex;
-local GetDistanceSqToQuest  = _G.GetDistanceSqToQuest;
-local GetNumQuestLogEntries = _G.GetNumQuestLogEntries;
-local ShowQuestComplete  	= _G.ShowQuestComplete;
-local RemoveQuestWatch  	= _G.RemoveQuestWatch;
-local IsQuestComplete  		= _G.IsQuestComplete;
-local GetSuperTrackedQuestID= _G.GetSuperTrackedQuestID;
-local GetQuestLogIndexByID  = _G.GetQuestLogIndexByID;
-local IsPlayerInMicroDungeon= _G.IsPlayerInMicroDungeon;
-local GetCurrentMapAreaID   = _G.GetCurrentMapAreaID;
-local SetMapToCurrentZone   = _G.SetMapToCurrentZone;
-local PERCENTAGE_STRING     = _G.PERCENTAGE_STRING;
-local GetQuestObjectiveInfo = _G.GetQuestObjectiveInfo;
+local CreateFrame           			= _G.CreateFrame;
+local GameTooltip           			= _G.GameTooltip;
+local IsShiftKeyDown        			= _G.IsShiftKeyDown;
+local IsModifiedClick       			= _G.IsModifiedClick;
+local GetQuestLink  							= _G.GetQuestLink;
+local GetQuestLogTitle  					= _G.GetQuestLogTitle;
+local GetQuestWatchInfo  					= _G.GetQuestWatchInfo;
+local GetQuestWatchIndex  				= _G.GetQuestWatchIndex;
+local ShowQuestComplete  					= _G.ShowQuestComplete;
+local RemoveQuestWatch  					= _G.RemoveQuestWatch;
+local IsQuestComplete  						= _G.IsQuestComplete;
+local GetSuperTrackedQuestID			= _G.GetSuperTrackedQuestID;
+local GetQuestLogIndexByID  			= _G.GetQuestLogIndexByID;
+local GetQuestObjectiveInfo				= _G.GetQuestObjectiveInfo;
 local GetQuestLogIsAutoComplete  	= _G.GetQuestLogIsAutoComplete;
 local GetQuestDifficultyColor  		= _G.GetQuestDifficultyColor;
-local GetQuestLogSpecialItemInfo 	= _G.GetQuestLogSpecialItemInfo;
-local GetQuestWorldMapAreaID  		= _G.GetQuestWorldMapAreaID;
-local GetTimeStringFromSeconds 		= _G.GetTimeStringFromSeconds;
-local GetQuestProgressBarPercent 	= _G.GetQuestProgressBarPercent;
 --[[
 ##########################################################
 GET ADDON DATA
 ##########################################################
 ]]--
 local SV = _G['SVUI']
-local L = SV.L
-local LSM = _G.LibStub("LibSharedMedia-3.0")
 local MOD = SV.QuestTracker;
 --[[
 ##########################################################
@@ -84,44 +44,41 @@ local ROW_HEIGHT = 24;
 local INNER_HEIGHT = ROW_HEIGHT - 4;
 local LARGE_ROW_HEIGHT = ROW_HEIGHT * 2;
 local LARGE_INNER_HEIGHT = LARGE_ROW_HEIGHT - 4;
-local OBJ_ICON_ACTIVE = [[Interface\COMMON\Indicator-Yellow]];
-local OBJ_ICON_COMPLETE = [[Interface\COMMON\Indicator-Green]];
-local OBJ_ICON_INCOMPLETE = [[Interface\COMMON\Indicator-Gray]];
 local DEFAULT_COLOR = {r = 1, g = 0.68, b = 0.1}
 --[[
 ##########################################################
 SCRIPT HANDLERS
 ##########################################################
 ]]--
-local ObjectiveTimer_OnUpdate = function(self, elapsed)
-	local statusbar = self.Timer.Bar
-	local timeNow = GetTime();
-	local timeRemaining = statusbar.duration - (timeNow - statusbar.startTime);
-	statusbar:SetValue(timeRemaining);
-	if(timeRemaining < 0) then
-		-- hold at 0 for a moment
-		if(timeRemaining > -1) then
-			timeRemaining = 0;
-		else
-			self:StopTimer();
-		end
-	end
-	local r,g,b = MOD:GetTimerTextColor(statusbar.duration, statusbar.duration - timeRemaining)
-	statusbar.Label:SetText(GetTimeStringFromSeconds(timeRemaining, nil, true));
-	statusbar.Label:SetTextColor(r,g,b);
-end
-
-local ObjectiveProgressBar_OnEvent = function(self, event, ...)
-	local statusbar = self.Progress.Bar;
-	local percent = 100;
-	if(not statusbar.finished) then
-		percent = GetQuestProgressBarPercent(statusbar.questID);
-	end
-	statusbar:SetValue(percent);
-	statusbar.Label:SetFormattedText(PERCENTAGE_STRING, percent);
-end
-
-local ActiveButton_OnEnter = function(self, ...)
+-- local ObjectiveTimer_OnUpdate = function(self, elapsed)
+-- 	local statusbar = self.Timer.Bar
+-- 	local timeNow = GetTime();
+-- 	local timeRemaining = statusbar.duration - (timeNow - statusbar.startTime);
+-- 	statusbar:SetValue(timeRemaining);
+-- 	if(timeRemaining < 0) then
+-- 		-- hold at 0 for a moment
+-- 		if(timeRemaining > -1) then
+-- 			timeRemaining = 0;
+-- 		else
+-- 			self:StopTimer();
+-- 		end
+-- 	end
+-- 	local r,g,b = MOD:GetTimerTextColor(statusbar.duration, statusbar.duration - timeRemaining)
+-- 	statusbar.Label:SetText(GetTimeStringFromSeconds(timeRemaining, nil, true));
+-- 	statusbar.Label:SetTextColor(r,g,b);
+-- end
+--
+-- local ObjectiveProgressBar_OnEvent = function(self, event, ...)
+-- 	local statusbar = self.Progress.Bar;
+-- 	local percent = 100;
+-- 	if(not statusbar.finished) then
+-- 		percent = GetQuestProgressBarPercent(statusbar.questID);
+-- 	end
+-- 	statusbar:SetValue(percent);
+-- 	statusbar.Label:SetFormattedText(PERCENTAGE_STRING, percent);
+-- end
+
+local ActiveButton_OnEnter = function(self)
 	if(MOD.DOCK_IS_FADED) then return end
 	GameTooltip:SetOwner(self, "ANCHOR_BOTTOMLEFT", 0, ROW_HEIGHT)
 	GameTooltip:ClearLines()
@@ -133,11 +90,11 @@ local ActiveButton_OnEnter = function(self, ...)
 	GameTooltip:Show()
 end

-local ActiveButton_OnLeave = function(self, ...)
+local ActiveButton_OnLeave = function()
 	GameTooltip:Hide()
 end

-local ActiveButton_OnClick = function(self, button)
+local ActiveButton_OnClick = function()
 	MOD.Headers["Active"]:Unset();
 end

@@ -374,8 +331,8 @@ function MOD:InitializeActive()
 	block.CloseButton:SetStyle("Button", -7, -7, "red")
 	block.CloseButton:SetFrameLevel(block.Button:GetFrameLevel() + 4)
 	block.CloseButton:SetNormalTexture(SV.media.icon.close)
-    block.CloseButton:HookScript("OnEnter", CloseButton_OnEnter)
-    block.CloseButton:HookScript("OnLeave", CloseButton_OnLeave)
+  block.CloseButton:HookScript("OnEnter", CloseButton_OnEnter)
+  block.CloseButton:HookScript("OnLeave", CloseButton_OnLeave)
 	block.CloseButton:SetPoint("TOPRIGHT", block.Button, "TOPRIGHT", 4, 4);
 	block.CloseButton:RegisterForClicks("LeftButtonUp", "RightButtonUp")
 	block.CloseButton.Parent = active;
@@ -427,7 +384,7 @@ function MOD:InitializeActive()
 		block.Details:SetHeight(1);
 	end

-	block.Objectives = MOD:NewObjectiveHeader(block);
+	block.Objectives = MOD.NewObjectiveHeader(block);
 	block.Objectives:SetPoint("TOPLEFT", block.Details, "BOTTOMLEFT", 0, -2);
 	block.Objectives:SetPoint("TOPRIGHT", block.Details, "BOTTOMRIGHT", 0, -2);
 	block.Objectives:SetHeight(1);
diff --git a/SVUI_QuestTracker/components/bonus.lua b/SVUI_QuestTracker/components/bonus.lua
index 573d3cf..e29422a 100644
--- a/SVUI_QuestTracker/components/bonus.lua
+++ b/SVUI_QuestTracker/components/bonus.lua
@@ -240,7 +240,7 @@ local GetBonusRow = function(self, index)
 		row.Header.Text:SetPoint("TOPLEFT", row.Header, "TOPLEFT", 0, 0);
 		row.Header.Text:SetPoint("BOTTOMRIGHT", row.Header, "BOTTOMRIGHT", 0, 0);

-		row.Objectives = MOD:NewObjectiveHeader(row);
+		row.Objectives = MOD.NewObjectiveHeader(row);
 		row.Objectives:SetPoint("TOPLEFT", row, "BOTTOMLEFT", 0, 0);
 		row.Objectives:SetPoint("TOPRIGHT", row, "BOTTOMRIGHT", 0, 0);
 		row.Objectives:SetHeight(1);
diff --git a/SVUI_QuestTracker/components/button.lua b/SVUI_QuestTracker/components/button.lua
deleted file mode 100644
index 7376f4a..0000000
--- a/SVUI_QuestTracker/components/button.lua
+++ /dev/null
@@ -1,146 +0,0 @@
---[[
-##############################################################################
-S V U I   By: Munglunch
-##############################################################################
-
-QUEST TRACKER BUTTON:
-
-Originally "ExtraQuestButton" by p3lim,
-modified/minimally re-written for SVUI by Munglunch
-
-##########################################################
-LOCALIZED LUA FUNCTIONS
-##########################################################
-]]--
---[[ GLOBALS ]]--
-local _G = _G;
-local unpack    = _G.unpack;
-local select    = _G.select;
-local pairs     = _G.pairs;
-local ipairs    = _G.ipairs;
-local type      = _G.type;
-local error     = _G.error;
-local pcall     = _G.pcall;
-local tostring  = _G.tostring;
-local tonumber  = _G.tonumber;
-local tinsert 	= _G.tinsert;
-local string 	= _G.string;
-local math 		= _G.math;
-local table 	= _G.table;
---[[ STRING METHODS ]]--
-local format = string.format;
---[[ MATH METHODS ]]--
-local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round;
---[[ TABLE METHODS ]]--
-local tremove, twipe = table.remove, table.wipe;
-
-local C_Timer 				= _G.C_Timer;
-local GetNumQuestWatches  	= _G.GetNumQuestWatches;
-local GetQuestWatchInfo  	= _G.GetQuestWatchInfo;
-local QuestHasPOIInfo  	= _G.QuestHasPOIInfo;
-local GetQuestLogSpecialItemInfo  	= _G.GetQuestLogSpecialItemInfo;
-local GetCurrentMapAreaID  	= _G.GetCurrentMapAreaID;
-local GetDistanceSqToQuest  	= _G.GetDistanceSqToQuest;
---[[
-##########################################################
-GET ADDON DATA
-##########################################################
-]]--
-local SV = _G['SVUI']
-local L = SV.L
-local LSM = _G.LibStub("LibSharedMedia-3.0")
-local MOD = SV.QuestTracker;
---[[
-##########################################################
-LOCALS
-##########################################################
-]]--
-local QuestInZone = {
-	[14108] = 541,
-	[13998] = 11,
-	[25798] = 61,
-	[25799] = 61,
-	[25112] = 161,
-	[25111] = 161,
-	[24735] = 201,
-};
---[[
-##########################################################
-BUTTON INTERNALS
-##########################################################
-]]--
-local ticker;
-local UpdateButton = function(self)
-	local numItems = 0
-	local shortestDistance = 62500
-	local closestQuestLink, closestQuestTexture
-	local activeQuestLink, activeQuestTexture
-
-	for index = 1, GetNumQuestWatches() do
-		local questID, _, questIndex, _, _, isComplete = GetQuestWatchInfo(index)
-		if(questID and QuestHasPOIInfo(questID)) then
-			local link, texture, _, showCompleted = GetQuestLogSpecialItemInfo(questIndex)
-			if(link) then
-				local areaID = QuestInZone[questID]
-				if questIndex == MOD.CurrentQuest then
-					activeQuestLink = link
-					activeQuestTexture = texture
-				end
-				if(areaID and areaID == GetCurrentMapAreaID()) then
-					closestQuestLink = link
-					closestQuestTexture = texture
-				elseif(not isComplete or (isComplete and showCompleted)) then
-					local distanceSq, onContinent = GetDistanceSqToQuest(questIndex)
-					if(onContinent and distanceSq < shortestDistance) then
-						shortestDistance = distanceSq
-						closestQuestLink = link
-						closestQuestTexture = texture
-					end
-				end
-
-				numItems = numItems + 1
-			end
-		end
-	end
-
-	if(closestQuestLink) then
-		self:SetUsage(closestQuestLink, closestQuestTexture);
-	elseif(activeQuestLink) then
-		self:SetUsage(activeQuestLink, activeQuestTexture);
-	end
-
-	if(numItems > 0 and not ticker) then
-		ticker = C_Timer.NewTicker(30, function()
-			self:Update()
-		end)
-	elseif(numItems == 0 and ticker) then
-		ticker:Cancel()
-		ticker = nil
-	end
-end
---[[
-##########################################################
-PACKAGE CALL
-##########################################################
-]]--
-function MOD:InitializeQuestItem()
-	SVUI_QuestItemBar:SetParent(SV.Screen)
-	SVUI_QuestItemBar:SetPoint("BOTTOM", SV.Screen, "BOTTOM", 0, 250)
-	SVUI_QuestItemBar:SetSize(40,40)
-
-	SV:NewAnchor(SVUI_QuestItemBar, L["Quest Item Button"])
-
-	local questitem = SV:CreateSecureButton("item", "SVUI_QuestItemBar", "SVUI_QuestAutoItemButton", UpdateButton);
-	questitem.ArtFile = MOD.media.buttonArt;
-	questitem.blacklist[113191] = true
-	questitem.blacklist[110799] = true
-	questitem.blacklist[109164] = true
-	questitem:RegisterEvent('UPDATE_EXTRA_ACTIONBAR')
-	questitem:RegisterEvent('BAG_UPDATE_COOLDOWN')
-	questitem:RegisterEvent('BAG_UPDATE_DELAYED')
-	questitem:RegisterEvent('WORLD_MAP_UPDATE')
-	questitem:RegisterEvent('QUEST_LOG_UPDATE')
-	questitem:RegisterEvent('QUEST_POI_UPDATE')
-
-	self.QuestItem = questitem
-end
\ No newline at end of file
diff --git a/SVUI_QuestTracker/components/popups.lua b/SVUI_QuestTracker/components/popups.lua
index 66e2a68..92ef9a8 100644
--- a/SVUI_QuestTracker/components/popups.lua
+++ b/SVUI_QuestTracker/components/popups.lua
@@ -9,31 +9,9 @@ LOCALIZED LUA FUNCTIONS
 local _G = _G;
 local unpack    = _G.unpack;
 local select    = _G.select;
-local pairs     = _G.pairs;
-local ipairs    = _G.ipairs;
-local type      = _G.type;
-local error     = _G.error;
-local pcall     = _G.pcall;
-local tostring  = _G.tostring;
-local tonumber  = _G.tonumber;
-local tinsert 	= _G.tinsert;
-local string 	= _G.string;
-local math 		= _G.math;
-local table 	= _G.table;
---[[ STRING METHODS ]]--
-local format = string.format;
---[[ MATH METHODS ]]--
-local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round;
---[[ TABLE METHODS ]]--
-local tremove, twipe = table.remove, table.wipe;
 --BLIZZARD API
 local CreateFrame           = _G.CreateFrame;
-local InCombatLockdown      = _G.InCombatLockdown;
-local GameTooltip           = _G.GameTooltip;
 local hooksecurefunc        = _G.hooksecurefunc;
-local IsAltKeyDown          = _G.IsAltKeyDown;
-local IsShiftKeyDown        = _G.IsShiftKeyDown;
-local IsControlKeyDown      = _G.IsControlKeyDown;
 local ShowQuestOffer       	= _G.ShowQuestOffer;
 local PlaySound             = _G.PlaySound;
 local GetQuestLogTitle  	= _G.GetQuestLogTitle;
@@ -49,8 +27,6 @@ GET ADDON DATA
 ##########################################################
 ]]--
 local SV = _G['SVUI']
-local L = SV.L
-local LSM = _G.LibStub("LibSharedMedia-3.0")
 local MOD = SV.QuestTracker;
 --[[
 ##########################################################
@@ -62,15 +38,12 @@ local ROW_HEIGHT = 24;
 local INNER_HEIGHT = ROW_HEIGHT - 4;
 local LARGE_ROW_HEIGHT = ROW_HEIGHT * 2;
 local LARGE_INNER_HEIGHT = LARGE_ROW_HEIGHT - 4;
-local OBJ_ICON_ACTIVE = [[Interface\COMMON\Indicator-Yellow]];
-local OBJ_ICON_COMPLETE = [[Interface\COMMON\Indicator-Green]];
-local OBJ_ICON_INCOMPLETE = [[Interface\COMMON\Indicator-Gray]];
 --[[
 ##########################################################
 SCRIPT HANDLERS
 ##########################################################
 ]]--
-local PopUpButton_OnClick = function(self, button)
+local PopUpButton_OnClick = function(self)
 	local questIndex = self:GetID();
 	if(questIndex and (questIndex ~= 0) and self.PopUpType) then
 		local questID = select(8, GetQuestLogTitle(questIndex));
@@ -90,7 +63,7 @@ TRACKER FUNCTIONS
 local GetPopUpRow = function(self, index)
 	if(not self.Rows[index]) then
 		local previousFrame = self.Rows[#self.Rows]
-		local index = #self.Rows + 1;
+		index = #self.Rows + 1;
 		local row = CreateFrame("Frame", nil, self)
 		if(previousFrame) then
 			row:SetPoint("TOPLEFT", previousFrame, "BOTTOMLEFT", 0, -2);
@@ -155,8 +128,9 @@ local SetPopupRow = function(self, index, title, popUpType, questID, questLogInd
 	return index, fill_height;
 end

-local RefreshPopupObjective = function(self, event, ...)
+local RefreshPopupObjective = function(self)
 	local rows = 0;
+	local add_height;
 	local fill_height = 0;
 	for i = 1, GetNumAutoQuestPopUps() do
 		local questID, popUpType = GetAutoQuestPopUp(i);
@@ -164,8 +138,8 @@ local RefreshPopupObjective = function(self, event, ...)
 			local questLogIndex = GetQuestLogIndexByID(questID);
 			local title = GetQuestLogTitle(questLogIndex);
 			if(title and title ~= '') then
-				local add_height = 0;
-				rows, add_height = self:SetPopup(rows, title, popUpType, questID, questLogIndex)
+				rows, add_height = self:SetPopup(rows, title, popUpType, questID, questLogIndex);
+				add_height = add_height or 0;
 				fill_height = fill_height + add_height
 			end
 		end
diff --git a/SVUI_QuestTracker/components/quests.lua b/SVUI_QuestTracker/components/quests.lua
index edcbb9a..a8b9e0a 100644
--- a/SVUI_QuestTracker/components/quests.lua
+++ b/SVUI_QuestTracker/components/quests.lua
@@ -867,7 +867,7 @@ local GetQuestRow = function(self, index)
 		row.StartTimer = StartTimer;
 		row.StopTimer = StopTimer;

-		row.Objectives = MOD:NewObjectiveHeader(row);
+		row.Objectives = MOD.NewObjectiveHeader(row);
 		row.Objectives:SetPoint("TOPLEFT", row.Timer, "BOTTOMLEFT", 0, 0);
 		row.Objectives:SetPoint("TOPRIGHT", row.Timer, "BOTTOMRIGHT", 0, 0);
 		row.Objectives:SetHeight(1);
diff --git a/SVUI_QuestTracker/components/scenario.lua b/SVUI_QuestTracker/components/scenario.lua
index 6ff6502..79fe7b1 100644
--- a/SVUI_QuestTracker/components/scenario.lua
+++ b/SVUI_QuestTracker/components/scenario.lua
@@ -1,7 +1,7 @@
 --[[
 ##########################################################
 S V U I   By: Munglunch
-##########################################################
+##########################################################
 LOCALIZED LUA FUNCTIONS
 ##########################################################
 ]]--
@@ -51,8 +51,8 @@ local CHALLENGE_MEDAL_TEXTURES  = _G.CHALLENGE_MEDAL_TEXTURES;
 local CHALLENGES_TIMER_NO_MEDAL = _G.CHALLENGES_TIMER_NO_MEDAL;
 local LE_WORLD_ELAPSED_TIMER_TYPE_CHALLENGE_MODE = _G.LE_WORLD_ELAPSED_TIMER_TYPE_CHALLENGE_MODE;
 local LE_WORLD_ELAPSED_TIMER_TYPE_PROVING_GROUND = _G.LE_WORLD_ELAPSED_TIMER_TYPE_PROVING_GROUND;
---[[
-##########################################################
+--[[
+##########################################################
 GET ADDON DATA
 ##########################################################
 ]]--
@@ -60,8 +60,8 @@ local SV = _G['SVUI']
 local L = SV.L
 local LSM = _G.LibStub("LibSharedMedia-3.0")
 local MOD = SV.QuestTracker;
---[[
-##########################################################
+--[[
+##########################################################
 LOCALS
 ##########################################################
 ]]--
@@ -73,8 +73,8 @@ local LARGE_INNER_HEIGHT = LARGE_ROW_HEIGHT - 4;
 local LINE_FAILED_ICON = [[Interface\ICONS\Ability_Blackhand_Marked4Death]];
 local LINE_SCENARIO_ICON = [[Interface\ICONS\Icon_Scenarios]];
 local LINE_CHALLENGE_ICON = [[Interface\ICONS\Achievement_ChallengeMode_Platinum]];
---[[
-##########################################################
+--[[
+##########################################################
 SCRIPT HANDLERS
 ##########################################################
 ]]--
@@ -92,8 +92,8 @@ local TimerBar_OnUpdate = function(self, elapsed)
     	self:StopTimer()
     end
 end
---[[
-##########################################################
+--[[
+##########################################################
 TRACKER FUNCTIONS
 ##########################################################
 ]]--
@@ -159,8 +159,8 @@ local RefreshScenarioHeight = function(self)
 		self:FadeIn();
 	end
 end
---[[
-##########################################################
+--[[
+##########################################################
 TIMER FUNCTIONS
 ##########################################################
 ]]--
@@ -339,8 +339,8 @@ local RefreshScenarioObjective = function(self, event, ...)

 	self:RefreshHeight()
 end
---[[
-##########################################################
+--[[
+##########################################################
 CORE FUNCTIONS
 ##########################################################
 ]]--
@@ -449,7 +449,7 @@ function MOD:InitializeScenarios()
 	timer:SetHeight(1);
 	timer:SetAlpha(0)

-	block.Objectives = MOD:NewObjectiveHeader(block);
+	block.Objectives = MOD.NewObjectiveHeader(block);
 	block.Objectives:SetPoint("TOPLEFT", timer, "BOTTOMLEFT", -4, -4);
 	block.Objectives:SetPoint("TOPRIGHT", timer, "BOTTOMRIGHT", 4, -4);
 	block.Objectives:SetHeight(1);
@@ -472,4 +472,4 @@ function MOD:InitializeScenarios()
 	self:RegisterEvent("SCENARIO_COMPLETED", self.UpdateScenarioObjective);

 	SV.Events:On("QUEST_UPVALUES_UPDATED", UpdateScenarioLocals, true);
-end
\ No newline at end of file
+end
diff --git a/SVUI_UnitFrames/groups.lua b/SVUI_UnitFrames/groups.lua
index 304215d..22d7fcb 100644
--- a/SVUI_UnitFrames/groups.lua
+++ b/SVUI_UnitFrames/groups.lua
@@ -741,6 +741,12 @@ UpdateTemplates["assist"] = function(self)
     if(SV.NeedsFrameAudit) then return end
     local db = SV.db.UnitFrames.assist

+    if db.enable ~= true then
+        UnregisterAttributeDriver(self, "state-visibility")
+        self:Hide()
+        return
+    end
+
     self:Hide()
     DetachSubFrames(self:GetChildren())
     self:SetAttribute("startingIndex", -1)