-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathTutorials.lua
397 lines (387 loc) · 18.2 KB
/
Tutorials.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
-- [[ Namespaces ]] --
local _, addon = ...;
addon.Tutorials = LibStub("Krowi_Tutorials-3.0");
local tutorials = addon.Tutorials;
local media = "Interface\\AddOns\\Krowi_AchievementFilter\\Media\\";
local function ReplaceVarsWithMenu(str, vars)
if not vars then
vars = type(str) == "table" and str or {str};
str = vars[1];
end
vars["arrow"] = "|T" .. media .. "ui-backarrow:0|t";
vars["gameMenu"] = addon.L["Game Menu"];
vars["interface"] = addon.L["Interface"];
vars["addOns"] = addon.L["AddOns"];
vars["addonName"] = addon.Metadata.Title;
return addon.Util.Strings.ReplaceVars(str, vars);
end
string.ReplaceVarsWithMenu = ReplaceVarsWithMenu;
local function GetTextColorLower(text, lower, color)
if lower then
text = text:lower();
end
if color then
text = addon.Util.Colors.SetTextColor(text, color);
end
return text;
end
local function GetText1Or2(test, text1, lower1, color1, text2, lower2, color2)
if test then
return GetTextColorLower(text1, lower1, color1);
end
return GetTextColorLower(text2, lower2 or lower1, color2 or color1);
end
local pages = {};
function tutorials.Load()
local options = addon.Options.db.profile;
local colors = addon.Util.Colors;
local L = addon.L;
tinsert(pages, { -- TabButtons
Image = media .. "TabButton",
ImageSize = {930, 158},
SubTitle = L["New achievement window tabs"]:SetColorYellow(),
Text = L["New achievement window tabs Desc"]:ReplaceVarsWithMenu
{
achievements = L["Achievements"]:SetColorYellow(),
expansions = L["Expansions"]:SetColorYellow(),
expansionsTabTutorial = L["Expansions tab"]:SetColorYellow(),
events = L["Events"]:SetColorYellow(),
pvp = L["PvP"]:SetColorYellow(),
specials = L["Specials"]:SetColorYellow(),
addonName_y = addon.Metadata.Title:SetColorYellow(),
layout = L["Layout"],
tabs = L["Tabs"],
pluginText = ""
}
});
tinsert(pages, { -- ExpansionsTab
Layout = "HORIZONTAL",
Image = media .. "Categories",
ImageSize = {361, 512},
SubTitle = L["Expansions tab"]:SetColorYellow(),
Text = L["Expansions tab Desc"]:ReplaceVarsWithMenu
{
expansion = L["Expansion"],
zones = L["Zones"],
quests = (GetCategoryInfo(15447)),
exploration = (GetCategoryInfo(97)),
pvp = (GetCategoryInfo(15270)),
reputation = (GetCategoryInfo(15273)),
dungeons = (GetCategoryInfo(15272)),
raids = (GetCategoryInfo(15271)),
petBattles = (GetCategoryInfo(15117)),
expansionFeatures = (GetCategoryInfo(15301)),
currentZone = L["Current Zone"]:SetColorYellow(),
selectedZone = L["Selected Zone"]:SetColorYellow(),
watchListCategory = L["Watch List"]:SetColorYellow(),
excludedCategory = L["Excluded"]:SetColorYellow(),
layout = L["Layout"],
categories = L["Categories"]
}
});
tinsert(pages, { -- FilteringSorting
Layout = "HORIZONTAL",
Image = media .. "FilteringSorting",
ImageSize = {587, 720},
SubTitle = L["Enhanced filtering and sorting"]:SetColorYellow(),
Text = L["Enhanced filtering and sorting Desc"]:ReplaceVarsWithMenu
{
mergeSmallCategories = L["Merge Small Categories"]:SetColorYellow(),
completed = L["Completed"]:SetColorYellow(),
notCompleted = L["Not Completed"]:SetColorYellow(),
obtainable = L["Obtainable"]:SetColorYellow(),
notObtainable = L["Not Obtainable"]:SetColorYellow(),
faction = addon.L["Faction"],
resetFactionFilters = addon.L["Reset Faction Filters"],
neutral = L["Neutral"]:SetColorYellow(),
alliance = L["Alliance"]:SetColorYellow(),
alliance_wc = addon.L["Alliance"],
horde = L["Horde"]:SetColorYellow(),
horde_wc = addon.L["Horde"],
excluded = L["Excluded"]:SetColorYellow(),
collapseChain = L["Collapse Chain"]:SetColorYellow(),
noSorting = L["Default"]:SetColorYellow(),
sortByName = L["Name"]:SetColorYellow(),
sortByCompletion = L["Completion"]:SetColorYellow(),
sortByID = L["ID"]:SetColorYellow(),
reverseSort = L["Reverse Sort"]:SetColorYellow(),
tabs = addon.L["Tabs"],
specialCategories = addon.L["Special Categories"],
earnedBy = addon.L["Earned By"],
earnedByTutorial = L["Earned By"]:SetColorYellow(),
account = L["Account"]:SetColorYellow(),
character = (GetCategoryInfo(92)):SetColorYellow(),
help = L["Help"]:SetColorYellow(),
options = L["Options"]:SetColorYellow(),
discord = addon.L["Discord"],
curseForge = addon.L["CurseForge"],
layout = addon.L["Layout"],
categories = addon.L["Categories"]
},
OnShow = function(self)
self.Text = self.Text:K_ReplaceVars
{
mergeSmallCategoriesNumber = tostring(addon.Options.db.profile.Window.MergeSmallCategoriesThreshold):SetColorYellow(),
resetFactionFiltersEnabled = GetText1Or2(addon.Options.db.profile.Filters.ResetFactionFilters, L["Enabled"], true, colors.Green, L["Disabled"], nil, colors.Red)
};
end
});
tinsert(pages, { -- QuickSearch
Layout = "HORIZONTAL",
Image = media .. "QuickSearch",
ImageSize = {358, 324},
SubTitle = L["Quick Search"]:SetColorYellow(),
Text = L["Quick Search Desc"]:ReplaceVarsWithMenu
{
clearOnRightClick = L["Clear search field on Right Click"],
excludeExcludedAchievements = L["Exclude Excluded achievements"],
searchFilteredAchievements = L["Only search filtered achievements"],
minCharToSearch = L["Minimum characters to search"],
numSearchPreviews = L["Number of search previews"]
},
TextSize = {358, 0},
OnShow = function(self)
self.Text = self.Text:K_ReplaceVars
{
clearOnRightClickEnabled = GetText1Or2(options.SearchBox.ClearOnRightClick, L["Enabled"], true, colors.Green, L["Disabled"], nil, colors.Red),
excludeExcludedAchievementsEnabled = GetText1Or2(options.SearchBox.ExcludeExcluded, L["Exclude"], true, colors.Yellow, L["Include"]),
excludeExcludedAchievementsFrom = GetText1Or2(options.SearchBox.ExcludeExcluded, L["from"], true, nil, L["in"]),
searchFilteredAchievementsEnabled = GetText1Or2(options.SearchBox.OnlySearchFiltered, L["Enabled"], true, colors.Green, L["Disabled"], nil, colors.Red),
minCharToSearchNumber = tostring(addon.Options.db.profile.SearchBox.MinimumCharactersToSearch):SetColorYellow(),
numSearchPreviewsNumber = tostring(addon.Options.db.profile.SearchBox.NumberOfSearchPreviews):SetColorYellow()
};
end
});
tinsert(pages, { -- FullSearch
Image = media .. "FullSearch",
ImageSize = {826, 512},
SubTitle = L["Full Search"]:SetColorYellow(),
Text = L["Full Search Desc"]:K_ReplaceVars
{
showAllResults = L["Show All %d Results"]:gsub("%%d", "X"),
quickSearchTutorial = L["Quick Search"]:SetColorYellow()
}
});
tinsert(pages, { -- AchievementColors
Image = media .. "NewAchievementColors",
ImageSize = {722, 499},
SubTitle = L["New Achievement Colors"]:SetColorYellow(),
Text = L["New Achievement Colors Desc"]
});
tinsert(pages, { -- EarnedBy
Image = media .. "EarnedBy",
ImageSize = {1018, 473},
SubTitle = L["Earned By"]:SetColorYellow(),
Text = L["Earned By Desc"]:ReplaceVarsWithMenu
{
achievementPointsEarnedBy = L["Achievement points earned by"]:SetColorYellow(),
achievementPointsEarnedBy_wc = L["Achievement points earned by"],
tooltip = L["Tooltip"]:SetColorYellow(),
account = L["Account"]:SetColorYellow(),
character = (GetCategoryInfo(92)):SetColorYellow(),
earnedBy = L["Earned By"]:SetColorYellow(),
notEarnedBy = L["Not Earned By"]:SetColorYellow(),
layout = L["Layout"],
header = L["Header"],
achievements = L["Achievements"]
},
OnShow = function(self)
self.Text = self.Text:K_ReplaceVars
{
earnedByNumber = tostring(addon.Options.db.profile.Tooltip.Achievements.EarnedBy.Characters):SetColorYellow(),
notEarnedByNumber = tostring(addon.Options.db.profile.Tooltip.Achievements.EarnedBy.NotCharacters):SetColorYellow(),
achievementPointsEarnedByFormat = string.format(addon.Util.Colors.Yellow, LibStub("AceConfigRegistry-3.0"):GetOptionsTable(addon.Metadata.Prefix .. "_Layout", "cmd", "KROWIAF-0.0").args.Header.args.AchievementPoints.args.Format.values[addon.Options.db.profile.AchievementPoints.Format])
};
end
});
tinsert(pages, { -- CompactAchievements
Image = media .. "CompactAchievements",
ImageSize = {722, 385},
SubTitle = L["Compact Achievements"]:SetColorYellow(),
Text = L["Compact Achievements T Desc"]:ReplaceVarsWithMenu
{
layout = L["Layout"],
achievements = L["Achievements"]
},
OnShow = function(self)
self.Text = self.Text:K_ReplaceVars
{
compactEnabled = GetText1Or2(options.Achievements.Compact, L["Enabled"], true, colors.Green, L["Disabled"], nil, colors.Red)
};
end
});
tinsert(pages, { -- TooltipCategories
Image = media .. "TooltipCategories",
ImageSize = {554, 154},
SubTitle = (L["Enhanced tooltip"] .. " (" .. L["Categories"] .. ")"):SetColorYellow(),
Text = L["Enhanced tooltip Categories Desc"]:ReplaceVarsWithMenu
{
oc = L["OC"]:SetColorGreen(),
nonc = L["NONC"]:SetColorRed(),
green = L["Green"]:SetColorGreen(),
red = L["Red"]:SetColorRed(),
notObtainable = L["Not Obtainable"]:SetColorYellow(),
layout = L["Layout"],
categories = L["Categories"]
},
OnShow = function(self)
self.Text = self.Text:K_ReplaceVars
{
showNotObtainable = GetText1Or2(options.Tooltip.Categories.ShowNotObtainable, L["Enabled"], true, colors.Green, L["Disabled"], nil, colors.Red)
};
end
});
tinsert(pages, { -- TooltipAchievements
Image = media .. "TooltipAchievements",
ImageSize = {1016, 381},
SubTitle = (L["Enhanced tooltip"] .. " (" .. L["Achievements"] .. ")"):SetColorYellow(),
Text = L["Enhanced tooltip Achievements Desc"]:ReplaceVarsWithMenu
{
notObtainable = L["Not Obtainable"]:SetColorYellow(),
noLongerObtainable = L["This achievement is no longer obtainable"]:SetColorRed(),
earnedBy = L["Earned By"]:SetColorYellow(),
partOfAChain = L["Part of a chain"]:SetColorYellow(),
requiredFor = L["Required for"]:SetColorYellow(),
otherFaction = L["Other faction"]:SetColorYellow(),
objectivesProgress = L["Objectives progress"]:SetColorYellow(),
ready = "|T136814:0|t",
waiting = "|T136815:0|t",
notready = "|T136813:0|t",
green = L["Green"]:SetColorGreen(),
grey = L["Grey"]:SetColorGrey(),
red = L["Red"]:SetColorRed(),
lightGreen = L["Green"]:SetColorLightGreen(),
lightGrey = L["Grey"]:SetColorLightGrey(),
lightRed = L["Red"]:SetColorLightRed(),
discord = L["Discord"],
curseForge = L["CurseForge"],
layout = L["Layout"],
achievements = L["Achievements"]
},
OnShow = function(self)
self.Text = self.Text:K_ReplaceVars
{
partOfAChainEnabled = GetText1Or2(options.Tooltip.Achievements.ShowPartOfAChain, L["Enabled"], true, colors.Green, L["Disabled"], nil, colors.Red),
requiredForEnabled = GetText1Or2(options.Tooltip.Achievements.ShowRequiredFor, L["Enabled"], true, colors.Green, L["Disabled"], nil, colors.Red),
otherFactionEnabled = GetText1Or2(options.Tooltip.Achievements.ShowOtherFaction, L["Enabled"], true, colors.Green, L["Disabled"], nil, colors.Red),
objectivesProgressEnabled = GetText1Or2(options.Tooltip.Achievements.ObjectivesProgress.Show, L["Enabled"], true, colors.Green, L["Disabled"], nil, colors.Red),
currentCharacterIconEnabled = GetText1Or2(options.Tooltip.Achievements.ShowCurrentCharacterIcons, L["Enabled"], true, colors.Green, L["Disabled"], nil, colors.Red)
};
end
});
tinsert(pages, { -- WorldMapButton
Image = media .. "WorldMapButton",
ImageSize = {433, 392},
SubTitle = L["World Map Button"]:SetColorYellow(),
Text = L["World Map Button Desc"]:K_ReplaceVars
{
enhancedTooltipCategories = (L["Enhanced tooltip"] .. " (" .. L["Categories"] .. ")"):SetColorYellow(),
selectedZone = L["Selected Zone"]:SetColorYellow(),
enhancedFilteringAndSorting = L["Enhanced filtering and sorting"]:SetColorYellow()
}
});
tinsert(pages, { -- RightClickMenu
Image = media .. "RightClickMenu",
ImageSize = {772, 340},
SubTitle = L["Right Click Menu"]:SetColorYellow(),
Text = L["Right Click Menu Desc"]:ReplaceVarsWithMenu
{
rightClickMenu = L["Right Click Menu"],
wowhead = L["Wowhead"]:SetColorYellow(),
goTo = L["Go to"]:SetColorYellow(),
partOfAChain = L["Part of a chain"]:SetColorYellow(),
require = L["Required for"]:SetColorYellow(),
currentZone = L["Current Zone"],
xuFuPetGuides = L["Xu-Fu's Pet Guides"]:SetColorYellow(),
petBattles = (GetCategoryInfo(15117)),
more = L["More"]:SetColorYellow(),
addToWatch = L["Add to Watch List"]:K_ReplaceVars
{
watchList = addon.L["Watch List"]
}:SetColorYellow(),
removeFromWatch = L["Remove from Watch List"]:K_ReplaceVars
{
watchList = addon.L["Watch List"]
}:SetColorYellow(),
watchList = L["Watch List"]:SetColorYellow(),
include = L["Include"]:SetColorYellow(),
exclude = L["Exclude"]:SetColorYellow(),
layout = L["Layout"],
pluginText = ""
},
OnShow = function(self)
self.Text = self.Text:K_ReplaceVars
{
enabled = GetText1Or2(options.RightClickMenu.ShowButtonOnAchievement, L["Enabled"], true, colors.Green, L["Disabled"], nil, colors.Red)
};
end
});
tinsert(pages, { -- EventReminder
Layout = "HORIZONTAL",
Image = media .. "EventReminder",
ImageSize = {391, 486},
SubTitle = L["Event Reminder"]:SetColorYellow(),
Text = L["Event Reminder Desc"]:ReplaceVarsWithMenu
{
events = L["Events"],
calendarEvents = L["Calendar Events"],
widgetEvents = L["Widget Events"],
worldEvents = L["World Events"],
eventReminders = L["Event Reminders"]
},
TextSize = {391, 0},
OnShow = function(self)
self.Text = self.Text:K_ReplaceVars
{
popUpEnabled = GetText1Or2(options.EventReminders.ShowPopUps, L["Enabled"], true, colors.Green, L["Disabled"], nil, colors.Red),
numPopUps = tostring(addon.Options.db.profile.EventReminders.PopUps.MaxAlerts):SetColorYellow(),
compactEnabled = GetText1Or2(options.EventReminders.Compact, L["Enabled"], true, colors.Green, L["Disabled"], nil, colors.Red),
eventAlertFadeDelay = tostring(addon.Options.db.profile.EventReminders.PopUps.FadeDelay):SetColorYellow()
};
end
});
tinsert(pages, { -- Summary
Layout = "HORIZONTAL",
Image = media .. "Summary",
ImageSize = {732, 649},
SubTitle = L["Summary"]:SetColorYellow(),
Text = L["Summary Desc"]:ReplaceVarsWithMenu
{
achievementsHeader = LATEST_UNLOCKED_ACHIEVEMENTS,
categoriesHeader = ACHIEVEMENT_CATEGORY_PROGRESS,
categories = L["Categories"],
summary = L["Summary"]
},
TextSize = {366, 0},
OnShow = function(self)
self.Text = self.Text:K_ReplaceVars
{
numAchievements = tostring(addon.Options.db.profile.Summary.NumAchievements):SetColorYellow()
};
end
});
tinsert(pages, { -- Calendar
Image = media .. "Calendar",
ImageSize = {1041, 518},
SubTitle = L["Calendar"]:SetColorYellow(),
Text = L["Calendar Desc"]:ReplaceVarsWithMenu
{
calendar = L["Calendar"],
layout = L["Layout"]
},
OnShow = function(self)
self.Text = self.Text:K_ReplaceVars
{
lockMonth = GetText1Or2(addon.Options.db.profile.Calendar.LockMonth, L["Enabled"], true, colors.Green, L["Disabled"], nil, colors.Red),
lockAchievementMonth = GetText1Or2(addon.Options.db.profile.Calendar.LockAchievementMonth, L["Enabled"], true, colors.Green, L["Disabled"], nil, colors.Red),
firstWeekDay = string.format(addon.Util.Colors.Yellow, LibStub("AceConfigRegistry-3.0"):GetOptionsTable(addon.Metadata.Prefix .. "_Layout", "cmd", "KROWIAF-0.0").args.Calendar.args.Weekdays.args.FirstDayOfTheWeek.values[addon.Options.db.profile.Calendar.FirstWeekDay]),
};
end
});
tutorials.FeaturesTutorial = tutorials:New("FeaturesTutorial", KrowiAF_SavedData);
tutorials.FeaturesTutorial:SetFrameTitle(addon.Metadata.Title .. " - " .. addon.Metadata.BuildVersion);
tutorials.FeaturesTutorial:SetPages(pages);
tutorials.FeaturesTutorial:SetImageMargin(10);
tutorials.FeaturesTutorial:SetTextMargin({10, 0, 10, 20});
addon.Diagnostics.Debug("Tutorial loaded");
end