annotate WorldPlan.lua @ 45:db570c6a0ffb v1.0-rc12

- Fixed filter buttons losing their anchor after FlightMap interactions - Fixed flickering tooltips - Fixed a source of hangs while opening the world map, particularly in non-Broken-Isle continents. - Workaround for World Map Action Button: Temporarily activate blizzard POI buttons while a quest-targeting spell is on the cursor.
author Nenue
date Mon, 26 Dec 2016 10:20:52 -0500
parents 77c2ffb5c7f5
children 733785e306a3
rev   line source
Nenue@0 1 -- WorldPlan.lua
Nenue@0 2 -- Created: 8/16/2016 8:19 AM
Nenue@0 3 -- %file-revision%
Nenue@40 4 local addonFileName, db = ...
Nenue@40 5 local print = DEVIAN_WORKSPACE and function(...) _G.print('WP', ...) end or function() end
Nenue@40 6 local WP_VERSION = "1.0"
Nenue@40 7 local tinsert, pairs, floor = tinsert, pairs, floor
Nenue@40 8 local tremove, ipairs, wipe, unpack = tremove, ipairs, wipe, unpack
Nenue@40 9 local select, type, tostring, tonumber = select, type, tostring, tonumber
Nenue@40 10 local ITEM_QUALITY_COLORS = ITEM_QUALITY_COLORS
Nenue@40 11 local BROKEN_ISLES_ID = 1007
Nenue@40 12 local GetCurrentMapAreaID = GetCurrentMapAreaID
Nenue@40 13 local GetTime, IsLoggedIn = GetTime, IsLoggedIn
Nenue@0 14
Nenue@40 15 -- Define tables here so the pointers match up
Nenue@40 16 WorldPlanCore = { defaults = {}, modules = {}, TaskQueue = {}, }
Nenue@36 17 WorldPlanQuestsMixin = {
Nenue@40 18 UsedPositions = {},
Nenue@36 19 }
Nenue@35 20 WorldPlanPOIMixin = {}
Nenue@40 21 WorldPlanSummaryMixin = {}
Nenue@40 22 db.filtersDirty = true
Nenue@40 23 db.questsDirty = true
Nenue@40 24 db.OrderedModules = {}
Nenue@40 25 db.LoadedModules = {}
Nenue@40 26 db.UsedFilters = {}
Nenue@40 27 db.QuestsByZone = {}
Nenue@40 28 db.QuestsByID = {}
Nenue@40 29 db.TasksByID = {}
Nenue@40 30 db.FreePins = {}
Nenue@40 31 db.UsedPins = {}
Nenue@40 32 db.ReportChunks = {}
Nenue@0 33
Nenue@0 34 -- default color templates
Nenue@40 35 db.DefaultType = {
Nenue@0 36 a = 1,
Nenue@0 37 r = 1, g = 1, b = 1,
Nenue@0 38 x = 0, y = 0,
Nenue@0 39 desaturated = true,
Nenue@33 40 pinMask = "Interface\\Minimap\\UI-Minimap-Background",
Nenue@33 41 rewardMask = "Interface\\Minimap\\UI-Minimap-Background",
Nenue@33 42 texture = "Interface\\BUTTONS\\YELLOWORANGE64",
Nenue@0 43 continent = {
Nenue@40 44 iconWidth = 14,
Nenue@40 45 borderWidth = 2,
Nenue@36 46 highlightWidth = 1,
Nenue@40 47 TagSize = 8,
Nenue@36 48 maxAlertLevel = 0,
Nenue@27 49 showNumber = true,
Nenue@30 50 numberFontObject = 'WorldPlanFont'
Nenue@0 51 },
Nenue@0 52 zone = {
Nenue@36 53 iconWidth = 22,
Nenue@36 54 borderWidth = 3,
Nenue@36 55 highlightWidth = 2,
Nenue@0 56 TagSize = 12,
Nenue@36 57 maxAlertLevel = 3,
Nenue@27 58 showNumber = true,
Nenue@30 59 numberFontObject = 'WorldPlanNumberFontThin'
Nenue@0 60 },
Nenue@0 61 minimized = {
Nenue@40 62 r = 0, g = 0, b = 0, a = 0.1,
Nenue@40 63 iconWidth = 8,
Nenue@40 64 borderWidth = 2,
Nenue@40 65 alpha = 0.5,
Nenue@36 66 highlightWidth = 0,
Nenue@40 67 maxAlertLevel = 0,
Nenue@0 68 NoIcon = true,
Nenue@40 69
Nenue@40 70 TagSize = 8,
Nenue@0 71 TimeleftStage = 1,
Nenue@27 72 showNumber = false,
Nenue@40 73 alpha = 0.1,
Nenue@0 74 }
Nenue@0 75 }
Nenue@29 76
Nenue@40 77 db.DefaultConfig = {
Nenue@27 78 ShowAllProfessionQuests = false,
Nenue@9 79 DisplayContinentSummary = true,
Nenue@9 80 DisplayContinentPins = true,
Nenue@9 81 NotifyWhenNewQuests = true,
Nenue@9 82 EnablePins = true,
Nenue@34 83 FadeWhileGrouped = false,
Nenue@40 84 FlightMapAlphaLimits = {1, 1, 1},
Nenue@40 85 FlightMapScalingLimits = {1, 3, 1.5},
Nenue@9 86 }
Nenue@9 87
Nenue@0 88
Nenue@0 89
Nenue@0 90 -- tracking menu toggler
Nenue@0 91 local DropDown_OnClick = function(self)
Nenue@0 92 local key = self.value
Nenue@0 93 if key then
Nenue@0 94 if WorldPlanData[key] then
Nenue@0 95 WorldPlanData[key] = nil
Nenue@0 96 else
Nenue@0 97 WorldPlanData[key] = true
Nenue@0 98 end
Nenue@0 99 end
Nenue@33 100 _G.WorldPlan:Refresh()
Nenue@0 101 end
Nenue@0 102
Nenue@40 103 function db.print(...)
Nenue@0 104 for i = 1, select('#', ...) do
Nenue@40 105 tinsert(db.ReportChunks, tostring(select(i, ...)))
Nenue@0 106 end
Nenue@0 107 end
Nenue@0 108
Nenue@40 109 function WorldPlanCore:print(...) db.print(...) end
Nenue@40 110
Nenue@40 111 function WorldPlanCore:AddHandler (frame)
Nenue@40 112 if not db.LoadedModules[frame] then
Nenue@40 113 print('|cFFFFFF00'..self:GetName()..':AddHandler()', frame:GetName(), self.initialized)
Nenue@40 114 db.LoadedModules[frame] = true
Nenue@40 115 tinsert(db.OrderedModules, frame)
Nenue@40 116
Nenue@40 117 if frame.defaults then
Nenue@40 118 db.DefaultConfig[frame:GetName()] = frame.defaults
Nenue@40 119 end
Nenue@40 120
Nenue@40 121 frame.GetTypeInfo = function(frame, typeID)
Nenue@40 122 return self:GetTypeInfo(frame, typeID)
Nenue@40 123 end
Nenue@40 124
Nenue@40 125 frame.owningFrame = self
Nenue@40 126 else
Nenue@40 127
Nenue@40 128 print('|cFFFF4400'..self:GetName()..':AddHandler()', frame:GetName())
Nenue@30 129 end
Nenue@30 130 end
Nenue@30 131
Nenue@36 132 function WorldPlanCore:OnLoad ()
Nenue@29 133
Nenue@29 134 self.Types = setmetatable({}, {
Nenue@29 135 __newindex = function(t, k, v)
Nenue@29 136 if type(v) == 'table' then
Nenue@30 137 print('adding owner', k)
Nenue@30 138 v = setmetatable(v, {
Nenue@30 139 __newindex = function(t2,k2,v2)
Nenue@30 140 if type(v2) == 'table' then
Nenue@40 141 --print('adding type', k2)
Nenue@30 142 v2 = setmetatable(v2, {__index = function(t3,k3)
Nenue@30 143 --print('##deferring to default key', k3)
Nenue@40 144 return db.DefaultType[k3]
Nenue@30 145 end})
Nenue@30 146 end
Nenue@30 147 rawset(t2,k2,v2)
Nenue@29 148 end})
Nenue@29 149 end
Nenue@29 150 rawset(t,k,v)
Nenue@29 151 end
Nenue@29 152 })
Nenue@29 153
Nenue@30 154 self.Types[self] = {}
Nenue@29 155
Nenue@29 156 for index, color in pairs(ITEM_QUALITY_COLORS) do
Nenue@30 157 self:AddTypeInfo(self, index, { r = color.r, g = color.g, b = color.b, hex = color.hex, })
Nenue@29 158 end
Nenue@29 159
Nenue@0 160
Nenue@40 161 db.print('v'..WP_VERSION)
Nenue@40 162
Nenue@0 163
Nenue@0 164 self:RegisterEvent("QUESTLINE_UPDATE")
Nenue@0 165 self:RegisterEvent("QUEST_LOG_UPDATE")
Nenue@0 166 self:RegisterEvent("WORLD_MAP_UPDATE")
Nenue@40 167 self:RegisterEvent("SPELLS_CHANGED")
Nenue@40 168 self:RegisterEvent('PLAYER_ENTERING_WORLD')
Nenue@0 169 self:RegisterEvent("WORLD_QUEST_COMPLETED_BY_SPELL")
Nenue@0 170 self:RegisterEvent("SUPER_TRACKED_QUEST_CHANGED")
Nenue@0 171 self:RegisterEvent("SKILL_LINES_CHANGED")
Nenue@0 172 self:RegisterEvent("ARTIFACT_XP_UPDATE")
Nenue@0 173 self:RegisterEvent("ADDON_LOADED")
Nenue@40 174 self:RegisterEvent("PLAYER_LOGIN")
Nenue@40 175 --self:SetParent(WorldMapFrame)
Nenue@0 176 end
Nenue@0 177
Nenue@36 178 function WorldPlanCore:OnShow()
Nenue@40 179 --print(self:GetName()..':OnShow()')
Nenue@40 180 --hooksecurefunc(self, 'SetScript', function(...) self:print('|cFFFFFF00'..self:GetName()..':SetScript()|r', ...) end)
Nenue@27 181 end
Nenue@27 182
Nenue@41 183 local BROKEN_ISLE_MAPS = {
Nenue@41 184 [1007] = true, -- Broken Isle
Nenue@41 185 [1014] = true, -- Dalaran
Nenue@41 186 [1021] = true, -- Broken Shoree
Nenue@41 187 [1024] = true, -- Highmountain
Nenue@43 188 [1015] = true, -- Azsuna
Nenue@41 189 [1017] = true, -- Azsuna
Nenue@41 190 [1018] = true, -- Val'Sharah
Nenue@41 191 [1033] = true, -- Suramar
Nenue@41 192 [1077] = true, -- Dreamgrove
Nenue@41 193 [1096] = true, -- Eye of Azshara
Nenue@41 194 [1080] = true, -- Thunder Totem
Nenue@41 195 [1072] = true, -- True Shot Lodge,
Nenue@40 196
Nenue@41 197 }
Nenue@41 198
Nenue@41 199 function WorldPlanCore:SetCurrentMap()
Nenue@41 200 local mapAreaID = GetCurrentMapAreaID()
Nenue@41 201 local isBrokenIsle = BROKEN_ISLE_MAPS[mapAreaID]
Nenue@41 202
Nenue@41 203
Nenue@41 204 db.currentMapID = mapAreaID
Nenue@41 205 db.isContinentMap = (mapAreaID == BROKEN_ISLES_ID)
Nenue@40 206 db.useContinentType = (WorldMapDetailFrame:GetScale() < 1)
Nenue@40 207
Nenue@41 208 for _, module in ipairs(db.OrderedModules) do
Nenue@41 209 if module.OnMapInfo then
Nenue@41 210 print(' |cFF00FFFF'..module:GetName() .. ':OnMapInfo()|r')
Nenue@41 211 module:OnMapInfo(isBrokenIsle, mapAreaID)
Nenue@41 212 end
Nenue@41 213 end
Nenue@40 214 end
Nenue@40 215
Nenue@40 216
Nenue@36 217 function WorldPlanCore:OnEvent (event, ...)
Nenue@40 218
Nenue@40 219 print('|cFF00FF88'..self:GetName().. ':OnEvent()|r', event, GetTime(), 'init:', self.initialized)
Nenue@0 220 if event == 'ADDON_LOADED' then
Nenue@0 221
Nenue@0 222 if IsLoggedIn() and not self.initialized then
Nenue@0 223 self:Setup()
Nenue@0 224 end
Nenue@27 225 else
Nenue@41 226 if (event == 'WORLD_MAP_UPDATE') or (event == 'PLAYER_ENTERING_WORLD') or (event == 'PLAYER_LOGIN') then
Nenue@40 227 print('|cFFFF4400currentMapID =', db.currentMapID, ...)
Nenue@41 228 self:SetCurrentMap()
Nenue@0 229 end
Nenue@0 230 end
Nenue@0 231 end
Nenue@0 232
Nenue@33 233 function WorldPlanCore:OnNext(func)
Nenue@34 234
Nenue@34 235
Nenue@33 236 tinsert(self.TaskQueue, func)
Nenue@35 237 --self:print('|cFF00FF00adding scheduled task #', #self.TaskQueue)
Nenue@33 238 end
Nenue@33 239
Nenue@33 240 function WorldPlanCore:OnUpdate()
Nenue@33 241 if #self.TaskQueue >= 1 then
Nenue@34 242 local func = tremove(self.TaskQueue, 1)
Nenue@34 243 --self:print('|cFF00FF00running scheduled task #', #self.TaskQueue)
Nenue@33 244 func()
Nenue@33 245 end
Nenue@33 246
Nenue@33 247 if self.isStale then
Nenue@40 248 -- these need to happen in load order
Nenue@40 249 for i, module in ipairs(db.OrderedModules) do
Nenue@40 250 if module:IsVisible() and module.isStale then
Nenue@33 251 print('|cFF00FF00internal '..module:GetName()..':Refresh()|r')
Nenue@33 252 module:Refresh()
Nenue@33 253 end
Nenue@33 254 end
Nenue@40 255 self.isStale = nil
Nenue@33 256 end
Nenue@40 257
Nenue@40 258 if #db.ReportChunks >= 1 then
Nenue@40 259
Nenue@40 260 DEFAULT_CHAT_FRAME:AddMessage("|cFF0088FF"..addonFileName.."|r: " .. table.concat(db.ReportChunks, ', '))
Nenue@40 261 wipe(db.ReportChunks)
Nenue@40 262 end
Nenue@40 263
Nenue@33 264 end
Nenue@0 265
Nenue@36 266 function WorldPlanCore:Setup ()
Nenue@40 267 print('|cFFFFFF00'..self:GetName()..':Setup()|r')
Nenue@40 268
Nenue@0 269 if not WorldPlanData then
Nenue@40 270 WorldPlanData = {key = 0}
Nenue@0 271 end
Nenue@0 272 WorldPlanData.key = (WorldPlanData.key or 0) + 1
Nenue@40 273 db.Config = WorldPlanData
Nenue@40 274 for k,v in pairs(db.DefaultConfig) do
Nenue@18 275 --[===[@non-debug@
Nenue@40 276 if not db.Config[k] then
Nenue@40 277 db.Config[k] = v
Nenue@18 278 end
Nenue@18 279
Nenue@18 280 --@end-non-debug@]===]
Nenue@18 281 --@debug@
Nenue@40 282 db.Config[k] = v
Nenue@18 283 --@end-debug@
Nenue@9 284 end
Nenue@9 285
Nenue@0 286
Nenue@40 287 db.currentMapID = GetCurrentMapAreaID()
Nenue@40 288
Nenue@40 289 for i, module in ipairs(db.OrderedModules) do
Nenue@40 290 db.Config[module:GetName()] = db.Config[module:GetName()] or {}
Nenue@0 291 if module.Setup then module:Setup() end
Nenue@0 292 if not module.RegisterEvent then
Nenue@0 293 module.RegisterEvent = self.RegisterEvent
Nenue@0 294 end
Nenue@0 295 end
Nenue@40 296
Nenue@40 297
Nenue@0 298 self.initialized = true
Nenue@0 299
Nenue@9 300 hooksecurefunc("UIDropDownMenu_Initialize", self.OnDropDownInitialize)
Nenue@33 301
Nenue@33 302 hooksecurefunc("WorldMapTrackingOptionsDropDown_OnClick", function(button)
Nenue@33 303 print("|cFF0088FFWorldMapTrackingOptionsDropDown_OnClick|r")
Nenue@33 304 local value = button.value
Nenue@33 305 if (value == "worldQuestFilterOrderResources" or value == "worldQuestFilterArtifactPower" or
Nenue@33 306 value == "worldQuestFilterProfessionMaterials" or value == "worldQuestFilterGold" or
Nenue@33 307 value == "worldQuestFilterEquipment") then
Nenue@33 308 self:Refresh(true)
Nenue@33 309 end
Nenue@33 310 end)
Nenue@40 311
Nenue@40 312
Nenue@40 313 hooksecurefunc("WorldMapFrame_Update", function()
Nenue@40 314 print('|cFFFF4400WorldMapFrame_Update|r')
Nenue@41 315 for _,module in ipairs(db.OrderedModules) do
Nenue@41 316 if module.OnWorldMapFrameUpdate then
Nenue@41 317 print(' |cFFFF4400'..module:GetName()..'|r')
Nenue@41 318 module:OnWorldMapFrameUpdate()
Nenue@41 319 end
Nenue@41 320 end
Nenue@40 321 end)
Nenue@40 322
Nenue@40 323 SLASH_WORLDPLAN1 = "/worldplan"
Nenue@40 324 SLASH_WORLDPLAN2 = "/wp"
Nenue@40 325
Nenue@40 326
Nenue@40 327
Nenue@40 328 SlashCmdList.WORLDPLAN = function(args)
Nenue@40 329 local arg1, arg2, extraArgs = args:match("(%S+)%s*(%S*)%s*(.*)")
Nenue@40 330
Nenue@40 331 if arg1 == 'wq' then
Nenue@40 332 if arg2 and WorldPlanQuests[arg2] then
Nenue@40 333 self:print('WorldPlanQuests:'..arg2..'()')
Nenue@40 334 WorldPlanQuests[arg2](WorldPlanQuests)
Nenue@40 335 elseif arg2 == 'flightscale' and extraArgs then
Nenue@40 336 local val1, val2, val3 = extraArgs:match("(%S+)%s*(%S*)%s*(%S*)")
Nenue@40 337 if tonumber(val1) and tonumber(val2) and tonumber(val3) then
Nenue@40 338 db.Config.FlightMapScalingLimits = {tonumber(val1), tonumber(val2), tonumber(val3)}
Nenue@40 339 self:print('FlightMapFrame scaling limits updated:', unpack(db.Config.FlightMapScalingLimits))
Nenue@40 340 else
Nenue@40 341 self:print('FlightMapFrame scaling limits:', unpack(db.Config.FlightMapScalingLimits))
Nenue@40 342 end
Nenue@40 343 elseif arg2 == 'flightalpha' and extraArgs then
Nenue@40 344 local val1, val2, val3 = extraArgs:match("(%S+)%s*(%S*)%s*(%S*)")
Nenue@40 345 if tonumber(val1) and tonumber(val2) and tonumber(val3) then
Nenue@40 346 db.Config.FlightMapAlphaLimits = {tonumber(val1), tonumber(val2), tonumber(val3)}
Nenue@40 347 self:print('FlightMapFrame alpha limits updated:', unpack(db.Config.FlightMapAlphaLimits))
Nenue@40 348 else
Nenue@40 349 self:print('FlightMapFrame alpha limits:', unpack(db.Config.FlightMapAlphaLimits))
Nenue@40 350 end
Nenue@40 351 else
Nenue@40 352
Nenue@40 353 self:print('WorldPlanQuests:Refresh(true)')
Nenue@40 354 WorldPlanQuests:Refresh(true)
Nenue@40 355 end
Nenue@40 356 elseif arg1 == 'filter' then
Nenue@40 357 if arg2 and WorldPlanSummary[arg2] then
Nenue@40 358 self:print('WorldPlanSummary:'..arg2..'()')
Nenue@40 359 WorldPlanSummary[arg2](WorldPlanSummary)
Nenue@40 360 else
Nenue@40 361 self:print('WorldPlanSummary:Refresh(true)')
Nenue@40 362 WorldPlanSummary:Refresh(true)
Nenue@40 363 end
Nenue@40 364 else
Nenue@40 365 self:print('Refreshing data.')
Nenue@40 366 self:Refresh(true)
Nenue@40 367 end
Nenue@40 368
Nenue@40 369 end
Nenue@0 370 end
Nenue@0 371
Nenue@40 372 -- registers a template table
Nenue@36 373 function WorldPlanCore:AddTypeInfo(owner, id, info)
Nenue@30 374 self.Types[owner] = self.Types[owner] or {}
Nenue@30 375 self.Types[owner][id] = info
Nenue@30 376 print('Type('..owner:GetName()..')('..id..') = '.. tostring(info))
Nenue@30 377 end
Nenue@30 378
Nenue@40 379 -- recall a template table, with situational details filled in
Nenue@36 380 function WorldPlanCore:GetTypeInfo(owner, typeID)
Nenue@29 381 local info, extraInfo
Nenue@30 382 if not owner then
Nenue@30 383 --print('## deferring to default type list')
Nenue@30 384 else
Nenue@30 385 --print('## pulling for', owner:GetName(), 'id =', typeID)
Nenue@30 386 end
Nenue@30 387
Nenue@30 388 owner = owner or self
Nenue@30 389 if (not typeID) or (not self.Types[owner][typeID]) then
Nenue@30 390 --print('## sending list default')
Nenue@40 391 info = db.DefaultType
Nenue@29 392 else
Nenue@30 393 --print('## sent list definition', typeID)
Nenue@30 394 info = self.Types[owner][typeID]
Nenue@29 395 end
Nenue@29 396
Nenue@40 397 local subType = 'continent'
Nenue@40 398 if (
Nenue@40 399 FlightMapFrame
Nenue@40 400 and FlightMapFrame:IsVisible()
Nenue@40 401 and FlightMapFrame:IsZoomedIn()
Nenue@40 402 ) or (
Nenue@40 403 not db.isContinentMap
Nenue@40 404 ) or (
Nenue@40 405 db.useContinentType == false
Nenue@40 406 ) then
Nenue@40 407 subType = 'zone'
Nenue@40 408 end
Nenue@29 409
Nenue@40 410 return info, info[subType] or db.DefaultType[subType]
Nenue@29 411 end
Nenue@29 412
Nenue@29 413 do
Nenue@29 414 local timeStates = {
Nenue@29 415 {maxSeconds = 60,
Nenue@29 416 r=1, g=0.25, b =0, format = function (minutes) return '|cFFFF4400'.. minutes .. 'm' end,
Nenue@29 417 },
Nenue@29 418 {maxSeconds = 240,
Nenue@29 419 r=1, g=.5, b=0, format = function(minutes) return '|cFFFF4400'.. floor(minutes/60) .. 'h' end,
Nenue@29 420 },
Nenue@29 421 {maxSeconds = 1440,
Nenue@29 422 r=1, g=1, b=0, format = function(minutes) return '|cFFFFFF00'.. floor(minutes/60) .. 'h' end,
Nenue@29 423 },
Nenue@29 424 {maxSeconds = 10081,
Nenue@29 425 r=0, g=1, b=0,
Nenue@29 426 }, -- 7 days + 1 minute
Nenue@29 427 }
Nenue@29 428 -- Generates a timeleft string
Nenue@36 429 function WorldPlanCore:GetTimeInfo(timeLeft, limit)
Nenue@29 430 for index = 1, limit do
Nenue@29 431 local state = timeStates[index]
Nenue@29 432 if timeLeft <= state.maxSeconds then
Nenue@29 433 local text
Nenue@29 434 if state.format then
Nenue@29 435 text = state.format(timeLeft)
Nenue@29 436 end
Nenue@29 437 return text, index
Nenue@29 438 end
Nenue@29 439 end
Nenue@29 440 return nil, nil
Nenue@29 441 end
Nenue@29 442 end
Nenue@29 443
Nenue@36 444 function WorldPlanCore:Refresh (forced)
Nenue@30 445 print('|cFFFFFF00'..self:GetName()..':Refresh()|r forced:', forced, 'init:', self.initialized)
Nenue@9 446 if not self.initialized then
Nenue@9 447 return
Nenue@9 448 end
Nenue@9 449
Nenue@40 450 for i, module in ipairs(db.OrderedModules) do
Nenue@0 451 if module.Refresh then
Nenue@33 452 print('|cFF00FF00external '..module:GetName()..':Refresh()|r')
Nenue@33 453 module:Refresh(forced)
Nenue@0 454 end
Nenue@0 455 end
Nenue@40 456
Nenue@40 457 self.isStale = nil
Nenue@0 458 end
Nenue@0 459
Nenue@0 460 -- insert visual options into the tracking button menu
Nenue@36 461 WorldPlanCore.OnDropDownInitialize = function (self, callback, dropType)
Nenue@0 462 if self ~= WorldMapFrameDropDown then
Nenue@0 463 return
Nenue@0 464 end
Nenue@40 465 local config = WorldPlanData
Nenue@0 466 local info = UIDropDownMenu_CreateInfo()
Nenue@0 467 info.text = ""
Nenue@0 468 info.isTitle = true
Nenue@0 469 UIDropDownMenu_AddButton(info)
Nenue@0 470 info.text = "|cFF00AAFFWorldPlan|r"
Nenue@0 471 info.isTitle = true
Nenue@0 472 UIDropDownMenu_AddButton(info)
Nenue@0 473 info.isTitle = nil
Nenue@0 474 info.disabled = nil
Nenue@0 475 info.keepShownOnClick = true
Nenue@0 476 info.tooltipOnButton = 1
Nenue@0 477
Nenue@9 478 info.text = "Enable"
Nenue@9 479 info.isNotRadio = true
Nenue@9 480 info.value = "EnablePins"
Nenue@40 481 info.checked = config.EnablePins
Nenue@9 482 info.tooltipTitle = "Enable World Quest Overlays"
Nenue@9 483 info.tooltipText = "Toggle the detail layers here."
Nenue@9 484 info.func = DropDown_OnClick
Nenue@9 485 UIDropDownMenu_AddButton(info)
Nenue@9 486
Nenue@9 487 info.text = "Display All Profession Quests"
Nenue@0 488 info.isNotRadio = true
Nenue@0 489 info.value = "ShowAllProfessionQuests"
Nenue@40 490 info.checked = config.ShowAllProfessionQuests
Nenue@0 491 info.tooltipTitle = "Hidden Quests"
Nenue@0 492 info.tooltipText = "Display work order and profession-related quests that are skipped by the default UI."
Nenue@0 493 info.func = DropDown_OnClick
Nenue@0 494 UIDropDownMenu_AddButton(info)
Nenue@0 495
Nenue@0 496 info.text = "Show Continent Pins"
Nenue@0 497 info.isNotRadio = true
Nenue@0 498 info.value = "DisplayContinentPins"
Nenue@40 499 info.checked = config.DisplayContinentPins
Nenue@0 500 info.tooltipTitle = "Continent Pins"
Nenue@0 501 info.tooltipText = "Display quest pins on the continent map (may get cramped)."
Nenue@0 502 info.func = DropDown_OnClick
Nenue@0 503 UIDropDownMenu_AddButton(info)
Nenue@0 504
Nenue@0 505 info.text = "Show Summary"
Nenue@0 506 info.isNotRadio = true
Nenue@0 507 info.value = "DisplayContinentSummary"
Nenue@0 508 info.tooltipTitle = "Summary Bar"
Nenue@0 509 info.tooltipText = "Display a summary of active world quests. Note: requires directly viewing Broken Isle and Dalaran maps to gain complete info."
Nenue@40 510 info.checked = config.DisplayContinentSummary
Nenue@9 511 info.func = DropDown_OnClick
Nenue@9 512 UIDropDownMenu_AddButton(info)
Nenue@9 513
Nenue@40 514
Nenue@40 515 info.text = "Nudge Pins"
Nenue@40 516 info.isNotRadio = true
Nenue@40 517 info.value = "NudgePins"
Nenue@40 518 info.tooltipTitle = "Pin Nudging"
Nenue@40 519 info.tooltipText = "Adjust the position of quest pins that overlap."
Nenue@40 520 info.checked = config.NudgePins
Nenue@40 521 info.func = DropDown_OnClick
Nenue@40 522 UIDropDownMenu_AddButton(info)
Nenue@40 523
Nenue@40 524 info.text = "Fade Whiled Grouped"
Nenue@9 525 info.isNotRadio = true
Nenue@9 526 info.value = "FadeWhileGrouped"
Nenue@9 527 info.tooltipTitle = "Group Fade"
Nenue@9 528 info.tooltipText = "Reduce pin alpha when grouped, so player dots are easier to see."
Nenue@40 529 info.checked = config.FadeWhileGrouped
Nenue@0 530 info.func = DropDown_OnClick
Nenue@0 531 UIDropDownMenu_AddButton(info)
Nenue@0 532 end
Nenue@0 533
Nenue@30 534 --------------------------------------------------------------------------------------------------------------------
Nenue@35 535 -------------------
Nenue@0 536
Nenue@0 537
Nenue@0 538
Nenue@0 539
Nenue@0 540
Nenue@0 541
Nenue@0 542
Nenue@35 543 --%end-debug%