local _G = getfenv(0)

function Skinner:UberQuest()
	if not self.db.profile.QuestLog then return end

	-- Hook this to update Quest Text colours (MUST use SecureHook otherwise scroll frame breaks) 
	self:SecureHook(UberQuest_Details_Scroll, "UpdateScrollChildRect", function()
		-- self:Debug("UberQuest_Details_Scroll - UpdateScrollChildRect")
		UberQuest_Details_ScrollChild_QuestTitle:SetTextColor(HTr, HTg, HTb)
		UberQuest_Details_ScrollChild_ObjectivesText:SetTextColor(BTr, BTg, BTb)
		UberQuest_Details_ScrollChild_TimerText:SetTextColor(HTr, HTg, HTb)
		for i = 1, 10 do
    	  local r, g, b, a = _G["UberQuest_Details_ScrollChild_Objective"..i]:GetTextColor()
    	  _G["UberQuest_Details_ScrollChild_Objective"..i]:SetTextColor(BTr - r, BTg - g, BTb)
    	end
    	local r, g, b, a = UberQuest_Details_ScrollChild_RequiredMoneyText:GetTextColor()
		UberQuest_Details_ScrollChild_DescriptionTitle:SetTextColor(HTr, HTg, HTb)
		UberQuest_Details_ScrollChild_QuestDescription:SetTextColor(BTr, BTg, BTb)
    	UberQuest_Details_ScrollChild_RequiredMoneyText:SetTextColor(BTr - r, BTg - g, BTb)
    	UberQuest_Details_ScrollChild_RewardTitleText:SetTextColor(HTr, HTg, HTb)
    	UberQuest_Details_ScrollChild_ItemChooseText:SetTextColor(BTr, BTg, BTb)
    	UberQuest_Details_ScrollChild_ItemReceiveText:SetTextColor(BTr, BTg, BTb)
		end)
	
	-- Quest List Frame
	self:keepRegions(UberQuest_List, {1, 10}) -- N.B. region 1 & 10 are text
	UberQuest_List:SetWidth(UberQuest_List:GetWidth() * FxMult)
	UberQuest_List:SetHeight(UberQuest_List:GetHeight() * FyMult)
	self:moveObject(UberQuest_List_Title, nil, nil, "+", 12)
	self:moveObject(UberQuest_List_QuestCount, nil, nil, "+", 20)
	self:moveObject(UberQuest_List_CloseButton, "+", 30, "+", 8)
	self:moveObject(UberQuest_List_AbandonButton, "-", 12, "-", 70)
	self:moveObject(UberQuest_List_ConfigButton, "-", 20, "+", 10)
	self:moveObject(UberQuest_List_CloseButton2, "+", 32, "-", 70)
	self:removeRegions(UberQuest_List_Scroll)
	self:moveObject(UberQuest_List_Scroll, "+", 42, "+", 4)
	self:skinScrollBar(UberQuest_List_Scroll)
	-- movement values
	local xOfs, yOfs = 8, 6
--	UberQuest__HighlightFrame
	self:moveObject(UberQuest_List_Title1, "-", xOfs, "+", yOfs)
	self:moveObject(UberQuest_List_Scroll, "-", xOfs, "+", yOfs)
	self:moveObject(UberQuest_List_ExpandButtonFrame, "-", xOfs, "+", yOfs)
	self:keepRegions(UberQuest_List_ExpandButtonFrame_CollapseAllButton, {4, 6}) -- N.B. region 4 is button, 6 is text
	self:applySkin(UberQuest_List)

	-- Details Frame
	self:keepRegions(UberQuest_Details, {1, 10}) -- N.B. region 1 & 10 are text
	UberQuest_Details:SetWidth(UberQuest_Details:GetWidth() * FxMult)
	UberQuest_Details:SetHeight(UberQuest_Details:GetHeight() * FyMult)
	self:moveObject(UberQuest_Details, "+", 46, "-", 0)
	self:moveObject(UberQuest_Details_Title, nil, nil, "+", 12)
	self:moveObject(UberQuest_Details_CloseButton, "+", 30, "+", 8)
	self:moveObject(UberQuest_Details_Exit, "+", 32, "-", 70)
	self:removeRegions(UberQuest_Details_Scroll)
	self:moveObject(UberQuest_Details_Scroll, "+", 36, "+", 20)
	self:skinScrollBar(UberQuest_Details_Scroll)
	UberQuest_Details_ScrollChild_QuestTitle:SetTextColor(HTr, HTg, HTb)
	UberQuest_Details_ScrollChild_ObjectivesText:SetTextColor(BTr, BTg, BTb)
	UberQuest_Details_ScrollChild_TimerText:SetTextColor(HTr, HTg, HTb)
	for i = 1, 10 do
   		local r, g, b, a = _G["UberQuest_Details_ScrollChild_Objective"..i]:GetTextColor()
   		_G["UberQuest_Details_ScrollChild_Objective"..i]:SetTextColor(BTr - r, BTg - g, BTb)
   	end
   	local r, g, b, a = UberQuest_Details_ScrollChild_RequiredMoneyText:GetTextColor()
   	UberQuest_Details_ScrollChild_RequiredMoneyText:SetTextColor(BTr - r, BTg - g, BTb)
	UberQuest_Details_ScrollChild_DescriptionTitle:SetTextColor(HTr, HTg, HTb)
	UberQuest_Details_ScrollChild_QuestDescription:SetTextColor(BTr, BTg, BTb)
   	UberQuest_Details_ScrollChild_RewardTitleText:SetTextColor(HTr, HTg, HTb)
   	UberQuest_Details_ScrollChild_ItemChooseText:SetTextColor(BTr, BTg, BTb)
   	UberQuest_Details_ScrollChild_ItemReceiveText:SetTextColor(BTr, BTg, BTb)
	self:applySkin(UberQuest_Details)
	
	-- Config Frame
	self:moveObject(UberQuest_ConfigFrame, "+", 36, "-", 6)
	UberQuest_ConfigFrame:SetWidth(UberQuest_ConfigFrame:GetWidth() + 10)
	UberQuest_ConfigFrameBackdrop:Hide()
	self:moveObject(UberQuest_ConfigFrame_ResetMinion, "-", 5, nil, nil)
	self:moveObject(UberQuest_ConfigFrame_CloseButton, "+", 5, nil, nil)
	self:applySkin(UberQuest_ConfigFrame)
	
	-- Minion Frame
	UberQuest_MinionBackdrop:Hide()
	self:applySkin(UberQuest_Minion)
	
end
