comparison 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
comparison
equal deleted inserted replaced
7:8e81e24efb3f 8:75ca29b399e8
6 6
7 Settings = {}; 7 Settings = {};
8 Settings.MultiZoneMode = 0; 8 Settings.MultiZoneMode = 0;
9 Settings.HerbFilter = {}; 9 Settings.HerbFilter = {};
10 Settings.OreFilter = {}; 10 Settings.OreFilter = {};
11 Settings.MiscFilter = {};
11 Settings.ZoneFilter = {{}, {}, {}, {}, {}}; 12 Settings.ZoneFilter = {{}, {}, {}, {}, {}};
12 Settings.InspectionRadius = 60; 13 Settings.InspectionRadius = 60;
14
13 local function Title(text) 15 local function Title(text)
14 local str = frame:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge"); 16 local str = frame:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge");
15 str:SetPoint("TOPLEFT", element, "TOPLEFT", 16, -16); 17 str:SetPoint("TOPLEFT", element, "TOPLEFT", 16, -16);
16 str:SetJustifyH("LEFT"); 18 str:SetJustifyH("LEFT");
17 str:SetJustifyV("TOP"); 19 str:SetJustifyV("TOP");
198 if not Settings.OreFilter then 200 if not Settings.OreFilter then
199 Settings.OreFilter = {}; 201 Settings.OreFilter = {};
200 end 202 end
201 203
202 CheckBoxes(table, Settings.OreFilter); 204 CheckBoxes(table, Settings.OreFilter);
205 end
206
207 function AddMisc()
208 local table = {};
209
210 for h, v in pairs(Bloodhound2.ContinentMisc) do
211 local name = L[h];
212 if not name then name="Misc "..h; end;
213 table[h] = name;
214 end
215
216 if not Settings.MiscFilter then
217 Settings.MiscFilter = {};
218 end
219
220 CheckBoxes(table, Settings.MiscFilter);
203 end 221 end
204 222
205 local function CopyTable(table) 223 local function CopyTable(table)
206 local copy = {}; 224 local copy = {};
207 for k,v in pairs(table) do 225 for k,v in pairs(table) do
279 Title(L["Bloodhound2 Options"]); 297 Title(L["Bloodhound2 Options"]);
280 Heading(L["Minerals"].." ("..ContinentName()..")"); 298 Heading(L["Minerals"].." ("..ContinentName()..")");
281 AddOre(); 299 AddOre();
282 end 300 end
283 301
302 local miscFrame;
303
304 local function RefreshMisc()
305 if (miscFrame) then miscFrame:Hide(); end;
306 miscFrame= CreateFrame("Frame", nil, Bloodhound2.miscPanel);
307 miscFrame:SetAllPoints(Bloodhound2.miscPanel);
308 frame = miscFrame;
309 element = frame;
310 Title(L["Bloodhound2 Options"]);
311 Heading(L["Misc"].." ("..ContinentName()..")");
312 AddMisc();
313 end
314
284 local function RestoreHerbDefaults() 315 local function RestoreHerbDefaults()
285 Settings.HerbFilter = {}; 316 Settings.HerbFilter = {};
286 end 317 end
287 318
288 local function RestoreOreDefaults() 319 local function RestoreOreDefaults()
289 Settings.OreFilter = {}; 320 Settings.OreFilter = {};
321 end
322
323 local function RestoreMiscDefaults()
324 Settings.MiscFilter = {};
290 end 325 end
291 326
292 local function RestoreZoneDefaults() 327 local function RestoreZoneDefaults()
293 Settings.MultiZoneMode = 0; 328 Settings.MultiZoneMode = 0;
294 Settings.InspectionRadius = 60; 329 Settings.InspectionRadius = 60;
319 Bloodhound2.orePanel.okay = function() end; 354 Bloodhound2.orePanel.okay = function() end;
320 Bloodhound2.orePanel.cancel = function() end; 355 Bloodhound2.orePanel.cancel = function() end;
321 Bloodhound2.orePanel.refresh = RefreshOre; 356 Bloodhound2.orePanel.refresh = RefreshOre;
322 InterfaceOptions_AddCategory(Bloodhound2.orePanel); 357 InterfaceOptions_AddCategory(Bloodhound2.orePanel);
323 358
359 Bloodhound2.miscPanel = CreateFrame("FRAME", "Bloodhound2_Misc", Bloodhound2.Frame);
360 Bloodhound2.miscPanel.name = L["Misc"];
361 Bloodhound2.miscPanel.parent = "Bloodhound2";
362 Bloodhound2.miscPanel.default = RestoreMiscDefaults;
363 Bloodhound2.miscPanel.okay = function() end;
364 Bloodhound2.miscPanel.cancel = function() end;
365 Bloodhound2.miscPanel.refresh = RefreshMisc;
366 InterfaceOptions_AddCategory(Bloodhound2.miscPanel);