comparison 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
comparison
equal deleted inserted replaced
48:c0b88bd1e40b 49:dbd81d49af02
59 numberFontObject = 'WorldPlanNumberFontThin' 59 numberFontObject = 'WorldPlanNumberFontThin'
60 }, 60 },
61 minimized = { 61 minimized = {
62 r = 0, g = 0, b = 0, a = 0.1, 62 r = 0, g = 0, b = 0, a = 0.1,
63 iconWidth = 8, 63 iconWidth = 8,
64 borderWidth = 1, 64 borderWidth = 0,
65 alpha = 0.5, 65 alpha = 0.5,
66 highlightWidth = 0, 66 highlightWidth = 0,
67 maxAlertLevel = 0, 67 maxAlertLevel = 0,
68 NoIcon = true, 68 NoIcon = true,
69 69
95 WorldPlanData[key] = nil 95 WorldPlanData[key] = nil
96 else 96 else
97 WorldPlanData[key] = true 97 WorldPlanData[key] = true
98 end 98 end
99 end 99 end
100 for _, module in ipairs(db.OrderedModules) do
101 if module.OnConfigUpdate then
102 module:OnConfigUpdate()
103 end
104 end
100 _G.WorldPlan:Refresh() 105 _G.WorldPlan:Refresh()
101 end 106 end
107
108 -- insert visual options into the tracking button menu
109 local DropDown_Initialize = function (self, callback, dropType)
110 if self ~= WorldMapFrameDropDown then
111 return
112 end
113 local config = WorldPlanData
114 local info = UIDropDownMenu_CreateInfo()
115 info.text = ""
116 info.isTitle = true
117 UIDropDownMenu_AddButton(info)
118 info.text = "|cFF00AAFFWorldPlan|r"
119 info.isTitle = true
120 UIDropDownMenu_AddButton(info)
121 info.isTitle = nil
122 info.disabled = nil
123 info.keepShownOnClick = true
124 info.tooltipOnButton = 1
125
126 info.text = "Enable"
127 info.isNotRadio = true
128 info.value = "EnablePins"
129 info.checked = config.EnablePins
130 info.tooltipTitle = "Enable World Quest Overlays"
131 info.tooltipText = "Toggle the detail layers here."
132 info.func = DropDown_OnClick
133 UIDropDownMenu_AddButton(info)
134
135 info.text = "Display All Profession Quests"
136 info.isNotRadio = true
137 info.value = "ShowAllProfessionQuests"
138 info.checked = config.ShowAllProfessionQuests
139 info.tooltipTitle = "Hidden Quests"
140 info.tooltipText = "Display work order and profession-related quests that are skipped by the default UI."
141 info.func = DropDown_OnClick
142 UIDropDownMenu_AddButton(info)
143
144 info.text = "Show Continent Pins"
145 info.isNotRadio = true
146 info.value = "DisplayContinentPins"
147 info.checked = config.DisplayContinentPins
148 info.tooltipTitle = "Continent Pins"
149 info.tooltipText = "Display quest pins on the continent map (may get cramped)."
150 info.func = DropDown_OnClick
151 UIDropDownMenu_AddButton(info)
152
153 info.text = "Show Summary"
154 info.isNotRadio = true
155 info.value = "DisplayContinentSummary"
156 info.tooltipTitle = "Summary Bar"
157 info.tooltipText = "Display a summary of active world quests. Note: requires directly viewing Broken Isle and Dalaran maps to gain complete info."
158 info.checked = config.DisplayContinentSummary
159 info.func = DropDown_OnClick
160 UIDropDownMenu_AddButton(info)
161 --[[
162
163 info.text = "Nudge Pins"
164 info.isNotRadio = true
165 info.value = "NudgePins"
166 info.tooltipTitle = "Pin Nudging"
167 info.tooltipText = "Adjust the position of quest pins that overlap."
168 info.checked = config.NudgePins
169 info.func = DropDown_OnClick
170 UIDropDownMenu_AddButton(info)
171
172 info.text = "Fade Whiled Grouped"
173 info.isNotRadio = true
174 info.value = "FadeWhileGrouped"
175 info.tooltipTitle = "Group Fade"
176 info.tooltipText = "Reduce pin alpha when grouped, so player dots are easier to see."
177 info.checked = config.FadeWhileGrouped
178 info.func = DropDown_OnClick
179 UIDropDownMenu_AddButton(info)
180 --]]
181 end
182
102 183
103 function db.print(...) 184 function db.print(...)
104 for i = 1, select('#', ...) do 185 for i = 1, select('#', ...) do
105 tinsert(db.ReportChunks, tostring(select(i, ...))) 186 tinsert(db.ReportChunks, tostring(select(i, ...)))
106 end 187 end
290 db.Config[module:GetName()] = db.Config[module:GetName()] or {} 371 db.Config[module:GetName()] = db.Config[module:GetName()] or {}
291 if module.Setup then module:Setup() end 372 if module.Setup then module:Setup() end
292 if not module.RegisterEvent then 373 if not module.RegisterEvent then
293 module.RegisterEvent = self.RegisterEvent 374 module.RegisterEvent = self.RegisterEvent
294 end 375 end
376 if module.OnConfigUpdate then
377 module:OnConfigUpdate()
378 end
295 end 379 end
296 380
297 381
298 self.initialized = true 382 self.initialized = true
299 383
300 hooksecurefunc("UIDropDownMenu_Initialize", self.OnDropDownInitialize) 384 hooksecurefunc("UIDropDownMenu_Initialize", DropDown_Initialize)
301 385
302 hooksecurefunc("WorldMapTrackingOptionsDropDown_OnClick", function(button) 386 hooksecurefunc("WorldMapTrackingOptionsDropDown_OnClick", function(button)
303 print("|cFF0088FFWorldMapTrackingOptionsDropDown_OnClick|r") 387 print("|cFF0088FFWorldMapTrackingOptionsDropDown_OnClick|r")
304 local value = button.value 388 local value = button.value
305 if (value == "worldQuestFilterOrderResources" or value == "worldQuestFilterArtifactPower" or 389 if (value == "worldQuestFilterOrderResources" or value == "worldQuestFilterArtifactPower" or
455 end 539 end
456 540
457 self.isStale = nil 541 self.isStale = nil
458 end 542 end
459 543
460 -- insert visual options into the tracking button menu
461 WorldPlanCore.OnDropDownInitialize = function (self, callback, dropType)
462 if self ~= WorldMapFrameDropDown then
463 return
464 end
465 local config = WorldPlanData
466 local info = UIDropDownMenu_CreateInfo()
467 info.text = ""
468 info.isTitle = true
469 UIDropDownMenu_AddButton(info)
470 info.text = "|cFF00AAFFWorldPlan|r"
471 info.isTitle = true
472 UIDropDownMenu_AddButton(info)
473 info.isTitle = nil
474 info.disabled = nil
475 info.keepShownOnClick = true
476 info.tooltipOnButton = 1
477
478 info.text = "Enable"
479 info.isNotRadio = true
480 info.value = "EnablePins"
481 info.checked = config.EnablePins
482 info.tooltipTitle = "Enable World Quest Overlays"
483 info.tooltipText = "Toggle the detail layers here."
484 info.func = DropDown_OnClick
485 UIDropDownMenu_AddButton(info)
486
487 info.text = "Display All Profession Quests"
488 info.isNotRadio = true
489 info.value = "ShowAllProfessionQuests"
490 info.checked = config.ShowAllProfessionQuests
491 info.tooltipTitle = "Hidden Quests"
492 info.tooltipText = "Display work order and profession-related quests that are skipped by the default UI."
493 info.func = DropDown_OnClick
494 UIDropDownMenu_AddButton(info)
495
496 info.text = "Show Continent Pins"
497 info.isNotRadio = true
498 info.value = "DisplayContinentPins"
499 info.checked = config.DisplayContinentPins
500 info.tooltipTitle = "Continent Pins"
501 info.tooltipText = "Display quest pins on the continent map (may get cramped)."
502 info.func = DropDown_OnClick
503 UIDropDownMenu_AddButton(info)
504
505 info.text = "Show Summary"
506 info.isNotRadio = true
507 info.value = "DisplayContinentSummary"
508 info.tooltipTitle = "Summary Bar"
509 info.tooltipText = "Display a summary of active world quests. Note: requires directly viewing Broken Isle and Dalaran maps to gain complete info."
510 info.checked = config.DisplayContinentSummary
511 info.func = DropDown_OnClick
512 UIDropDownMenu_AddButton(info)
513 --[[
514
515 info.text = "Nudge Pins"
516 info.isNotRadio = true
517 info.value = "NudgePins"
518 info.tooltipTitle = "Pin Nudging"
519 info.tooltipText = "Adjust the position of quest pins that overlap."
520 info.checked = config.NudgePins
521 info.func = DropDown_OnClick
522 UIDropDownMenu_AddButton(info)
523
524 info.text = "Fade Whiled Grouped"
525 info.isNotRadio = true
526 info.value = "FadeWhileGrouped"
527 info.tooltipTitle = "Group Fade"
528 info.tooltipText = "Reduce pin alpha when grouped, so player dots are easier to see."
529 info.checked = config.FadeWhileGrouped
530 info.func = DropDown_OnClick
531 UIDropDownMenu_AddButton(info)
532 --]]
533 end
534 544
535 -------------------------------------------------------------------------------------------------------------------- 545 --------------------------------------------------------------------------------------------------------------------
536 ------------------- 546 -------------------
537 547
538 548