diff WorldPlan.lua @ 49:dbd81d49af02

- Solve more frame data flagging issues - Unify method for resolving filter and visibility states - Flight Map modifications respect filter settings - Solve initial draw issues with tag icon, filter state handling - Solve issues with text layer synchronization during map changes
author Nenue
date Thu, 29 Dec 2016 13:31:20 -0500
parents c0b88bd1e40b
children b289eb3e6a32
line wrap: on
line diff
--- a/WorldPlan.lua	Tue Dec 27 19:46:40 2016 -0500
+++ b/WorldPlan.lua	Thu Dec 29 13:31:20 2016 -0500
@@ -61,7 +61,7 @@
   minimized = {
     r = 0, g = 0, b = 0, a = 0.1,
     iconWidth = 8,
-    borderWidth = 1,
+    borderWidth = 0,
     alpha = 0.5,
     highlightWidth = 0,
     maxAlertLevel = 0,
@@ -97,9 +97,90 @@
       WorldPlanData[key] = true
     end
   end
+  for _, module in ipairs(db.OrderedModules) do
+    if module.OnConfigUpdate then
+      module:OnConfigUpdate()
+    end
+  end
   _G.WorldPlan:Refresh()
 end
 
+-- insert visual options into the tracking button menu
+local DropDown_Initialize = function  (self, callback, dropType)
+  if self ~= WorldMapFrameDropDown then
+    return
+  end
+  local config = WorldPlanData
+  local info = UIDropDownMenu_CreateInfo()
+  info.text = ""
+  info.isTitle = true
+  UIDropDownMenu_AddButton(info)
+  info.text = "|cFF00AAFFWorldPlan|r"
+  info.isTitle = true
+  UIDropDownMenu_AddButton(info)
+  info.isTitle = nil
+  info.disabled = nil
+  info.keepShownOnClick = true
+  info.tooltipOnButton = 1
+
+  info.text = "Enable"
+  info.isNotRadio = true
+  info.value = "EnablePins"
+  info.checked = config.EnablePins
+  info.tooltipTitle = "Enable World Quest Overlays"
+  info.tooltipText = "Toggle the detail layers here."
+  info.func = DropDown_OnClick
+  UIDropDownMenu_AddButton(info)
+
+  info.text = "Display All Profession Quests"
+  info.isNotRadio = true
+  info.value = "ShowAllProfessionQuests"
+  info.checked = config.ShowAllProfessionQuests
+  info.tooltipTitle = "Hidden Quests"
+  info.tooltipText = "Display work order and profession-related quests that are skipped by the default UI."
+  info.func = DropDown_OnClick
+  UIDropDownMenu_AddButton(info)
+
+  info.text = "Show Continent Pins"
+  info.isNotRadio = true
+  info.value = "DisplayContinentPins"
+  info.checked = config.DisplayContinentPins
+  info.tooltipTitle = "Continent Pins"
+  info.tooltipText = "Display quest pins on the continent map (may get cramped)."
+  info.func = DropDown_OnClick
+  UIDropDownMenu_AddButton(info)
+
+  info.text = "Show Summary"
+  info.isNotRadio = true
+  info.value = "DisplayContinentSummary"
+  info.tooltipTitle = "Summary Bar"
+  info.tooltipText = "Display a summary of active world quests. Note: requires directly viewing Broken Isle and Dalaran maps to gain complete info."
+  info.checked = config.DisplayContinentSummary
+  info.func = DropDown_OnClick
+  UIDropDownMenu_AddButton(info)
+  --[[
+
+  info.text = "Nudge Pins"
+  info.isNotRadio = true
+  info.value = "NudgePins"
+  info.tooltipTitle = "Pin Nudging"
+  info.tooltipText = "Adjust the position of quest pins that overlap."
+  info.checked = config.NudgePins
+  info.func = DropDown_OnClick
+  UIDropDownMenu_AddButton(info)
+
+  info.text = "Fade Whiled Grouped"
+  info.isNotRadio = true
+  info.value = "FadeWhileGrouped"
+  info.tooltipTitle = "Group Fade"
+  info.tooltipText = "Reduce pin alpha when grouped, so player dots are easier to see."
+  info.checked = config.FadeWhileGrouped
+  info.func = DropDown_OnClick
+  UIDropDownMenu_AddButton(info)
+  --]]
+end
+
+
 function db.print(...)
   for i = 1, select('#', ...) do
     tinsert(db.ReportChunks, tostring(select(i, ...)))
@@ -292,12 +373,15 @@
     if not module.RegisterEvent then
       module.RegisterEvent = self.RegisterEvent
     end
+    if module.OnConfigUpdate then
+      module:OnConfigUpdate()
+    end
   end
 
 
   self.initialized = true
 
-  hooksecurefunc("UIDropDownMenu_Initialize", self.OnDropDownInitialize)
+  hooksecurefunc("UIDropDownMenu_Initialize", DropDown_Initialize)
 
   hooksecurefunc("WorldMapTrackingOptionsDropDown_OnClick", function(button)
     print("|cFF0088FFWorldMapTrackingOptionsDropDown_OnClick|r")
@@ -457,80 +541,6 @@
   self.isStale = nil
 end
 
--- insert visual options into the tracking button menu
-WorldPlanCore.OnDropDownInitialize = function  (self, callback, dropType)
-  if self ~= WorldMapFrameDropDown then
-    return
-  end
-  local config = WorldPlanData
-  local info = UIDropDownMenu_CreateInfo()
-  info.text = ""
-  info.isTitle = true
-  UIDropDownMenu_AddButton(info)
-  info.text = "|cFF00AAFFWorldPlan|r"
-  info.isTitle = true
-  UIDropDownMenu_AddButton(info)
-  info.isTitle = nil
-  info.disabled = nil
-  info.keepShownOnClick = true
-  info.tooltipOnButton = 1
-
-  info.text = "Enable"
-  info.isNotRadio = true
-  info.value = "EnablePins"
-  info.checked = config.EnablePins
-  info.tooltipTitle = "Enable World Quest Overlays"
-  info.tooltipText = "Toggle the detail layers here."
-  info.func = DropDown_OnClick
-  UIDropDownMenu_AddButton(info)
-
-  info.text = "Display All Profession Quests"
-  info.isNotRadio = true
-  info.value = "ShowAllProfessionQuests"
-  info.checked = config.ShowAllProfessionQuests
-  info.tooltipTitle = "Hidden Quests"
-  info.tooltipText = "Display work order and profession-related quests that are skipped by the default UI."
-  info.func = DropDown_OnClick
-  UIDropDownMenu_AddButton(info)
-
-  info.text = "Show Continent Pins"
-  info.isNotRadio = true
-  info.value = "DisplayContinentPins"
-  info.checked = config.DisplayContinentPins
-  info.tooltipTitle = "Continent Pins"
-  info.tooltipText = "Display quest pins on the continent map (may get cramped)."
-  info.func = DropDown_OnClick
-  UIDropDownMenu_AddButton(info)
-
-  info.text = "Show Summary"
-  info.isNotRadio = true
-  info.value = "DisplayContinentSummary"
-  info.tooltipTitle = "Summary Bar"
-  info.tooltipText = "Display a summary of active world quests. Note: requires directly viewing Broken Isle and Dalaran maps to gain complete info."
-  info.checked = config.DisplayContinentSummary
-  info.func = DropDown_OnClick
-  UIDropDownMenu_AddButton(info)
-  --[[
-
-  info.text = "Nudge Pins"
-  info.isNotRadio = true
-  info.value = "NudgePins"
-  info.tooltipTitle = "Pin Nudging"
-  info.tooltipText = "Adjust the position of quest pins that overlap."
-  info.checked = config.NudgePins
-  info.func = DropDown_OnClick
-  UIDropDownMenu_AddButton(info)
-
-  info.text = "Fade Whiled Grouped"
-  info.isNotRadio = true
-  info.value = "FadeWhileGrouped"
-  info.tooltipTitle = "Group Fade"
-  info.tooltipText = "Reduce pin alpha when grouped, so player dots are easier to see."
-  info.checked = config.FadeWhileGrouped
-  info.func = DropDown_OnClick
-  UIDropDownMenu_AddButton(info)
-  --]]
-end
 
 --------------------------------------------------------------------------------------------------------------------
 -------------------