--[[

    MonkeyQuest:
    Quest tracker.
    
    Website:	www.toctastic.net
	Author:		Trentin
	Email:		monkeymods@gmail.com

--]]



function MonkeyQuest_frameAlpha_Changed()

	MonkeyQuestFrame:SetAlpha(MonkeyQuestVars.frameAlpha.current / 255);
end

function MonkeyQuest_backdropAlpha_Changed()

	MonkeyQuestFrame:SetBackdropColor(TOOLTIP_DEFAULT_BACKGROUND_COLOR.r, TOOLTIP_DEFAULT_BACKGROUND_COLOR.g, TOOLTIP_DEFAULT_BACKGROUND_COLOR.b, MonkeyQuestVars.backdropAlpha.current / 255);
end

function MonkeyQuest_frameLocked_Changed()

	if (MonkeyQuestVars.frameLocked.current == false) then
		MonkeyQuestFrame:Hide();
		MonkeyQuestResizerBtn:Show();
		MonkeyQuestFrame:Show();
	else
		MonkeyQuestResizerBtn:Hide();
	end
end

function MonkeyQuest_showTitleName_Changed()
	MonkeyQuest_UpdateTitle();
end

function MonkeyQuest_showTitleNumQuests_Changed()
	MonkeyQuest_UpdateTitle();
end

function MonkeyQuest_showQuestLevels_Changed()
	MonkeyQuest_Render();
end

function MonkeyQuest_showCurrentZone_Changed()
	MonkeyQuest_Render();
end

function MonkeyQuest_borderColour_Changed()

	local colour = MonkeyQuestVars.borderColour.current;
	
	MonkeyQuestFrame:SetBackdropBorderColor(colour.r, colour.g, colour.b, colour.a);
	
end

function MonkeyQuest_zoneColour_Changed()
	
	local colour = MonkeyQuestVars.zoneColour.current;
	
	for i = 1, MAX_QUESTLOG_QUESTS, 1 do
		getglobal("MonkeyQuestListHeader" .. i .. "_Title"):GetHighlightTexture():SetVertexColor(colour.r, colour.g, colour.b, colour.a);
		getglobal("MonkeyQuestListItem" .. i):GetHighlightTexture():SetVertexColor(colour.r, colour.g, colour.b, colour.a);
	end
	
end

function MonkeyQuest_questTitleColour_Changed()
	MonkeyQuest_Render();
end

function MonkeyQuest_showObjectiveColour_Changed()
	MonkeyQuest_Render();
end

function MonkeyQuest_objectiveColour0_Changed()
	MonkeyQuest_Render();
end

function MonkeyQuest_objectiveColour0plus_Changed()
	MonkeyQuest_Render();
end

function MonkeyQuest_objectiveColour50_Changed()
	MonkeyQuest_Render();
end

function MonkeyQuest_objectiveColour100minus_Changed()
	MonkeyQuest_Render();
end

function MonkeyQuest_objectiveColour100_Changed()
	MonkeyQuest_Render();
end

function MonkeyQuest_sortAscending_Changed()

	MonkeyQuest_SortQuestTable();
	MonkeyQuest_Render();
end

function MonkeyQuest_sortHeadersAscending_Changed()

	MonkeyQuest_SortQuestTable();
	MonkeyQuest_Render();
end

function MonkeyQuest_useQuestCheckboxes_Changed()

    MonkeyQuest_Render();
end

function MonkeyQuest_showAllQuests_Changed()

    MonkeyQuest_Render();
    
    -- update the checkbox
    MonkeyQuestHideAllCheck:SetChecked(MonkeyQuestVars.showAllQuests.current);
end
