welp
[QuestHelper.git] / help.lua
blob91fc789a5f00c4b5f1fa10fe21320aa76c7b47ac
1 QuestHelper_File["help.lua"] = "Development Version"
2 QuestHelper_Loadtime["help.lua"] = GetTime()
4 function QuestHelper:scaleString(val)
5 return self:HighlightText(math.floor(val*100+0.5).."%")
6 end
8 function QuestHelper:genericSetScale(varname, name, mn, mx, input, onchange, ...)
9 if input == "" then
10 self:TextOut(string.format("Current %s scale is %s.", name, self:scaleString(QuestHelper_Pref[varname])))
11 else
12 local scale = tonumber(input)
14 if not scale then
15 local x = string.match(input or "", "^%s*([%d%.]+)%s*%%%s*$")
16 scale = tonumber(x) or 0
17 if not scale then
18 self:TextOut("I don't know how to interpret your input.")
19 return
20 end
21 scale = scale * 0.01
22 end
24 if scale < mn then
25 self:TextOut(string.format("I won't accept a scale less than %s.", self:scaleString(mn)))
26 elseif scale > mx then
27 self:TextOut(string.format("I won't accept a scale more than %s.", self:scaleString(mx)))
28 else
29 QuestHelper_Pref[varname] = scale
30 self:TextOut(string.format("Set %s scale set to %s.", name, self:scaleString(scale)))
31 if onchange then
32 onchange(...)
33 end
34 end
35 end
36 end
38 function QuestHelper:TrackerScale(scale)
39 QuestHelper:genericSetScale("track_scale", "tracker scale", .5, 2, scale,
40 function() QuestHelper.tracker:SetScale(QuestHelper_Pref.track_scale) end)
41 end
43 function QuestHelper:SetLocale(loc)
44 if not loc or loc == "" then
45 self:TextOut(QHText("LOCALE_LIST_BEGIN"))
46 for loc, tbl in pairs(QuestHelper_Translations) do
47 self:TextOut(string.format(" %s%s %s", self:HighlightText(loc),
48 loc == QuestHelper_Pref.locale and " *" or " ",
49 tbl.LOCALE_NAME or "???"))
50 end
51 else
52 for l, tbl in pairs(QuestHelper_Translations) do
53 if string.find(string.lower(l), "^"..string.lower(loc)) or
54 string.find(string.lower(tbl.LOCALE_NAME or ""), "^"..string.lower(loc)) then
55 QuestHelper_Pref.locale = l
56 QHFormatSetLocale(l)
57 self:SetLocaleFonts()
58 self:TextOut(QHFormat("LOCALE_CHANGED", l))
59 return
60 end
61 end
63 self:TextOut(QHFormat("LOCALE_UNKNOWN", tostring(loc) or "UNKNOWN"))
64 end
65 end
67 function QuestHelper:ToggleHide()
68 local current_objective = self.minimap_dodad.objective
70 QuestHelper_Pref.hide = not QuestHelper_Pref.hide
72 -- Desaturate the button texture if QuestHelper is disabled.
73 if self.MapButton then
74 -- This should always be true, but just in case...
75 self.MapButton:GetNormalTexture():SetDesaturated(QuestHelper_Pref.hide)
76 end
78 if QuestHelper_Pref.hide then
79 if QuestHelper_Pref.track then
80 self:HideTracker()
81 end
83 self.map_overlay:Hide()
84 self.minimap_dodad:SetObjective(nil)
85 self.minimap_dodad.objective = current_objective
86 self:TextOut("QuestHelper is now |cffff0000hidden|r.")
87 else
88 if QuestHelper_Pref.track then
89 self:ShowTracker()
90 end
92 self.map_overlay:Show()
93 self.minimap_dodad.objective = nil
94 self.minimap_dodad:SetObjective(current_objective)
95 self:TextOut("QuestHelper is now |cff00ff00shown|r.")
96 -- WoW Will lockup inside ForceRouteUpdate, and so the UPDATING_ROUTE message won't appear until afterwards, making
97 -- this message kind of redundant.
98 -- self:TextOut(QHText("UPDATING_ROUTE"))
99 QH_Timeslice_Bonus(20) -- Let the corutine do some overtime...
103 function QuestHelper:ToggleShare()
104 QuestHelper_Pref.share = not QuestHelper_Pref.share
105 if QuestHelper_Pref.share then
106 if QuestHelper_Pref.solo then
107 self:TextOut("Objective sharing will been |cff00ff00enabled|r when you disable solo mode.")
108 else
109 self:TextOut("Objective sharing has been |cff00ff00enabled|r.")
110 self:EnableSharing()
112 else
113 self:TextOut("Objective sharing has been |cffff0000disabled|r.")
114 if QuestHelper_Pref.solo then
115 self:TextOut("Objective sharing won't be reenabled when you disable solo mode.")
116 else
117 self:DisableSharing()
122 function QuestHelper:ToggleFlightTimes()
123 QuestHelper_Pref.flight_time = not QuestHelper_Pref.flight_time
124 if QuestHelper_Pref.flight_time then
125 self:TextOut("The flight timer has been |cff00ff00enabled|r.")
126 else
127 self:TextOut("The flight timer has been |cffff0000disabled|r.")
131 function QuestHelper:ToggleTrack()
132 QuestHelper_Pref.track = not QuestHelper_Pref.track
133 if QuestHelper_Pref.track then
134 self:ShowTracker()
135 self:TextOut("The quest tracker has been |cff00ff00enabled|r.")
136 else
137 self:HideTracker()
138 self:TextOut("The quest tracker has been |cffff0000disabled|r.")
142 function QuestHelper:ToggleTrackLevel()
143 QuestHelper_Pref.track_level = not QuestHelper_Pref.track_level
144 if QuestHelper_Pref.track_level then
145 self:TextOut("Display of levels in the quest tracker has been |cff00ff00enabled|r.")
146 else
147 self:TextOut("Display of levels in the quest tracker has been |cffff0000disabled|r.")
149 self.tracker:reset()
152 function QuestHelper:ToggleTrackQColour()
153 QuestHelper_Pref.track_qcolour = not QuestHelper_Pref.track_qcolour
154 if QuestHelper_Pref.track_qcolour then
155 self:TextOut("Colour for quest difficulty in quest tracker has been |cff00ff00enabled|r.")
156 else
157 self:TextOut("Colour for quest difficulty in quest tracker has been |cffff0000disabled|r.")
159 self.tracker:reset()
162 function QuestHelper:ToggleTrackOColour()
163 QuestHelper_Pref.track_ocolour = not QuestHelper_Pref.track_ocolour
164 if QuestHelper_Pref.track_ocolour then
165 self:TextOut("Colour for objective progress in quest tracker has been |cff00ff00enabled|r.")
166 else
167 self:TextOut("Colour for objective progress in quest tracker has been |cffff0000disabled|r.")
169 self.tracker:reset()
172 function QuestHelper:ToggleTooltip()
173 QuestHelper_Pref.tooltip = not QuestHelper_Pref.tooltip
174 if QuestHelper_Pref.tooltip then
175 self:TextOut("Objective tooltip information has been |cff00ff00enabled|r.")
176 else
177 self:TextOut("Objective tooltip information has been |cffff0000disabled|r.")
181 function QuestHelper:Purgewarning()
182 QuestHelper:TextOut("I would consider this a tragic loss, and would appreciate it if you sent me your saved data before going through with it.")
183 QuestHelper:TextOut("Enter "..self:HighlightText("/qh nag verbose").." to check and see if you're destroying anything important.")
184 QuestHelper:TextOut("Enter "..self:HighlightText("/qh submit").." for instructions on how to submit your collected data.")
185 QuestHelper:TextOut("See the "..self:HighlightText("How You Can Help").." section on the project website for instructions.")
188 function QuestHelper:Purge(code, force, noreload)
189 if code == self.purge_code or force then
190 QuestHelper_Quests = nil
191 QuestHelper_Objectives = nil
192 QuestHelper_FlightInstructors = nil
193 QuestHelper_FlightRoutes = nil
194 QuestHelper_Locale = nil
195 QuestHelper_UID = nil
196 QuestHelper_Version = nil
197 QuestHelper_SaveVersion = nil
199 QuestHelper_SaveDate = nil
200 QuestHelper_SeenRealms = nil
202 QuestHelper_Collector = nil
203 QuestHelper_Collector_Version = nil
205 if not noreload then ReloadUI() end
206 else
207 if not self.purge_code then self.purge_code = self:CreateUID(8) end
208 QuestHelper:TextOut("THIS COMMAND WILL DELETE ALL YOUR COLLECTED DATA")
209 QuestHelper:Purgewarning()
210 QuestHelper:TextOut("If you're sure you want to go through with this, enter: "..self:HighlightText("/qh purge "..self.purge_code))
214 function QuestHelper:HardReset(code)
215 if code == self.purge_code then
216 self:ResetTrackerPosition() -- do this before we kill off the prefs, since it touches a pref
217 QuestHelper_Pref = nil
218 QuestHelper_ErrorList = nil -- BIZAM
219 QuestHelper_KnownFlightRoutes = nil
220 QuestHelper_Home = nil
221 QuestHelper_CharVersion = nil
222 self:Purge(nil, true)
223 else
224 if not self.purge_code then self.purge_code = self:CreateUID(8) end
225 QuestHelper:TextOut("THIS COMMAND WILL DELETE ALL YOUR COLLECTED DATA AND RESET ALL YOUR PREFERENCES")
226 QuestHelper:Purgewarning()
227 QuestHelper:TextOut("If you're sure you want to go through with this, enter: "..self:HighlightText("/qh hardreset "..self.purge_code))
231 function QuestHelper:ToggleSolo()
232 QuestHelper_Pref.solo = not QuestHelper_Pref.solo
233 if QuestHelper_Pref.solo then
234 if QuestHelper_Pref.share then
235 self:DisableSharing()
236 self:TextOut("Objective sharing has been temporarly |cffff0000disabled|r.")
238 self:TextOut("Solo mode has been |cff00ff00enabled|r.")
239 else
240 self:TextOut("Solo mode has been |cffff0000disabled|r.")
241 if QuestHelper_Pref.share then
242 self:EnableSharing()
243 self:TextOut("Objective sharing has been re|cff00ff00enabled|r.")
248 function QuestHelper:ToggleComm()
249 if QuestHelper_Pref.comm then
250 QuestHelper_Pref.comm = false
251 self:TextOut("Communication display has been |cffff0000disabled|r.")
252 else
253 QuestHelper_Pref.comm = true
254 self:TextOut("Communication display has been |cff00ff00enabled|r.")
258 function QuestHelper:ToggleAnts()
259 if QuestHelper_Pref.show_ants then
260 QuestHelper_Pref.show_ants = false
261 self:TextOut("Ant trails have been |cffff0000disabled|r.")
262 else
263 QuestHelper_Pref.show_ants = true
264 self:TextOut("Ant trails have been |cff00ff00enabled|r.")
268 function QuestHelper:LevelOffset(offset)
269 local level = tonumber(offset)
270 if level then
271 if level > 0 then
272 self:TextOut("Allowing quests up to "..self:HighlightText(level).." level"..(level==1 and " " or "s ")..self:HighlightText("above").." you.")
273 elseif level < 0 then
274 self:TextOut("Only allowing quests "..self:HighlightText(-level).." level"..(level==-1 and " " or "s ")..self:HighlightText("below").." you.")
275 else
276 self:TextOut("Only allowing quests "..self:HighlightText("at or below").." your current level.")
279 if not QuestHelper_Pref.filter_level then
280 self:TextOut("Note: This won't have any effect until you turn the level filter on.")
283 if QuestHelper_Pref.level ~= level then
284 QuestHelper_Pref.level = level
285 self.defered_quest_scan = true
287 elseif offset == "" then
288 if QuestHelper_Pref.level <= 0 then
289 self:TextOut("Level offset is currently set to "..self:HighlightText(QuestHelper_Pref.level)..".")
290 else
291 self:TextOut("Level offset is currently set to "..self:HighlightText("+"..QuestHelper_Pref.level)..".")
294 if self.party_levels then for n, l in ipairs(self.party_levels) do
295 self:TextOut("Your effective level in a "..self:HighlightText(n).." player quest is "..self:HighlightText(string.format("%.1f", l))..".")
296 end end
298 if QuestHelper_Pref.solo then
299 self:TextOut("Peers aren't considered in your effective level, because you're playing solo.")
301 else
302 self:TextOut("Expected a level offset.")
306 function QuestHelper:Filter(input)
307 input = string.upper(input)
308 if input == "ZONE" then
309 QuestHelper_Pref.filter_zone = not QuestHelper_Pref.filter_zone
310 self:TextOut("Filter "..self:HighlightText("zone").." set to "..self:HighlightText(QuestHelper_Pref.filter_zone and "active" or "inactive")..".")
311 elseif input == "DONE" then
312 QuestHelper_Pref.filter_done = not QuestHelper_Pref.filter_done
313 self:TextOut("Filter "..self:HighlightText("done").." set to "..self:HighlightText(QuestHelper_Pref.filter_done and "active" or "inactive")..".")
314 elseif input == "LEVEL" then
315 QuestHelper_Pref.filter_level = not QuestHelper_Pref.filter_level
316 self:TextOut("Filter "..self:HighlightText("level").." set to "..self:HighlightText(QuestHelper_Pref.filter_level and "active" or "inactive")..".")
317 elseif input == "BLOCKED" or input == "BLOCK" then
318 QuestHelper_Pref.filter_blocked = not QuestHelper_Pref.filter_blocked
319 self:TextOut("Filter "..self:HighlightText("blocked").." set to "..self:HighlightText(QuestHelper_Pref.filter_blocked and "active" or "inactive")..".")
320 elseif input == "WATCHED" or input == "WATCH" then
321 QuestHelper_Pref.filter_watched = not QuestHelper_Pref.filter_watched
322 self:TextOut("Filter "..self:HighlightText("watched").." set to "..self:HighlightText(QuestHelper_Pref.filter_watched and "active" or "inactive")..".")
323 elseif input == "" then
324 self:TextOut("Filter "..self:HighlightText("zone")..": "..self:HighlightText(QuestHelper_Pref.filter_zone and "active" or "inactive"))
325 self:TextOut("Filter "..self:HighlightText("level")..": "..self:HighlightText(QuestHelper_Pref.filter_level and "active" or "inactive"))
326 self:TextOut("Filter "..self:HighlightText("done")..": "..self:HighlightText(QuestHelper_Pref.filter_done and "active" or "inactive"))
327 self:TextOut("Filter "..self:HighlightText("blocked")..": "..self:HighlightText(QuestHelper_Pref.filter_blocked and "active" or "inactive"))
328 self:TextOut("Filter "..self:HighlightText("watched")..": "..self:HighlightText(QuestHelper_Pref.filter_watched and "active" or "inactive"))
329 else
330 self:TextOut("Don't know what you want filtered, expect "..self:HighlightText("zone")..", "..self:HighlightText("done")..", "..self:HighlightText("level")..", or "..self:HighlightText("blocked")..".")
334 function QuestHelper:ToggleCartWP()
335 QuestHelper_Pref.cart_wp = not QuestHelper_Pref.cart_wp
336 if QuestHelper_Pref.cart_wp then
337 self:EnableCartographer()
338 if Cartographer_Waypoints then
339 if Waypoint and Waypoint.prototype then
340 self:TextOut("Would use "..self:HightlightText("Cartographer Waypoints").." to show objectives, but another mod is interfering with it.")
341 else
342 self:TextOut("Will use "..self:HighlightText("Cartographer Waypoints").." to show objectives.")
344 else
345 self:TextOut("Would use "..self:HighlightText("Cartographer Waypoints").." to show objectives, except it doesn't seem to be present.")
347 else
348 self:DisableCartographer()
349 self:TextOut("Won't use "..self:HighlightText("Cartographer Waypoints").." to show objectives.")
353 function QuestHelper:ToggleTomTomWP()
354 QuestHelper_Pref.tomtom_wp = not QuestHelper_Pref.tomtom_wp
355 if QuestHelper_Pref.tomtom_wp then
356 self:EnableTomTom()
357 if TomTom then
358 self:TextOut("Will use "..self:HighlightText("TomTom").." to show objectives.")
359 else
360 self:TextOut("Would use "..self:HighlightText("TomTom").." to show objectives, except it doesn't seem to be present.")
362 else
363 self:DisableTomTom()
364 self:TextOut("Won't use "..self:HighlightText("TomTom").." to show objectives.")
368 function QuestHelper:WantPathingReset()
369 self:TextOut("Will reset world graph.")
370 self.defered_graph_reset = true
373 function QuestHelper:PrintVersion()
374 self:TextOut("Version: "..self:HighlightText(GetAddOnMetadata("QuestHelper", "Version") or "Unknown"))
377 local function RecycleStatusString(fmt, usedcount, freetable, usedtable)
378 local freetablecount = QuestHelper:TableSize(freetable)
379 if usedtable then
380 local usedtablecount = QuestHelper:TableSize(usedtable)
381 return string.format(fmt, QuestHelper:ProgressString(string.format("%d/%d", usedtablecount, usedtablecount+freetablecount), ((usedtablecount+freetablecount == 0) and 1) or (1-usedtablecount/(usedtablecount+freetablecount)))) .. string.format(" (%d \"leaked\")", usedcount - usedtablecount)
382 else
383 return string.format(fmt, QuestHelper:ProgressString(string.format("%d/%d", usedcount, usedcount+freetablecount), ((usedcount+freetablecount == 0) and 1) or (1-usedcount/(usedcount+freetablecount))))
387 function QuestHelper:Top(cmd)
389 if cmd and string.find(cmd, "boot") then
390 local bootv = {}
391 for k, v in pairs(QuestHelper_Loadtime) do
392 table.insert(bootv, {time = v, file = k})
394 table.sort(bootv, function (a, b) return a.time < b.time end)
396 if string.find(cmd, "sort") then
397 local boott = {}
398 for i = 1, #bootv - 1 do
399 table.insert(boott, {time = bootv[i + 1].time - bootv[i].time, file = bootv[i].file})
401 table.sort(boott, function(a, b) return a.time < b.time end)
403 for _, v in pairs(boott) do
404 QuestHelper:TextOut(string.format("%s: %f", v.file, v.time))
406 QuestHelper:TextOut(string.format("%s: shrug", bootv[#bootv].file))
407 else
408 for i = 1, #bootv do
409 QuestHelper:TextOut(string.format("%f: %s", bootv[i].time - bootv[1].time, bootv[i].file))
414 if cmd and string.find(cmd, "recycle") then
415 self:DumpTableTypeFrequencies()
416 self:TextOut(RecycleStatusString("Using %s lua tables.", self.used_tables, self.free_tables, self.recycle_tabletyping))
417 self:TextOut(RecycleStatusString("Using %s texture objects.", self.used_textures, self.free_textures))
418 self:TextOut(RecycleStatusString("Using %s font objects.", self.used_text, self.free_text))
419 self:TextOut(RecycleStatusString("Using %s frame objects.", self.used_frames, self.free_frames))
422 if cmd and string.find(cmd, "usage") then
423 self:DumpTableTypeFrequencies()
426 if cmd and string.find(cmd, "cache") then
427 self:DumpCacheData()
430 if cmd and string.find(cmd, "perf") then
431 QH_Timeslice_DumpPerf()
434 UpdateAddOnMemoryUsage()
436 local uncd = 0
437 for k, v in pairs(QuestHelper_Collector) do
438 if not v.compressed then uncd = uncd + 1 end
440 uncd = uncd - 1
441 local uncs = ""
442 if uncd > 0 then
443 uncs = string.format(" (%d uncompressed IDs)", uncd)
446 self:TextOut(string.format("QuestHelper is using %dkb of RAM (%s/%s/%s/%s)%s", GetAddOnMemoryUsage("QuestHelper"), QuestHelper_local_version, QuestHelper_toc_version, GetBuildInfo(), GetLocale(), uncs))
449 function QuestHelper:ToggleMapButton()
450 QuestHelper_Pref.map_button = not QuestHelper_Pref.map_button
452 if QuestHelper_Pref.map_button then
453 QuestHelper:InitMapButton()
454 self:TextOut("Map button has been |cff00ff00enabled|r.")
455 else
456 QuestHelper:HideMapButton()
457 self:TextOut("Map button has been |cffff0000disabled|r. Use '/qh button' to restore it.")
461 function QuestHelper:ChangeLog()
462 self:ShowText(QuestHelper_ChangeLog, string.format("QuestHelper %s ChangeLog", QuestHelper_Version))
465 function QuestHelper:Submit()
466 self:ShowText([[
467 |TInterface\AddOns\QuestHelper\Art\Upload.tga:100:300|t
468 Your data can't be submitted automatically, since AddOns can't interact with anything outside of World of Warcraft.
470 To do this would require me to create some third party software, and I don't want to include such software with QuestHelper, because that's the kind of thing that ill intended people are likely to tamper with.
472 World of Warcraft stores QuestHelper's data in a file named |cff40bbffQuestHelper.lua|r.
474 To find this file, first find the the directory you installed World of Warcraft to. In Windows, this defaults to |cff40bbffC:\Program Files\World of Warcraft|r, and on Mac, I believe this is |cff40bbff/Applications/World of Warcraft|r.
476 If you're using Windows Vista, Windows might protect the Program Files directory from changes, and redirect Warcraft's saved data to |cff40bbffC:\Users\|cffff8000USER|cff40bbff\AppData\Local\VirtualStore\Program Files\World of Warcraft|r, or possibly |cff40bbffC:\Users\Public\Games\World of Warcraft|r.
478 In that directory, the needed file is in |cff40bbffWTF/Account/|cffff8000ACCOUNT|cff40bbff/SavedVariables|r, replacing ACCOUNT with the name of your account, and in that directory, you should find |cff40bbffQuestHelper.lua|r.
480 There are other directories with the names of the realms where your characters are stored, |cffffff00but don't enter them|r. They contain information specific to your characters, such as the flight points they know about, and don't contain the quest information I want.
482 After you find |cff40bbffQuestHelper.lua|r, you can email it to me here: |cff40bbffqhaddon@gmail.com|r
483 ]], "How To Submit Your Data")
486 function QuestHelper:ShowError()
487 QuestHelper_ErrorCatcher_ReportError()
490 local commands
492 function QuestHelper:Help(argument)
493 local text = ""
494 local argument = argument and argument:upper() or ""
496 for i1, cat in ipairs(commands) do
497 text = string.format("%s|cffffff00%s|r\n\n", text, cat[1])
498 for i, data in ipairs(cat[2]) do
499 if data[1]:find(argument, 1, true) then
500 text = string.format("%s |cffff8000%s|r %s\n", text, data[1], data[2])
502 if #data[3] > 0 then
503 text = string.format("%s\n %s\n", text, #data[3] == 1 and "Example:" or "Examples:")
504 for i, pair in ipairs(data[3]) do
505 text = string.format("%s |cff40bbff%s|r\n %s\n", text, pair[1], pair[2])
509 text = text .. "\n"
512 text = text .. "\n\n"
515 self:ShowText(text == "" and ("No commands containing '"..argument.."'") or text, "QuestHelper Slash Commands")
518 function QuestHelper:Donate(argument)
519 local text = ""
520 local argument = argument and argument:upper() or ""
522 for i1, cat in ipairs(commands) do
523 text = string.format("%s|cffffff00%s|r\n\n", text, cat[1])
524 for i, data in ipairs(cat[2]) do
525 if data[1]:find(argument, 1, true) then
526 text = string.format("%s |cffff8000%s|r %s\n", text, data[1], data[2])
528 if #data[3] > 0 then
529 text = string.format("%s\n %s\n", text, #data[3] == 1 and "Example:" or "Examples:")
530 for i, pair in ipairs(data[3]) do
531 text = string.format("%s |cff40bbff%s|r\n %s\n", text, pair[1], pair[2])
535 text = text .. "\n"
538 text = text .. "\n\n"
541 self:ShowText([[
542 QuestHelper currently survives on |cffff8000your donations|r. I'm trying to make this into a full-time job so I can add more features and fix bugs, and I can't do that without paying the bills.
544 There's a lot of stuff I plan to add if I can get enough donations to live off. Some of the most-requested features include:
546 |cff40bbffReduced memory and CPU usage for smoother gameplay|r
548 |cff40bbffFlying mount support for both Northrend and Outland|r
550 |cff40bbffBetter support for Northrend "phased" quests|r
552 |cff40bbffAchievementHelper, built right into QuestHelper|r
554 |cff40bbffPaths that lead you around obstacles instead of through them|r
556 I can't guarantee these will show up soon, as there's a lot of work involved in them, but every donation - no matter how small - helps!
558 To donate, open up your web browser and go to |cffff8000http://www.quest-helper.com/donate|r. Enter however much you feel comfortable donating, then bask in the knowledge that you're supporting QuestHelper.
560 Thanks!]], "Please Donate!", 500, 20, 10)
563 commands =
565 { "Common commands", {
566 {"HIDDEN",
567 "Compiles a list of objectives that QuestHelper is hiding from you. Depending on the reason, you can also unhide the objective.",
568 {}, QuestHelper.ShowHidden, QuestHelper},
570 {"HIDE",
571 "Hides QuestHelper's modifications to the minimap and world map, and pauses routing calculations.",
572 {}, QuestHelper.ToggleHide, QuestHelper},
574 {"CARTWP",
575 "Toggles displaying the current objective using Cartographer Waypoints (must be installed separately).",
576 {}, QuestHelper.ToggleCartWP, QuestHelper},
578 {"TOMTOM",
579 "Toggles displaying the current objective using TomTom (must be installed separately).",
580 {}, QuestHelper.ToggleTomTomWP, QuestHelper},
582 {"FIND",
583 "Search for an item, location, or npc.",
584 {{"/qh find item rune of teleport", "Finds a reagent vendor."},
585 {"/qh find npc bragok", "Finds the Ratchet flight point."},
586 {"/qh find loc stormwind 50 60", "Finds the Stormwind auction house."},
587 {"/qh find loc 50 50", "Finds the center of the zone you're in."},
588 {"/qh find something", "Searches for something in all categories."},
589 {"/qh find", "Lists objectives you manually created so that you can remove them."}}, QuestHelper.PerformSearch, QuestHelper},
591 {"SOLO",
592 "Toggles solo mode. When enabled, assumes your party members don't exist. Objective sharing with party members will also be disabled.",
593 {}, QuestHelper.ToggleSolo, QuestHelper},
596 { "Objective filtering", {
597 {"FILTER",
598 "Automatically ignores/unignores objectives based on criteria.",
599 {{"/qh filter zone", "Toggle showing objectives outside the current zone"},
600 {"/qh filter done", "Toggle showing objectives for uncompleted quests."},
601 {"/qh filter level", "Toggle showing objectives that are probably too hard, by considering the levels of you and your party members, and the offset set by the level command."},
602 {"/qh filter blocked", "Toggle showing blocked objectives, such as quest turn-ins for incomplete quests."},
603 {"/qh filter watched", "Toggle limiting to objectives watched in the Quest Log"}
604 }, QuestHelper.Filter, QuestHelper},
606 {"LEVEL",
607 "Adjusts the level offset used by the level filter. Naturally, the level filter must be turned on to have an effect.",
608 {{"/qh level", "See information related to the level filter."},
609 {"/qh level 0", "Only allow objectives at or below your current level."},
610 {"/qh level +2", "Allow objectives up to two levels above your current level."},
611 {"/qh level -1", "Only allow objectives below your current level."}}, QuestHelper.LevelOffset, QuestHelper},
613 {"SCALE",
614 "Scales the map icons used by QuestHelper. Will accept values between 50% and 300%.",
615 {{"/qh scale 1", "Uses the default icon size."},
616 {"/qh scale 2", "Makes icons twice their default size."},
617 {"/qh scale 80%", "Makes icons slightly smaller than their default size."}},
618 QuestHelper.genericSetScale, QuestHelper, "scale", "icon scale", .5, 3},
620 {"SHARE",
621 "Toggles objective sharing between QuestHelper users.",
622 {}, QuestHelper.ToggleShare, QuestHelper},
625 { "Interface", {
626 {"TRACK",
627 "Toggles the visibility of the QuestHelper's replacement quest tracker.",
628 {}, QuestHelper.ToggleTrack, QuestHelper},
630 {"TSCALE",
631 "Scales the quest tracker provided by QuestHelper. Will accept values between 50% and 300%.",
633 QuestHelper.TrackerScale, QuestHelper},
635 {"TLEVEL",
636 "Toggles display of levels in the quest tracker provided by QuestHelper.",
637 {}, QuestHelper.ToggleTrackLevel, QuestHelper},
639 {"TQCOL",
640 "Toggles display of colours for the difficulty level of quests in the quest tracker provided by QuestHelper.",
641 {}, QuestHelper.ToggleTrackQColour, QuestHelper},
643 {"TOCOL",
644 "Toggles display of colours for objective progress in the quest tracker provided by QuestHelper.",
645 {}, QuestHelper.ToggleTrackOColour, QuestHelper},
647 {"TRESET",
648 "Reset's the position of the quest tracker provided by QuestHelper, in cause you move it somewhere inaccessable.",
649 {{"/qh treset center", "Resets to the center of the screen, instead of a more normal quest tracker location."}}, QuestHelper.ResetTrackerPosition, QuestHelper},
651 {"TOOLTIP",
652 "Toggles appending information about tracked items and NPCs to their tooltips.",
653 {}, QuestHelper.ToggleTooltip, QuestHelper},
655 {"FTIME",
656 "Toggles display of flight time estimates.", {}, QuestHelper.ToggleFlightTimes, QuestHelper},
658 {"ANTS",
659 "Toggles the display of trails on the world map on and off.",
660 {}, QuestHelper.ToggleAnts, QuestHelper},
662 {"LOCALE",
663 "Select the locale to use for displayed messages.",
664 {}, QuestHelper.SetLocale, QuestHelper},
666 {"BUTTON",
667 "Toggles the display of QuestHelper's button on the world map.",
668 {}, QuestHelper.ToggleMapButton, QuestHelper},
670 {"SETTINGS",
671 "Opens the Settings menu at the current cursor location. Note that not all settings can be changed through the menu.",
672 {}, QuestHelper.DoSettingsMenu, QuestHelper},
675 { "Data collection", {
676 {"SUBMIT",
677 "Displays instructions for submitting your collected data.",
678 {}, QuestHelper.Submit, QuestHelper},
680 {"NAG",
681 "Tells you if you have anything that's missing from the static database. It can only check quests from your own faction, as the quests of your opposing faction are ommitted to save memory.",
682 {{"/qh nag verbose", "Prints the specific changes that were found."}}, QuestHelper.Nag, QuestHelper},
684 {"PURGE",
685 "Deletes all QuestHelper's collected data.", {}, QuestHelper.Purge, QuestHelper},
687 {"HARDRESET",
688 "Deletes all QuestHelper's collected data and resets QuestHelper preferences.", {}, QuestHelper.HardReset, QuestHelper},
691 { "Performance and debug", {
692 {"PERF",
693 "Sets or shows the route workload. Higher means more agressive route updating, lower means better performance Accepts numbers between 10% and 500%.",
694 {{"/qh perf", "Show current Performance Factor"},
695 {"/qh perf 1", "Sets standard performance"},
696 {"/qh perf 50%", "Does half as much background processing"},
697 {"/qh perf 3", "Computes routes 3 times more aggressively. Better have some good horsepower!"}},
698 QuestHelper.genericSetScale, QuestHelper, "perf_scale", "performance factor", .01, 5},
700 {"PERFLOAD",
701 "Sets or shows the initialization workload. Higher numbers will make QuestHelper load faster, lower numbers will result in better framerate while it's loading.",
702 {{"/qh perfload", "Show current Performance Factor"},
703 {"/qh perfload 1", "Sets standard performance"},
704 {"/qh perfload 50%", "Does half as much background processing"},
705 {"/qh perfload 3", "Loads 3 times as quickly."}},
706 QuestHelper.genericSetScale, QuestHelper, "perfload_scale", "boot performance factor", .2, 5},
708 {"TOP",
709 "Displays various performance stats on QuestHelper.",
711 {"/qh top recycle", "Displays detailed information on QuestHelper's recycled item pools"},
712 {"/qh top usage", "Displays detailed information on which table types are most common"},
713 {"/qh top cache", "Displays detailed information on the internal distance cache"},
714 {"/qh top perf", "Displays detailed information on coroutine CPU usage"},
715 }, QuestHelper.Top, QuestHelper},
717 {"ERROR",
718 "Displays the first QuestHelper error that has been generated this session in a form which can be copied out of WoW.",
719 {}, QuestHelper.ShowError, QuestHelper},
721 {"POS",
722 "Prints the player's current position. Exists mainly for my own personal convenience.",
723 {}, function (qh) qh:TextOut(qh:LocationString(qh.i, qh.x, qh.y) .. " " .. qh:LocationStringRaw(qh:RetrieveRawLocation())) end, QuestHelper},
725 {"COMM",
726 "Toggles showing of the communication between QuestHelper users. Exists mainly for my own personal convenience.",
727 {}, QuestHelper.ToggleComm, QuestHelper},
729 {"RECALC",
730 "Recalculates the world graph and locations for any active objectives. Should not be necessary.", {}, QuestHelper.WantPathingReset, QuestHelper},
733 { "Help", {
734 {"HELP",
735 "Displays a list of help commands. Listed commands are filtered by the passed string.",
736 {}, QuestHelper.Help, QuestHelper},
738 {"VERSION",
739 "Displays QuestHelper's version.", {}, QuestHelper.PrintVersion, QuestHelper},
741 {"CHANGES",
742 "Displays a summary of changes recently made to QuestHelper.",
743 {}, QuestHelper.ChangeLog, QuestHelper},
745 {"DONATE",
746 "Displays some instructions and a link for donating.",
747 {}, QuestHelper.Donate, QuestHelper},
751 function QuestHelper_SlashCommand(input)
752 local _, _, command, argument = string.find(input, "^%s*([^%s]-)%s+(.-)%s*$")
753 if not command then
754 command, argument = input, ""
757 command = string.upper(command)
759 for i1, cat in ipairs(commands) do
760 for i, data in ipairs(cat[2]) do
761 if data[1] == command then
762 local st = {}
764 for i = 5,#data do table.insert(st, data[i]) end
765 table.insert(st, argument)
767 if type(data[4]) == "function" then
768 data[4](unpack(st))
769 else
770 QuestHelper:TextOut(data[1].." is not yet implemented.")
773 return
778 QuestHelper:Help()
781 SLASH_QuestHelper1 = "/qh"
782 SLASH_QuestHelper2 = "/questhelper"
783 SlashCmdList["QuestHelper"] = function (text) QuestHelper_SlashCommand(text) end