update changes
[QuestHelper.git] / help.lua
blob1d876fe1a2ca67cf71ddf957eef756c757fe43e7
1 QuestHelper_File["help.lua"] = "Development Version"
3 function QuestHelper:scaleString(val)
4 return self:HighlightText(math.floor(val*100+0.5).."%")
5 end
7 function QuestHelper:genericSetScale(varname, name, mn, mx, input, onchange, ...)
8 if input == "" then
9 self:TextOut(string.format("Current %s scale is %s.", name, self:scaleString(QuestHelper_Pref[varname])))
10 else
11 local scale = tonumber(input)
13 if not scale then
14 local x = string.match(input or "", "^%s*([%d%.]+)%s*%%%s*$")
15 scale = tonumber(x) or 0
16 if not scale then
17 self:TextOut("I don't know how to interpret your input.")
18 return
19 end
20 scale = scale * 0.01
21 end
23 if scale < mn then
24 self:TextOut(string.format("I won't accept a scale less than %s.", self:scaleString(mn)))
25 elseif scale > mx then
26 self:TextOut(string.format("I won't accept a scale more than %s.", self:scaleString(mx)))
27 else
28 QuestHelper_Pref[varname] = scale
29 self:TextOut(string.format("Set %s scale set to %s.", name, self:scaleString(scale)))
30 if onchange then
31 onchange(...)
32 end
33 end
34 end
35 end
37 function QuestHelper:TrackerScale(scale)
38 QuestHelper:genericSetScale("track_scale", "tracker scale", .5, 2, scale,
39 function() QuestHelper.tracker:SetScale(QuestHelper_Pref.track_scale) end)
40 end
42 function QuestHelper:SetLocale(loc)
43 if not loc or loc == "" then
44 self:TextOut(QHText("LOCALE_LIST_BEGIN"))
45 for loc, tbl in pairs(QuestHelper_Translations) do
46 self:TextOut(string.format(" %s%s %s", self:HighlightText(loc),
47 loc == QuestHelper_Pref.locale and " *" or " ",
48 tbl.LOCALE_NAME or "???"))
49 end
50 else
51 for l, tbl in pairs(QuestHelper_Translations) do
52 if string.find(string.lower(l), "^"..string.lower(loc)) or
53 string.find(string.lower(tbl.LOCALE_NAME or ""), "^"..string.lower(loc)) then
54 QuestHelper_Pref.locale = l
55 QHFormatSetLocale(l)
56 self:SetLocaleFonts()
57 self:TextOut(QHFormat("LOCALE_CHANGED", l))
58 return
59 end
60 end
62 self:TextOut(QHFormat("LOCALE_UNKNOWN", tostring(loc) or "UNKNOWN"))
63 end
64 end
66 function QuestHelper:ToggleHide()
67 local current_objective = self.minimap_dodad.objective
69 QuestHelper_Pref.hide = not QuestHelper_Pref.hide
71 -- Desaturate the button texture if QuestHelper is disabled.
72 if self.MapButton then
73 -- This should always be true, but just in case...
74 self.MapButton:GetNormalTexture():SetDesaturated(QuestHelper_Pref.hide)
75 end
77 if QuestHelper_Pref.hide then
78 if QuestHelper_Pref.track then
79 self:HideTracker()
80 end
82 self.map_overlay:Hide()
83 self.minimap_dodad:SetObjective(nil)
84 self.minimap_dodad.objective = current_objective
85 self:TextOut("QuestHelper is now |cffff0000hidden|r.")
86 else
87 if QuestHelper_Pref.track then
88 self:ShowTracker()
89 end
91 self.map_overlay:Show()
92 self.minimap_dodad.objective = nil
93 self.minimap_dodad:SetObjective(current_objective)
94 self:TextOut("QuestHelper is now |cff00ff00shown|r.")
95 -- WoW Will lockup inside ForceRouteUpdate, and so the UPDATING_ROUTE message won't appear until afterwards, making
96 -- this message kind of redundant.
97 -- self:TextOut(QHText("UPDATING_ROUTE"))
98 self:ForceRouteUpdate(4) -- Let the corutine do some overtime...
99 end
102 function QuestHelper:ToggleShare()
103 QuestHelper_Pref.share = not QuestHelper_Pref.share
104 if QuestHelper_Pref.share then
105 if QuestHelper_Pref.solo then
106 self:TextOut("Objective sharing will been |cff00ff00enabled|r when you disable solo mode.")
107 else
108 self:TextOut("Objective sharing has been |cff00ff00enabled|r.")
109 self:EnableSharing()
111 else
112 self:TextOut("Objective sharing has been |cffff0000disabled|r.")
113 if QuestHelper_Pref.solo then
114 self:TextOut("Objective sharing won't be reenabled when you disable solo mode.")
115 else
116 self:DisableSharing()
121 function QuestHelper:ToggleFlightTimes()
122 QuestHelper_Pref.flight_time = not QuestHelper_Pref.flight_time
123 if QuestHelper_Pref.flight_time then
124 self:TextOut("The flight timer has been |cff00ff00enabled|r.")
125 else
126 self:TextOut("The flight timer has been |cffff0000disabled|r.")
130 function QuestHelper:ToggleTrack()
131 QuestHelper_Pref.track = not QuestHelper_Pref.track
132 if QuestHelper_Pref.track then
133 self:ShowTracker()
134 self:TextOut("The quest tracker has been |cff00ff00enabled|r.")
135 else
136 self:HideTracker()
137 self:TextOut("The quest tracker has been |cffff0000disabled|r.")
141 function QuestHelper:ToggleTrackLevel()
142 QuestHelper_Pref.track_level = not QuestHelper_Pref.track_level
143 if QuestHelper_Pref.track_level then
144 self:TextOut("Display of levels in the quest tracker has been |cff00ff00enabled|r.")
145 else
146 self:TextOut("Display of levels in the quest tracker has been |cffff0000disabled|r.")
148 self.tracker:reset()
151 function QuestHelper:ToggleTrackQColour()
152 QuestHelper_Pref.track_qcolour = not QuestHelper_Pref.track_qcolour
153 if QuestHelper_Pref.track_qcolour then
154 self:TextOut("Colour for quest difficulty in quest tracker has been |cff00ff00enabled|r.")
155 else
156 self:TextOut("Colour for quest difficulty in quest tracker has been |cffff0000disabled|r.")
158 self.tracker:reset()
161 function QuestHelper:ToggleTrackOColour()
162 QuestHelper_Pref.track_ocolour = not QuestHelper_Pref.track_ocolour
163 if QuestHelper_Pref.track_ocolour then
164 self:TextOut("Colour for objective progress in quest tracker has been |cff00ff00enabled|r.")
165 else
166 self:TextOut("Colour for objective progress in quest tracker has been |cffff0000disabled|r.")
168 self.tracker:reset()
171 function QuestHelper:ToggleTooltip()
172 QuestHelper_Pref.tooltip = not QuestHelper_Pref.tooltip
173 if QuestHelper_Pref.tooltip then
174 self:TextOut("Objective tooltip information has been |cff00ff00enabled|r.")
175 else
176 self:TextOut("Objective tooltip information has been |cffff0000disabled|r.")
180 function QuestHelper:Purgewarning()
181 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.")
182 QuestHelper:TextOut("Enter "..self:HighlightText("/qh nag verbose").." to check and see if you're destroying anything important.")
183 QuestHelper:TextOut("Enter "..self:HighlightText("/qh submit").." for instructions on how to submit your collected data.")
184 QuestHelper:TextOut("See the "..self:HighlightText("How You Can Help").." section on the project website for instructions.")
187 function QuestHelper:Purge(code, force, noreload)
188 if code == self.purge_code or force then
189 QuestHelper_Quests = nil
190 QuestHelper_Objectives = nil
191 QuestHelper_FlightInstructors = nil
192 QuestHelper_FlightRoutes = nil
193 QuestHelper_Locale = nil
194 QuestHelper_UID = nil
195 QuestHelper_Version = nil
196 QuestHelper_SaveVersion = nil
198 QuestHelper_SaveDate = nil
199 QuestHelper_SeenRealms = nil
201 if not noreload then ReloadUI() end
202 else
203 if not self.purge_code then self.purge_code = self:CreateUID(8) end
204 QuestHelper:TextOut("THIS COMMAND WILL DELETE ALL YOUR COLLECTED DATA")
205 QuestHelper:Purgewarning()
206 QuestHelper:TextOut("If you're sure you want to go through with this, enter: "..self:HighlightText("/qh purge "..self.purge_code))
210 function QuestHelper:HardReset(code)
211 if code == self.purge_code then
212 QuestHelper_Pref = nil
213 QuestHelper_ErrorList = nil -- BIZAM
214 QuestHelper_KnownFlightRoutes = nil
215 QuestHelper_Home = nil
216 QuestHelper_CharVersion = nil
217 self:Purge(nil, true)
218 else
219 if not self.purge_code then self.purge_code = self:CreateUID(8) end
220 QuestHelper:TextOut("THIS COMMAND WILL DELETE ALL YOUR COLLECTED DATA AND RESET ALL YOUR PREFERENCES")
221 QuestHelper:Purgewarning()
222 QuestHelper:TextOut("If you're sure you want to go through with this, enter: "..self:HighlightText("/qh hardreset "..self.purge_code))
226 function QuestHelper:ToggleSolo()
227 QuestHelper_Pref.solo = not QuestHelper_Pref.solo
228 if QuestHelper_Pref.solo then
229 if QuestHelper_Pref.share then
230 self:DisableSharing()
231 self:TextOut("Objective sharing has been temporarly |cffff0000disabled|r.")
233 self:TextOut("Solo mode has been |cff00ff00enabled|r.")
234 else
235 self:TextOut("Solo mode has been |cffff0000disabled|r.")
236 if QuestHelper_Pref.share then
237 self:EnableSharing()
238 self:TextOut("Objective sharing has been re|cff00ff00enabled|r.")
243 function QuestHelper:ToggleComm()
244 if QuestHelper_Pref.comm then
245 QuestHelper_Pref.comm = false
246 self:TextOut("Communication display has been |cffff0000disabled|r.")
247 else
248 QuestHelper_Pref.comm = true
249 self:TextOut("Communication display has been |cff00ff00enabled|r.")
253 function QuestHelper:ToggleAnts()
254 if QuestHelper_Pref.show_ants then
255 QuestHelper_Pref.show_ants = false
256 self:TextOut("Ant trails have been |cffff0000disabled|r.")
257 else
258 QuestHelper_Pref.show_ants = true
259 self:TextOut("Ant trails have been |cff00ff00enabled|r.")
263 function QuestHelper:LevelOffset(offset)
264 local level = tonumber(offset)
265 if level then
266 if level > 0 then
267 self:TextOut("Allowing quests up to "..self:HighlightText(level).." level"..(level==1 and " " or "s ")..self:HighlightText("above").." you.")
268 elseif level < 0 then
269 self:TextOut("Only allowing quests "..self:HighlightText(-level).." level"..(level==-1 and " " or "s ")..self:HighlightText("below").." you.")
270 else
271 self:TextOut("Only allowing quests "..self:HighlightText("at or below").." your current level.")
274 if not QuestHelper_Pref.filter_level then
275 self:TextOut("Note: This won't have any effect until you turn the level filter on.")
278 if QuestHelper_Pref.level ~= level then
279 QuestHelper_Pref.level = level
280 self.defered_quest_scan = true
282 elseif offset == "" then
283 if QuestHelper_Pref.level <= 0 then
284 self:TextOut("Level offset is currently set to "..self:HighlightText(QuestHelper_Pref.level)..".")
285 else
286 self:TextOut("Level offset is currently set to "..self:HighlightText("+"..QuestHelper_Pref.level)..".")
289 if self.party_levels then for n, l in ipairs(self.party_levels) do
290 self:TextOut("Your effective level in a "..self:HighlightText(n).." player quest is "..self:HighlightText(string.format("%.1f", l))..".")
291 end end
293 if QuestHelper_Pref.solo then
294 self:TextOut("Peers aren't considered in your effective level, because you're playing solo.")
296 else
297 self:TextOut("Expected a level offset.")
301 function QuestHelper:Filter(input)
302 input = string.upper(input)
303 if input == "ZONE" then
304 QuestHelper_Pref.filter_zone = not QuestHelper_Pref.filter_zone
305 self:TextOut("Filter "..self:HighlightText("zone").." set to "..self:HighlightText(QuestHelper_Pref.filter_zone and "active" or "inactive")..".")
306 elseif input == "DONE" then
307 QuestHelper_Pref.filter_done = not QuestHelper_Pref.filter_done
308 self:TextOut("Filter "..self:HighlightText("done").." set to "..self:HighlightText(QuestHelper_Pref.filter_done and "active" or "inactive")..".")
309 elseif input == "LEVEL" then
310 QuestHelper_Pref.filter_level = not QuestHelper_Pref.filter_level
311 self:TextOut("Filter "..self:HighlightText("level").." set to "..self:HighlightText(QuestHelper_Pref.filter_level and "active" or "inactive")..".")
312 elseif input == "BLOCKED" or input == "BLOCK" then
313 QuestHelper_Pref.filter_blocked = not QuestHelper_Pref.filter_blocked
314 self:TextOut("Filter "..self:HighlightText("blocked").." set to "..self:HighlightText(QuestHelper_Pref.filter_blocked and "active" or "inactive")..".")
315 elseif input == "WATCHED" or input == "WATCH" then
316 QuestHelper_Pref.filter_watched = not QuestHelper_Pref.filter_watched
317 self:TextOut("Filter "..self:HighlightText("watched").." set to "..self:HighlightText(QuestHelper_Pref.filter_watched and "active" or "inactive")..".")
318 elseif input == "" then
319 self:TextOut("Filter "..self:HighlightText("zone")..": "..self:HighlightText(QuestHelper_Pref.filter_zone and "active" or "inactive"))
320 self:TextOut("Filter "..self:HighlightText("level")..": "..self:HighlightText(QuestHelper_Pref.filter_level and "active" or "inactive"))
321 self:TextOut("Filter "..self:HighlightText("done")..": "..self:HighlightText(QuestHelper_Pref.filter_done and "active" or "inactive"))
322 self:TextOut("Filter "..self:HighlightText("blocked")..": "..self:HighlightText(QuestHelper_Pref.filter_blocked and "active" or "inactive"))
323 self:TextOut("Filter "..self:HighlightText("watched")..": "..self:HighlightText(QuestHelper_Pref.filter_watched and "active" or "inactive"))
324 else
325 self:TextOut("Don't know what you want filtered, expect "..self:HighlightText("zone")..", "..self:HighlightText("done")..", "..self:HighlightText("level")..", or "..self:HighlightText("blocked")..".")
329 function QuestHelper:ToggleCartWP()
330 QuestHelper_Pref.cart_wp = not QuestHelper_Pref.cart_wp
331 if QuestHelper_Pref.cart_wp then
332 self:EnableCartographer()
333 if Cartographer_Waypoints then
334 if Waypoint and Waypoint.prototype then
335 self:TextOut("Would use "..self:HightlightText("Cartographer Waypoints").." to show objectives, but another mod is interfering with it.")
336 else
337 self:TextOut("Will use "..self:HighlightText("Cartographer Waypoints").." to show objectives.")
339 else
340 self:TextOut("Would use "..self:HighlightText("Cartographer Waypoints").." to show objectives, except it doesn't seem to be present.")
342 else
343 self:DisableCartographer()
344 self:TextOut("Won't use "..self:HighlightText("Cartographer Waypoints").." to show objectives.")
348 function QuestHelper:ToggleTomTomWP()
349 QuestHelper_Pref.tomtom_wp = not QuestHelper_Pref.tomtom_wp
350 if QuestHelper_Pref.tomtom_wp then
351 self:EnableTomTom()
352 if TomTom then
353 self:TextOut("Will use "..self:HighlightText("TomTom").." to show objectives.")
354 else
355 self:TextOut("Would use "..self:HighlightText("TomTom").." to show objectives, except it doesn't seem to be present.")
357 else
358 self:DisableTomTom()
359 self:TextOut("Won't use "..self:HighlightText("TomTom").." to show objectives.")
363 function QuestHelper:WantPathingReset()
364 self:TextOut("Will reset world graph.")
365 self.defered_graph_reset = true
368 function QuestHelper:PrintVersion()
369 self:TextOut("Version: "..self:HighlightText(GetAddOnMetadata("QuestHelper", "Version") or "Unknown"))
372 local function RecycleStatusString(fmt, usedcount, freetable, usedtable)
373 local freetablecount = QuestHelper:TableSize(freetable)
374 if usedtable then
375 local usedtablecount = QuestHelper:TableSize(usedtable)
376 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)
377 else
378 return string.format(fmt, QuestHelper:ProgressString(string.format("%d/%d", usedcount, usedcount+freetablecount), ((usedcount+freetablecount == 0) and 1) or (1-usedcount/(usedcount+freetablecount))))
382 function QuestHelper:RecycleInfo(cmd)
383 self:TextOut(RecycleStatusString("Using %s lua tables.", self.used_tables, self.free_tables, self.recycle_tabletyping))
384 self:TextOut(RecycleStatusString("Using %s texture objects.", self.used_textures, self.free_textures))
385 self:TextOut(RecycleStatusString("Using %s font objects.", self.used_text, self.free_text))
386 self:TextOut(RecycleStatusString("Using %s frame objects.", self.used_frames, self.free_frames))
388 if cmd and string.find(cmd, "verbose") then
389 self:DumpTableTypeFrequencies()
392 if cmd and string.find(cmd, "cache") then
393 self:DumpCacheData()
396 UpdateAddOnMemoryUsage()
397 self:TextOut(string.format("QuestHelper is using %dkb of RAM (%s/%s/%s/%s).", GetAddOnMemoryUsage("QuestHelper"), QuestHelper_local_version, QuestHelper_toc_version, GetBuildInfo(), GetLocale()))
400 function QuestHelper:ToggleMapButton()
401 QuestHelper_Pref.map_button = not QuestHelper_Pref.map_button
403 if QuestHelper_Pref.map_button then
404 QuestHelper:InitMapButton()
405 self:TextOut("Map button has been |cff00ff00enabled|r.")
406 else
407 QuestHelper:HideMapButton()
408 self:TextOut("Map button has been |cffff0000disabled|r. Use '/qh button' to restore it.")
412 function QuestHelper:ChangeLog()
413 self:ShowText(QuestHelper_ChangeLog, string.format("QuestHelper %s ChangeLog", QuestHelper_Version))
416 function QuestHelper:Submit()
417 self:ShowText([[
418 |TInterface\AddOns\QuestHelper\Art\Upload.tga:100:300|t
419 Your data can't be submitted automatically, since AddOns can't interact with anything outside of World of Warcraft.
421 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.
423 World of Warcraft stores QuestHelper's data in a file named |cff40bbffQuestHelper.lua|r.
425 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.
427 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.
429 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.
431 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.
433 After you find |cff40bbffQuestHelper.lua|r, you can email it to me here: |cff40bbffqhaddon@gmail.com|r
434 ]], "How To Submit Your Data")
437 function QuestHelper:ShowError()
438 QuestHelper_ErrorCatcher_ReportError()
441 local commands
443 function QuestHelper:Help(argument)
444 local text = ""
445 local argument = argument and argument:upper() or ""
447 for i, data in ipairs(commands) do
448 if data[1]:find(argument, 1, true) then
449 text = string.format("%s|cffff8000%s|r %s\n", text, data[1], data[2])
451 if #data[3] > 0 then
452 text = string.format("%s\n %s\n", text, #data[3] == 1 and "Example:" or "Examples:")
453 for i, pair in ipairs(data[3]) do
454 text = string.format("%s |cff40bbff%s|r\n %s\n", text, pair[1], pair[2])
458 text = text .. "\n"
462 self:ShowText(text == "" and ("No commands containing '"..argument.."'") or text, "QuestHelper Slash Commands")
465 commands =
467 {"VERSION",
468 "Displays QuestHelper's version.", {}, QuestHelper.PrintVersion, QuestHelper},
470 {"RECALC",
471 "Recalculates the world graph and locations for any active objectives.", {}, QuestHelper.WantPathingReset, QuestHelper},
473 {"FTIME",
474 "Toggles display of flight time estimates.", {}, QuestHelper.ToggleFlightTimes, QuestHelper},
476 {"PURGE",
477 "Deletes all QuestHelper's collected data.", {}, QuestHelper.Purge, QuestHelper},
479 {"HARDRESET",
480 "Deletes all QuestHelper's collected data and resets QuestHelper preferences.", {}, QuestHelper.HardReset, QuestHelper},
482 {"FILTER",
483 "Automatically ignores/unignores objectives based on criteria.",
484 {{"/qh filter zone", "Toggle showing objectives outside the current zone"},
485 {"/qh filter done", "Toggle showing objectives for uncompleted quests."},
486 {"/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."},
487 {"/qh filter blocked", "Toggle showing blocked objectives, such as quest turn-ins for incomplete quests."},
488 {"/qh filter watched", "Toggle limiting to objectives watched in the Quest Log"}
489 }, QuestHelper.Filter, QuestHelper},
491 {"LEVEL",
492 "Adjusts the level offset used by the level filter. Naturally, the level filter must be turned on to have an effect.",
493 {{"/qh level", "See information related to the level filter."},
494 {"/qh level 0", "Only allow objectives at or below your current level."},
495 {"/qh level +2", "Allow objectives up to two levels above your current level."},
496 {"/qh level -1", "Only allow objectives below your current level."}}, QuestHelper.LevelOffset, QuestHelper},
498 {"SCALE",
499 "Scales the map icons used by QuestHelper. Will accept values between 50% and 300%.",
500 {{"/qh scale 1", "Uses the default icon size."},
501 {"/qh scale 2", "Makes icons twice their default size."},
502 {"/qh scale 80%", "Makes icons slightly smaller than their default size."}},
503 QuestHelper.genericSetScale, QuestHelper, "scale", "icon scale", .5, 3},
505 {"TOOLTIP",
506 "Toggles appending information about tracked items and NPCs to their tooltips.",
507 {}, QuestHelper.ToggleTooltip, QuestHelper},
509 {"TRACK",
510 "Toggles the visibility of the QuestHelper's replacement quest tracker.",
511 {}, QuestHelper.ToggleTrack, QuestHelper},
513 {"TSCALE",
514 "Scales the quest tracker provided by QuestHelper. Will accept values between 50% and 300%.",
516 QuestHelper.TrackerScale, QuestHelper},
518 {"TLEVEL",
519 "Toggles display of levels in the quest tracker provided by QuestHelper.",
520 {}, QuestHelper.ToggleTrackLevel, QuestHelper},
522 {"TQCOL",
523 "Toggles display of colours for the difficulty level of quests in the quest tracker provided by QuestHelper.",
524 {}, QuestHelper.ToggleTrackQColour, QuestHelper},
526 {"TOCOL",
527 "Toggles display of colours for objective progress in the quest tracker provided by QuestHelper.",
528 {}, QuestHelper.ToggleTrackOColour, QuestHelper},
530 {"TRESET",
531 "Reset's the position of the quest tracker provided by QuestHelper, in cause you move it somewhere inaccessable.",
532 {{"/qh treset center", "Resets to the center of the screen, instead of a more normal quest tracker location."}}, QuestHelper.ResetTrackerPosition, QuestHelper},
534 {"NAG",
535 "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.",
536 {{"/qh nag verbose", "Prints the specific changes that were found."}}, QuestHelper.Nag, QuestHelper},
538 {"POS",
539 "Prints the player's current position. Exists mainly for my own personal convenience.",
540 {}, function (qh) qh:TextOut(qh:LocationString(qh.i, qh.x, qh.y)) end, QuestHelper},
542 {"HIDDEN",
543 "Compiles a list of objectives that QuestHelper is hiding from you. Depending on the reason, you can also unhide the objective.",
544 {}, QuestHelper.ShowHidden, QuestHelper},
546 {"FIND",
547 "Search for an item, location, or npc.",
548 {{"/qh find item rune of teleport", "Finds a reagent vendor."},
549 {"/qh find npc bragok", "Finds the Ratchet flight point."},
550 {"/qh find loc stormwind 50 60", "Finds the Stormwind auction house."},
551 {"/qh find loc 50 50", "Finds the center of the zone you're in."},
552 {"/qh find something", "Searches for something in all categories."},
553 {"/qh find", "Lists objectives you manually created so that you can remove them."}}, QuestHelper.PerformSearch, QuestHelper},
555 {"COMM",
556 "Toggles showing of the communication between QuestHelper users. Exists mainly for my own personal convenience.",
557 {}, QuestHelper.ToggleComm, QuestHelper},
559 {"RECYCLE",
560 "Displays how many unused entities QuestHelper is tracking, so that it can reuse them in the future instead of creating new ones in the future.",
561 {{"/qh recycle verbose", "Displays detailed information on which table types are most common"},
562 {"/qh recycle cache", "Displays detailed information on the internal distance cache"}}, QuestHelper.RecycleInfo, QuestHelper},
564 {"CARTWP",
565 "Toggles displaying the current objective using Cartographer Waypoints.",
566 {}, QuestHelper.ToggleCartWP, QuestHelper},
568 {"TOMTOM",
569 "Toggles displaying the current objective using TomTom.",
570 {}, QuestHelper.ToggleTomTomWP, QuestHelper},
572 {"SHARE",
573 "Toggles objective sharing between QuestHelper users.",
574 {}, QuestHelper.ToggleShare, QuestHelper},
576 {"SOLO",
577 "Toggles solo mode. When enabled, assumes your party members don't exist. Objective sharing with party members will also be disabled.",
578 {}, QuestHelper.ToggleSolo, QuestHelper},
580 {"HIDE",
581 "Hides QuestHelper's modifications to the minimap and world map, and pauses routing calculations.",
582 {}, QuestHelper.ToggleHide, QuestHelper},
584 {"ANTS",
585 "Toggles the display of trails on the world map on and off.",
586 {}, QuestHelper.ToggleAnts, QuestHelper},
588 {"LOCALE",
589 "Select the locale to use for displayed messages.",
590 {}, QuestHelper.SetLocale, QuestHelper},
592 {"PERF",
593 "Sets or shows the route workload. Higher means more agressive route updating, lower means better performance Accepts numbers between 10% and 500%.",
594 {{"/qh perf", "Show current Performance Factor"},
595 {"/qh perf 1", "Sets standard performance"},
596 {"/qh perf 50%", "Does half as much background processing"},
597 {"/qh perf 3", "Computes routes 3 times more aggressively. Better have some good horsepower!"}},
598 QuestHelper.genericSetScale, QuestHelper, "perf_scale", "performance factor", .1, 5},
600 {"BUTTON",
601 "Toggles the display of QuestHelper's button on the world map.",
602 {}, QuestHelper.ToggleMapButton, QuestHelper},
604 {"SETTINGS",
605 "Opens the Settings menu at the current cursor location. Note that not all settings can be changed through the menu.",
606 {}, QuestHelper.DoSettingsMenu, QuestHelper},
608 {"CHANGES",
609 "Displays a summary of changes recently made to QuestHelper. This is always displayed when an upgrade is detected.",
610 {}, QuestHelper.ChangeLog, QuestHelper},
612 {"ERROR",
613 "Displays the first QuestHelper error that has been generated this session in a form which can be copied out of WoW.",
614 {}, QuestHelper.ShowError, QuestHelper},
616 {"SUBMIT",
617 "Displays instructions for submitting your collected data.",
618 {}, QuestHelper.Submit, QuestHelper},
620 {"HELP",
621 "Displays a list of help commands. Listed commands are filtered by the passed string.",
622 {}, QuestHelper.Help, QuestHelper}
625 function QuestHelper_SlashCommand(input)
626 local _, _, command, argument = string.find(input, "^%s*([^%s]-)%s+(.-)%s*$")
627 if not command then
628 command, argument = input, ""
631 command = string.upper(command)
633 for i, data in ipairs(commands) do
634 if data[1] == command then
635 local st = {}
637 for i = 5,#data do table.insert(st, data[i]) end
638 table.insert(st, argument)
640 if type(data[4]) == "function" then
641 data[4](unpack(st))
642 else
643 QuestHelper:TextOut(data[1].." is not yet implemented.")
646 return
650 QuestHelper:Help()
653 SLASH_QuestHelper1 = "/qh"
654 SLASH_QuestHelper2 = "/questhelper"
655 SlashCmdList["QuestHelper"] = function (text) QuestHelper_SlashCommand(text) end