diff Config.lua @ 8:75ca29b399e8 Release

Added in options in Interface->Addons to track Misc nodes.
author only1yzerman
date Mon, 24 Jun 2013 06:38:06 -0400
parents ff01eb61abab
children 61b30721d4cf
line wrap: on
line diff
--- a/Config.lua	Mon Jun 24 06:09:23 2013 -0400
+++ b/Config.lua	Mon Jun 24 06:38:06 2013 -0400
@@ -8,8 +8,10 @@
 Settings.MultiZoneMode = 0;
 Settings.HerbFilter = {};
 Settings.OreFilter = {};
+Settings.MiscFilter = {};
 Settings.ZoneFilter = {{}, {}, {}, {}, {}};
 Settings.InspectionRadius = 60;
+
 local function Title(text)
 	local str = frame:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge");
 	str:SetPoint("TOPLEFT", element, "TOPLEFT", 16, -16);
@@ -202,6 +204,22 @@
 	CheckBoxes(table, Settings.OreFilter);
 end
 
+function AddMisc()
+	local table = {};
+
+	for h, v in pairs(Bloodhound2.ContinentMisc) do
+		local name = L[h];
+		if not name then name="Misc "..h; end;
+		table[h] = name;
+	end
+
+	if not Settings.MiscFilter then
+		Settings.MiscFilter = {};
+	end
+
+	CheckBoxes(table, Settings.MiscFilter);
+end
+
 local function CopyTable(table)
 	local copy = {};
 	for k,v in pairs(table) do
@@ -281,6 +299,19 @@
 	AddOre();
 end
 
+local miscFrame;
+
+local function RefreshMisc()
+	if (miscFrame) then miscFrame:Hide(); end;
+	miscFrame= CreateFrame("Frame", nil, Bloodhound2.miscPanel);
+	miscFrame:SetAllPoints(Bloodhound2.miscPanel);
+	frame = miscFrame;
+	element = frame;
+	Title(L["Bloodhound2 Options"]);
+	Heading(L["Misc"].." ("..ContinentName()..")");
+	AddMisc();
+end
+
 local function RestoreHerbDefaults()
 	Settings.HerbFilter = {};
 end
@@ -289,6 +320,10 @@
 	Settings.OreFilter = {};
 end
 
+local function RestoreMiscDefaults()
+	Settings.MiscFilter = {};
+end
+
 local function RestoreZoneDefaults()
 	Settings.MultiZoneMode = 0;
 	Settings.InspectionRadius = 60;
@@ -321,3 +356,11 @@
 Bloodhound2.orePanel.refresh = RefreshOre;
 InterfaceOptions_AddCategory(Bloodhound2.orePanel);
 
+Bloodhound2.miscPanel = CreateFrame("FRAME", "Bloodhound2_Misc", Bloodhound2.Frame);
+Bloodhound2.miscPanel.name = L["Misc"];
+Bloodhound2.miscPanel.parent = "Bloodhound2";
+Bloodhound2.miscPanel.default = RestoreMiscDefaults;
+Bloodhound2.miscPanel.okay = function() end;
+Bloodhound2.miscPanel.cancel = function() end;
+Bloodhound2.miscPanel.refresh = RefreshMisc;
+InterfaceOptions_AddCategory(Bloodhound2.miscPanel);
\ No newline at end of file