-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathWorldQuestTracker_Initialize.lua
517 lines (450 loc) · 16.5 KB
/
WorldQuestTracker_Initialize.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
do
WQT_VERSION = 414
ARROW_UPDATE_FREQUENCE = 0.2
--update quest type max when a new type of world quest is added to the filtering
WQT_QUESTTYPE_MAX = 11 --[[global]]
--all quest types current available
WQT_QUESTTYPE_GOLD = "gold" --[[global]]
WQT_QUESTTYPE_RESOURCE = "resource" --[[global]]
WQT_QUESTTYPE_APOWER = "apower" --[[global]]
WQT_QUESTTYPE_EQUIPMENT = "equipment" --[[global]]
WQT_QUESTTYPE_TRADE = "trade" --[[global]]
WQT_QUESTTYPE_DUNGEON = "dungeon" --[[global]]
WQT_QUESTTYPE_PROFESSION = "profession" --[[global]]
WQT_QUESTTYPE_PVP = "pvp" --[[global]]
WQT_QUESTTYPE_PETBATTLE = "petbattle" --[[global]]
WQT_QUESTTYPE_REPUTATION = "reputation" --[[global]]
WQT_QUESTTYPE_RACING = "racing" --[[global]]
WQT_QUERYTYPE_REWARD = "reward" --[[global]]
WQT_QUERYTYPE_QUEST = "quest" --[[global]]
WQT_QUERYTYPE_PERIOD = "period" --[[global]]
WQT_QUERYDB_ACCOUNT = "global" --[[global]]
WQT_QUERYDB_LOCAL = "character" --[[global]]
WQT_REWARD_RESOURCE = "resource" --[[global]]
WQT_REWARD_GOLD = "gold" --[[global]]
WQT_REWARD_APOWER = "artifact" --[[global]]
WQT_QUESTS_TOTAL = "total" --[[global]]
WQT_QUESTS_PERIOD = "quest" --[[global]]
WQT_DATE_TODAY = 1 --[[global]]
WQT_DATE_YESTERDAY = 2 --[[global]]
WQT_DATE_1WEEK = 3 --[[global]]
WQT_DATE_2WEEK = 4 --[[global]]
WQT_DATE_MONTH = 5 --[[global]]
--helps blend the icons within the map texture
WQT_ZONEWIDGET_ALPHA = 0.97
WQT_WORLDWIDGET_ALPHA = 0.975
WQT_WORLDWIDGET_BLENDED = ALPHA_BLEND_AMOUNT
WQT_ANIMATION_SPEED = 0.05
--where these came from
QUESTTYPE_GOLD = 0x1
QUESTTYPE_RESOURCE = 0x2
QUESTTYPE_ITEM = 0x4
QUESTTYPE_ARTIFACTPOWER = 0x8
QUESTTYPE_PET = 0x16
--todo: rename or put these into a table
FILTER_TYPE_PET_BATTLES = "pet_battles"
FILTER_TYPE_PVP = "pvp"
FILTER_TYPE_PROFESSION = "profession"
FILTER_TYPE_DUNGEON = "dungeon"
FILTER_TYPE_GOLD = "gold"
FILTER_TYPE_ARTIFACT_POWER = "artifact_power"
FILTER_TYPE_GARRISON_RESOURCE = "garrison_resource"
FILTER_TYPE_REPUTATION_TOKEN = "reputation_token"
FILTER_TYPE_EQUIPMENT = "equipment"
FILTER_TYPE_TRADESKILL = "trade_skill"
FILTER_TYPE_RACING = "racing"
--9.0.1 re-filling the French globals
local questTagType = _G.Enum.QuestTagType
LE_QUEST_TAG_TYPE_PET_BATTLE = questTagType.PetBattle
LE_QUEST_TAG_TYPE_PROFESSION = questTagType.Profession
LE_QUEST_TAG_TYPE_DUNGEON = questTagType.Dungeon
LE_QUEST_TAG_TYPE_RAID = questTagType.Raid
LE_QUEST_TAG_TYPE_INVASION = questTagType.Invasion
LE_QUEST_TAG_TYPE_FACTION_ASSAULT = questTagType.FactionAssault
LE_QUEST_TAG_TYPE_PVP = questTagType.PvP
local questQualityType = _G.Enum.WorldQuestQuality --former known as rarity
LE_WORLD_QUEST_QUALITY_COMMON = questQualityType.Common
LE_WORLD_QUEST_QUALITY_RARE = questQualityType.Rare
LE_WORLD_QUEST_QUALITY_EPIC = questQualityType.Epic
local default_config = {
profile = {
ignore_maps = {
[1978] = false, --dragon isles
},
filters = {
pet_battles = true,
pvp = true,
profession = true,
dungeon = true,
gold = true,
artifact_power = true,
garrison_resource = true,
equipment = true,
trade_skill = true,
reputation_token = true,
racing = true,
},
dragon_racing = {
minimap_enabled = true,
minimap_scale = 1,
minimap_track_color = {1, 1, 1},
},
close_blizz_popups = {
ABANDON_QUEST = true,
},
sort_order = {
[WQT_QUESTTYPE_REPUTATION] = 7,
[WQT_QUESTTYPE_TRADE] = 5,
[WQT_QUESTTYPE_APOWER] = 11,
[WQT_QUESTTYPE_GOLD] = 8,
[WQT_QUESTTYPE_RESOURCE] = 5,
[WQT_QUESTTYPE_EQUIPMENT] = 10,
[WQT_QUESTTYPE_DUNGEON] = 4,
[WQT_QUESTTYPE_PROFESSION] = 3,
[WQT_QUESTTYPE_PVP] = 2,
[WQT_QUESTTYPE_PETBATTLE] = 6,
[WQT_QUESTTYPE_RACING] = 9,
},
groupfinder = {
enabled = true,
invasion_points = false, --deprecated
tracker_buttons = false,
autoleave = false,
autoleave_delayed = false,
askleave_delayed = true,
noleave = false,
leavetimer = 30,
noafk = true, --deprecated
noafk_ticks = 5, --deprecated
noafk_distance = 500, --deprecated
nopvp = false, --deprecated
frame = {},
tutorial = 0,
argus_min_itemlevel = 830, --deprecated
ignored_quests = {},
send_whispers = false,
dont_open_in_group = true,
kfilter = { --anti spam on pre-made dungeons
enabled = true,
ignore_leaders_enabled = true,
leaders_ignored = {},
ignore_by_time = 30,
show_button = true,
dont_show_ignored_leaders = true,
wipe_counter = 0,
},
},
rarescan = {
show_icons = true,
alerts_anywhere = false,
join_channel = false,
search_group = true,
recently_spotted = {},
recently_killed = {},
name_cache = {},
playsound = false,
playsound_volume = 2,
playsound_warnings = 0,
use_master = true,
always_use_english = true,
add_from_premade = false,
autosearch = true,
autosearch_cooldown = 600,
autosearch_share = false,
},
raredetected = {},
world_map_config = {
onmap_show = true,
onmap_scale_offset = 1.0,
summary_show = true,
summary_scale = 0.95,
summary_showby = "bytype", --"bytype" or "byzone"
summary_anchor = "left",
summary_widgets_per_row = 8,
},
world_map_hubscale = {},
world_map_hubenabled = {},
speed_run = {
auto_accept = false,
auto_complete = false,
cancel_cinematic = false,
},
disable_world_map_widgets = false, --a
show_filter_button = true, --a
show_sort_button = false, --a
show_timeleft_button = true, --a
numerate_quests = true, --a
show_warband_rep_warning = true, --a
show_warband_rep_warning_color = "yellow",
show_warband_rep_warning_alpha = 0.834,
show_warband_rep_warning_desaturation = 0.5,
show_emissary_info = true,
worldmap_widgets = {
textsize = 9,
scale = 1,
quest_icons_scale_offset = 0,
},
accessibility = {--a
extra_tracking_indicator = false,--a
use_bounty_ring = false,--a
},--a
show_world_shortcuts = false,
last_news_time = 0,
world_summary_alpha = 0.934, --parei fazendo a substituição dos valores hardcoded to these values, parei na criação da opção de mudar o alpha, parei procurando as funções que atualiza of frames com o novo alpha
worldmap_widget_alpha = 0.933,
hoverover_animations = true, --hover and shown slider animations
anchor_options = {}, --store the anchor options of each anchor
filter_always_show_faction_objectives = true,
filter_force_show_brokenshore = true, --deprecated at this point, but won't be removed since further expantion might need this back
sort_time_priority = 0,
force_sort_by_timeleft = false,
alpha_time_priority = false,
show_timeleft = false,
quests_tracked = {},
quests_all_characters = {},
banned_quests = {},
syntheticMapIdList = {
[1015] = 1, --azsuna
[1018] = 2, --valsharah
[1024] = 3, --highmountain
[1017] = 4, --stormheim
[1033] = 5, --suramar
[1096] = 6, --eye of azshara
},
taxy_showquests = true,
taxy_trackedonly = false,
taxy_tracked_scale = 3,
arrow_update_frequence = 0.016,
map_lock = false,
sound_enabled = true,--a
use_tracker = true,
tracker_attach_to_questlog = true,
tracker_is_locked = false,
tracker_only_currentmap = false,
tracker_scale = 1,
tracker_show_time = false,
tracker_textsize = 12,
tracker_background_alpha = 0.15,
talking_heads_heard = {},--a
talking_heads_torgast = false,--a
talking_heads_dungeon = false,--a
talking_heads_raid = false,--a
talking_heads_openworld = false,--a
flymaster_tracker_frame_pos = {},--a
flymaster_tracker_enabled = true,--a
show_faction_frame = true,--a
map_frame_anchor = "left",--a
map_frame_scale_enabled = false,--a
map_frame_scale_mod = 1,--a
use_quest_summary = true,
quest_summary_minimized = false,
show_summary_minimize_button = true,
pins_discovered = {
["worldquest-Capstone-questmarker-epic-Locked"] = {},
},
zone_map_config = {
summary_show = true,
quest_summary_scale = 1.2,
show_widgets = true,
scale = 1,
},
is_BFA_version = false, --if is false, reset the tutorial
zone_only_tracked = false,
low_level_tutorial = false,
bar_anchor = "bottom",
bar_visible = true,--a
use_old_icons = false,--a
history = {
reward = {
global = {},
character = {},
},
quest = {
global = {},
character = {},
},
period = {
global = {},
character = {},
},
},
show_yards_distance = true,
player_names = {},
tomtom = {
enabled = false,
uids = {},
persistent = true,
},
path = {
enabled = true,
ColorSRGB = {1, 1, 1, 1},
DotSize = 5,
DotAmount = 20,
DotTexture = [[Interface\CHARACTERFRAME\TempPortraitAlphaMaskSmall]],
LineSize = 500,
},
},
}
--details! framework
local DF = _G ["DetailsFramework"]
if (not DF) then
print ("|cFFFFAA00World Quest Tracker: framework not found, if you just installed or updated the addon, please restart your client.|r")
return
end
--create the addon object
local WorldQuestTracker = DF:CreateAddOn("WorldQuestTrackerAddon", "WQTrackerDB", default_config)
WorldQuestTracker.__debug = false
WorldQuestTracker.MapChangedTime = time()-1
--create the group finder and rare finder frames
CreateFrame("frame", "WorldQuestTrackerFinderFrame", UIParent, "BackdropTemplate")
CreateFrame("frame", "WorldQuestTrackerRareFrame", UIParent, "BackdropTemplate")
--create world quest tracker pin
WorldQuestTrackerPinMixin = CreateFromMixins(MapCanvasPinMixin)
--data providers are stored inside .dataProviders folder
--catch the blizzard quest provider
function WorldQuestTrackerAddon.CatchMapProvider (fromMapOpened)
if (not WorldQuestTrackerAddon.DataProvider) then
if (WorldMapFrame and WorldMapFrame.dataProviders) then
for dataProvider, state in pairs (WorldMapFrame.dataProviders) do
if (dataProvider.IsQuestSuppressed) then
WorldQuestTrackerAddon.DataProvider = dataProvider
break
end
end
end
if (not WorldQuestTrackerAddon.DataProvider and fromMapOpened) then
WorldQuestTracker:Msg ("Failed to initialize or get Data Provider.")
end
end
end
WorldQuestTrackerAddon.CatchMapProvider()
--store zone widgets
WorldQuestTracker.ZoneWidgetPool = {}
WorldQuestTracker.VignettePool = {}
--default world quest pins
WorldQuestTracker.DefaultWorldQuestPin = {}
WorldQuestTracker.ShowDefaultWorldQuestPin = {}
--frame where things will be parented to
WorldQuestTracker.AnchoringFrame = WorldMapFrame.BorderFrame
--frame level for things attached to the world map
WorldQuestTracker.DefaultFrameLevel = 5000
--the client has all the data for the quest
WorldQuestTracker.HasQuestData = {}
--color pallete
WorldQuestTracker.ColorPalette = {
orange = {1, .8, .22},
yellow = {.8, .8, .22},
red = {.9, .22, .22},
green = {.22, .9, .22},
blue = {.22, .22, .9},
}
--store the available resources from each quest and map
WorldQuestTracker.ResourceData = {}
--comms
WorldQuestTracker.CommFunctions = {}
function WorldQuestTracker.HandleComm (validData)
local prefix = validData [1]
if (WorldQuestTracker.CommFunctions [prefix]) then
WorldQuestTracker.CommFunctions [prefix] (validData)
end
end
--register things we'll use
local color = OBJECTIVE_TRACKER_COLOR ["Header"]
DF:NewColor ("WQT_QUESTTITLE_INMAP", color.r, color.g, color.b, .8)
DF:NewColor ("WQT_QUESTTITLE_OUTMAP", 1, .8, .2, .7)
DF:NewColor ("WQT_QUESTZONE_INMAP", 1, 1, 1, 1)
DF:NewColor ("WQT_QUESTZONE_OUTMAP", 1, 1, 1, .7)
DF:NewColor ("WQT_ORANGE_ON_ENTER", 1, 0.847059, 0, 1)
DF:NewColor ("WQT_ORANGE_RESOURCES_AVAILABLE", 1, .7, .2, .85)
DF:NewColor ("WQT_ORANGE_YELLOW_RARE_TITTLE", 1, 0.677059, 0.05, 1)
DF:InstallTemplate ("font", "WQT_SUMMARY_TITLE", {color = "orange", size = 12, font = "Friz Quadrata TT"})
DF:InstallTemplate ("font", "WQT_RESOURCES_AVAILABLE", {color = {1, .7, .2, .85}, size = 10, font = "Friz Quadrata TT"})
DF:InstallTemplate ("font", "WQT_GROUPFINDER_BIG", {color = {1, .7, .2, .85}, size = 11, font = "Friz Quadrata TT"})
DF:InstallTemplate ("font", "WQT_GROUPFINDER_SMALL", {color = {1, .9, .1, .85}, size = 10, font = "Friz Quadrata TT"})
DF:InstallTemplate ("font", "WQT_GROUPFINDER_TRANSPARENT", {color = {1, 1, 1, .2}, size = 10, font = "Friz Quadrata TT"})
DF:InstallTemplate ("font", "WQT_TOGGLEQUEST_TEXT", {color = {0.811, 0.626, .109}, size = 10, font = "Friz Quadrata TT"})
DF:InstallTemplate ("button", "WQT_GROUPFINDER_BUTTON", {
backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true},
backdropcolor = {.2, .2, .2, 1},
backdropbordercolor = {0, 0, 0, 1},
width = 20,
height = 20,
enabled_backdropcolor = {.2, .2, .2, 1},
disabled_backdropcolor = {.2, .2, .2, 1},
onenterbordercolor = {0, 0, 0, 1},
})
DF:InstallTemplate ("button", "WQT_NEWS_BUTTON", {
backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true},
backdropcolor = {.2, .2, .2, .8},
backdropbordercolor = {0, 0, 0, .8},
width = 120,
height = 20,
onenterbordercolor = {0, 0, 0, 1},
onentercolor = {.4, .4, .4, 1},
}, "WQT_GROUPFINDER_BUTTON")
--settings
--WorldQuestTracker.Constants.
WorldQuestTrackerAddon.Constants = {
WorldMapSquareSize = 24,
TimeBlipSize = 14,
}
WorldQuestTracker.ChangeLogTable = {}
end
--old to new api of wow v11
--C_Reputation.GetFactionDataByID
if (not GetFactionInfoByID) then
WorldQuestTrackerAddon.GetFactionDataByID = function(id)
---@type factioninfo
local fD = C_Reputation.GetFactionDataByID(id) --sometimes he data isn't yet loaded, calling the function will make the client download the quest info.
if (not fD) then
return
end
return fD.name, fD.description, fD.currentStanding, 0, fD.nextReactionThreshold, fD.currentReactionThreshold, fD.atWarWith, fD.canToggleAtWar, fD.isHeader, fD.isCollapsed, fD.isHeaderWithRep, fD.isWatched, fD.isChild, fD.factionID, fD.hasBonusRepGain, false
--[=[]]
--hasBonusRepGain=false,
--description="Centaur clans roam the Ohn'ahran Plains, where they follow the call of the wind and seek the thrill of the hunt.",
--isHeaderWithRep=false,
--isHeader=false,
--currentReactionThreshold=3000,
canSetInactive=true,
--atWarWith=false,
--isWatched=false,
--isCollapsed=false,
--canToggleAtWar=false,
--nextReactionThreshold=9000,
--factionID=2503,
--name="Maruuk Centaur",
--currentStanding=3000,
isAccountWide=true,
--isChild=false,
reaction=5
--]=]
--local name, description, standingID, barMin, barMax, barValue, atWarWith, canToggleAtWar, isHeader, isCollapsed, hasRep, isWatched, isChild, factionID, hasBonusRepGain, canBeLFGBonus = GetFactionInfoByID (id)
--return name
end
else
WorldQuestTrackerAddon.GetFactionDataByID = GetFactionInfoByID
end
if (not GetNumQuestLogRewardCurrencies) then
WorldQuestTrackerAddon.GetNumQuestLogRewardCurrencies = function(questID)
---@type questrewardcurrencyinfo[]
local tQuestCurrencies = C_QuestLog.GetQuestRewardCurrencies(questID) or {}
return #tQuestCurrencies
end
else
WorldQuestTrackerAddon.GetNumQuestLogRewardCurrencies = GetNumQuestLogRewardCurrencies
end
if (not GetQuestLogRewardCurrencyInfo) then
WorldQuestTrackerAddon.GetQuestLogRewardCurrencyInfo = function(currencyIndex, questID)
---@type questrewardcurrencyinfo[]
local tQuestCurrencies = C_QuestLog.GetQuestRewardCurrencies(questID)
tQuestCurrencies = tQuestCurrencies or {}
local questRewardCurrencyInfo = tQuestCurrencies[currencyIndex]
if (questRewardCurrencyInfo) then
return questRewardCurrencyInfo.name, questRewardCurrencyInfo.texture, questRewardCurrencyInfo.totalRewardAmount, questRewardCurrencyInfo.currencyID, questRewardCurrencyInfo.bonusRewardAmount
end
end
else
WorldQuestTrackerAddon.GetQuestLogRewardCurrencyInfo = GetQuestLogRewardCurrencyInfo
end
--WorldQuestTrackerAddon.__debug = true