update changes
[QuestHelper.git] / help.lua
blobbb8c7725dfee018d9e2000574babf47e61c218c9
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:Purge(code)
181 if code == self.purge_code then
182 QuestHelper_Quests = {}
183 QuestHelper_Objectives = {}
184 QuestHelper_FlightInstructors = {}
185 QuestHelper_FlightRoutes = {}
186 QuestHelper_Locale = GetLocale()
187 QuestHelper_UID = self:CreateUID()
188 ReloadUI()
189 else
190 if not self.purge_code then self.purge_code = self:CreateUID(8) end
191 QuestHelper:TextOut("THIS COMMAND WILL DELETE ALL YOUR COLLECTED DATA")
192 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.")
193 QuestHelper:TextOut("Enter "..self:HighlightText("/qh nag verbose").." to check and see if you're destroying anything important.")
194 QuestHelper:TextOut("See the "..self:HighlightText("How You Can Help").." section on the project website for instructions.")
195 QuestHelper:TextOut("If you're sure you want to go through with this, enter: "..self:HighlightText("/qh purge "..self.purge_code))
199 function QuestHelper:ToggleSolo()
200 QuestHelper_Pref.solo = not QuestHelper_Pref.solo
201 if QuestHelper_Pref.solo then
202 if QuestHelper_Pref.share then
203 self:DisableSharing()
204 self:TextOut("Objective sharing has been temporarly |cffff0000disabled|r.")
206 self:TextOut("Solo mode has been |cff00ff00enabled|r.")
207 else
208 self:TextOut("Solo mode has been |cffff0000disabled|r.")
209 if QuestHelper_Pref.share then
210 self:EnableSharing()
211 self:TextOut("Objective sharing has been re|cff00ff00enabled|r.")
216 function QuestHelper:ToggleComm()
217 if QuestHelper_Pref.comm then
218 QuestHelper_Pref.comm = false
219 self:TextOut("Communication display has been |cffff0000disabled|r.")
220 else
221 QuestHelper_Pref.comm = true
222 self:TextOut("Communication display has been |cff00ff00enabled|r.")
226 function QuestHelper:ToggleAnts()
227 if QuestHelper_Pref.show_ants then
228 QuestHelper_Pref.show_ants = false
229 self:TextOut("Ant trails have been |cffff0000disabled|r.")
230 else
231 QuestHelper_Pref.show_ants = true
232 self:TextOut("Ant trails have been |cff00ff00enabled|r.")
236 function QuestHelper:LevelOffset(offset)
237 local level = tonumber(offset)
238 if level then
239 if level > 0 then
240 self:TextOut("Allowing quests up to "..self:HighlightText(level).." level"..(level==1 and " " or "s ")..self:HighlightText("above").." you.")
241 elseif level < 0 then
242 self:TextOut("Only allowing quests "..self:HighlightText(-level).." level"..(level==-1 and " " or "s ")..self:HighlightText("below").." you.")
243 else
244 self:TextOut("Only allowing quests "..self:HighlightText("at or below").." your current level.")
247 if not QuestHelper_Pref.filter_level then
248 self:TextOut("Note: This won't have any effect until you turn the level filter on.")
251 if QuestHelper_Pref.level ~= level then
252 QuestHelper_Pref.level = level
253 self.defered_quest_scan = true
255 elseif offset == "" then
256 if QuestHelper_Pref.level <= 0 then
257 self:TextOut("Level offset is currently set to "..self:HighlightText(QuestHelper_Pref.level)..".")
258 else
259 self:TextOut("Level offset is currently set to "..self:HighlightText("+"..QuestHelper_Pref.level)..".")
262 if self.party_levels then for n, l in ipairs(self.party_levels) do
263 self:TextOut("Your effective level in a "..self:HighlightText(n).." player quest is "..self:HighlightText(string.format("%.1f", l))..".")
264 end end
266 if QuestHelper_Pref.solo then
267 self:TextOut("Peers aren't considered in your effective level, because you're playing solo.")
269 else
270 self:TextOut("Expected a level offset.")
274 function QuestHelper:Filter(input)
275 input = string.upper(input)
276 if input == "ZONE" then
277 QuestHelper_Pref.filter_zone = not QuestHelper_Pref.filter_zone
278 self:TextOut("Filter "..self:HighlightText("zone").." set to "..self:HighlightText(QuestHelper_Pref.filter_zone and "active" or "inactive")..".")
279 elseif input == "DONE" then
280 QuestHelper_Pref.filter_done = not QuestHelper_Pref.filter_done
281 self:TextOut("Filter "..self:HighlightText("done").." set to "..self:HighlightText(QuestHelper_Pref.filter_done and "active" or "inactive")..".")
282 elseif input == "LEVEL" then
283 QuestHelper_Pref.filter_level = not QuestHelper_Pref.filter_level
284 self:TextOut("Filter "..self:HighlightText("level").." set to "..self:HighlightText(QuestHelper_Pref.filter_level and "active" or "inactive")..".")
285 elseif input == "BLOCKED" or input == "BLOCK" then
286 QuestHelper_Pref.filter_blocked = not QuestHelper_Pref.filter_blocked
287 self:TextOut("Filter "..self:HighlightText("blocked").." set to "..self:HighlightText(QuestHelper_Pref.filter_blocked and "active" or "inactive")..".")
288 elseif input == "WATCHED" or input == "WATCH" then
289 QuestHelper_Pref.filter_watched = not QuestHelper_Pref.filter_watched
290 self:TextOut("Filter "..self:HighlightText("watched").." set to "..self:HighlightText(QuestHelper_Pref.filter_watched and "active" or "inactive")..".")
291 elseif input == "" then
292 self:TextOut("Filter "..self:HighlightText("zone")..": "..self:HighlightText(QuestHelper_Pref.filter_zone and "active" or "inactive"))
293 self:TextOut("Filter "..self:HighlightText("level")..": "..self:HighlightText(QuestHelper_Pref.filter_level and "active" or "inactive"))
294 self:TextOut("Filter "..self:HighlightText("done")..": "..self:HighlightText(QuestHelper_Pref.filter_done and "active" or "inactive"))
295 self:TextOut("Filter "..self:HighlightText("blocked")..": "..self:HighlightText(QuestHelper_Pref.filter_blocked and "active" or "inactive"))
296 self:TextOut("Filter "..self:HighlightText("watched")..": "..self:HighlightText(QuestHelper_Pref.filter_watched and "active" or "inactive"))
297 else
298 self:TextOut("Don't know what you want filtered, expect "..self:HighlightText("zone")..", "..self:HighlightText("done")..", "..self:HighlightText("level")..", or "..self:HighlightText("blocked")..".")
302 function QuestHelper:ToggleCartWP()
303 QuestHelper_Pref.cart_wp = not QuestHelper_Pref.cart_wp
304 if QuestHelper_Pref.cart_wp then
305 self:EnableCartographer()
306 if Cartographer_Waypoints then
307 if Waypoint and Waypoint.prototype then
308 self:TextOut("Would use "..self:HightlightText("Cartographer Waypoints").." to show objectives, but another mod is interfering with it.")
309 else
310 self:TextOut("Will use "..self:HighlightText("Cartographer Waypoints").." to show objectives.")
312 else
313 self:TextOut("Would use "..self:HighlightText("Cartographer Waypoints").." to show objectives, except it doesn't seem to be present.")
315 else
316 self:DisableCartographer()
317 self:TextOut("Won't use "..self:HighlightText("Cartographer Waypoints").." to show objectives.")
321 function QuestHelper:ToggleTomTomWP()
322 QuestHelper_Pref.tomtom_wp = not QuestHelper_Pref.tomtom_wp
323 if QuestHelper_Pref.tomtom_wp then
324 self:EnableTomTom()
325 if TomTom then
326 self:TextOut("Will use "..self:HighlightText("TomTom").." to show objectives.")
327 else
328 self:TextOut("Would use "..self:HighlightText("TomTom").." to show objectives, except it doesn't seem to be present.")
330 else
331 self:DisableTomTom()
332 self:TextOut("Won't use "..self:HighlightText("TomTom").." to show objectives.")
336 function QuestHelper:WantPathingReset()
337 self:TextOut("Will reset world graph.")
338 self.defered_graph_reset = true
341 function QuestHelper:PrintVersion()
342 self:TextOut("Version: "..self:HighlightText(GetAddOnMetadata("QuestHelper", "Version") or "Unknown"))
345 local function RecycleStatusString(fmt, usedcount, freetable, usedtable)
346 local freetablecount = QuestHelper:TableSize(freetable)
347 if usedtable then
348 local usedtablecount = QuestHelper:TableSize(usedtable)
349 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)
350 else
351 return string.format(fmt, QuestHelper:ProgressString(string.format("%d/%d", usedcount, usedcount+freetablecount), ((usedcount+freetablecount == 0) and 1) or (1-usedcount/(usedcount+freetablecount))))
355 function QuestHelper:RecycleInfo(cmd)
356 self:TextOut(RecycleStatusString("Using %s lua tables.", self.used_tables, self.free_tables, self.recycle_tabletyping))
357 self:TextOut(RecycleStatusString("Using %s texture objects.", self.used_textures, self.free_textures))
358 self:TextOut(RecycleStatusString("Using %s font objects.", self.used_text, self.free_text))
359 self:TextOut(RecycleStatusString("Using %s frame objects.", self.used_frames, self.free_frames))
361 if cmd and string.find(cmd, "verbose") then
362 self:DumpTableTypeFrequencies()
365 if cmd and string.find(cmd, "cache") then
366 self:DumpCacheData()
370 function QuestHelper:ToggleMapButton()
371 QuestHelper_Pref.map_button = not QuestHelper_Pref.map_button
373 if QuestHelper_Pref.map_button then
374 QuestHelper:InitMapButton()
375 self:TextOut("Map button has been |cff00ff00enabled|r.")
376 else
377 QuestHelper:HideMapButton()
378 self:TextOut("Map button has been |cffff0000disabled|r. Use '/qh button' to restore it.")
382 function QuestHelper:ChangeLog()
383 self:ShowText(QuestHelper_ChangeLog, string.format("QuestHelper %s ChangeLog", QuestHelper_Version))
386 function QuestHelper:Submit()
387 self:ShowText([[
388 |TInterface\AddOns\QuestHelper\Art\Upload.tga:100:300|t
389 Your data can't be submitted automatically, since AddOns can't interact with anything outside of World of Warcraft.
391 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.
393 World of Warcraft stores QuestHelper's data in a file named |cff40bbffQuestHelper.lua|r.
395 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.
397 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.
399 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.
401 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.
403 After you find |cff40bbffQuestHelper.lua|r, you can email it to me here: |cff40bbffqhaddon@gmail.com|r
404 ]], "How To Submit Your Data")
407 local commands
409 function QuestHelper:Help(argument)
410 local text = ""
411 local argument = argument and argument:upper() or ""
413 for i, data in ipairs(commands) do
414 if data[1]:find(argument, 1, true) then
415 text = string.format("%s|cffff8000%s|r %s\n", text, data[1], data[2])
417 if #data[3] > 0 then
418 text = string.format("%s\n %s\n", text, #data[3] == 1 and "Example:" or "Examples:")
419 for i, pair in ipairs(data[3]) do
420 text = string.format("%s |cff40bbff%s|r\n %s\n", text, pair[1], pair[2])
424 text = text .. "\n"
428 self:ShowText(text == "" and ("No commands containing '"..argument.."'") or text, "QuestHelper Slash Commands")
431 commands =
433 {"VERSION",
434 "Displays QuestHelper's version.", {}, QuestHelper.PrintVersion, QuestHelper},
436 {"RECALC",
437 "Recalculates the world graph and locations for any active objectives.", {}, QuestHelper.WantPathingReset, QuestHelper},
439 {"FTIME",
440 "Toggles display of flight time estimates.", {}, QuestHelper.ToggleFlightTimes, QuestHelper},
442 {"PURGE",
443 "Deletes all QuestHelper's collected data.", {}, QuestHelper.Purge, QuestHelper},
445 {"FILTER",
446 "Automatically ignores/unignores objectives based on criteria.",
447 {{"/qh filter zone", "Toggle showing objectives outside the current zone"},
448 {"/qh filter done", "Toggle showing objectives for uncompleted quests."},
449 {"/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."},
450 {"/qh filter blocked", "Toggle showing blocked objectives, such as quest turn-ins for incomplete quests."},
451 {"/qh filter watched", "Toggle limiting to objectives watched in the Quest Log"}
452 }, QuestHelper.Filter, QuestHelper},
454 {"LEVEL",
455 "Adjusts the level offset used by the level filter. Naturally, the level filter must be turned on to have an effect.",
456 {{"/qh level", "See information related to the level filter."},
457 {"/qh level 0", "Only allow objectives at or below your current level."},
458 {"/qh level +2", "Allow objectives up to two levels above your current level."},
459 {"/qh level -1", "Only allow objectives below your current level."}}, QuestHelper.LevelOffset, QuestHelper},
461 {"SCALE",
462 "Scales the map icons used by QuestHelper. Will accept values between 50% and 300%.",
463 {{"/qh scale 1", "Uses the default icon size."},
464 {"/qh scale 2", "Makes icons twice their default size."},
465 {"/qh scale 80%", "Makes icons slightly smaller than their default size."}},
466 QuestHelper.genericSetScale, QuestHelper, "scale", "icon scale", .5, 3},
468 {"TOOLTIP",
469 "Toggles appending information about tracked items and NPCs to their tooltips.",
470 {}, QuestHelper.ToggleTooltip, QuestHelper},
472 {"TRACK",
473 "Toggles the visibility of the QuestHelper's replacement quest tracker.",
474 {}, QuestHelper.ToggleTrack, QuestHelper},
476 {"TSCALE",
477 "Scales the quest tracker provided by QuestHelper. Will accept values between 50% and 300%.",
479 QuestHelper.TrackerScale, QuestHelper},
481 {"TLEVEL",
482 "Toggles display of levels in the quest tracker provided by QuestHelper.",
483 {}, QuestHelper.ToggleTrackLevel, QuestHelper},
485 {"TQCOL",
486 "Toggles display of colours for the difficulty level of quests in the quest tracker provided by QuestHelper.",
487 {}, QuestHelper.ToggleTrackQColour, QuestHelper},
489 {"TOCOL",
490 "Toggles display of colours for objective progress in the quest tracker provided by QuestHelper.",
491 {}, QuestHelper.ToggleTrackOColour, QuestHelper},
493 {"TRESET",
494 "Reset's the position of the quest tracker provided by QuestHelper, in cause you move it somewhere inaccessable.",
495 {}, QuestHelper.ResetTrackerPosition, QuestHelper},
497 {"NAG",
498 "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.",
499 {{"/qh nag verbose", "Prints the specific changes that were found."}}, QuestHelper.Nag, QuestHelper},
501 {"POS",
502 "Prints the player's current position. Exists mainly for my own personal convenience.",
503 {}, function (qh) qh:TextOut(qh:LocationString(qh.i, qh.x, qh.y)) end, QuestHelper},
505 {"HIDDEN",
506 "Compiles a list of objectives that QuestHelper is hiding from you. Depending on the reason, you can also unhide the objective.",
507 {}, QuestHelper.ShowHidden, QuestHelper},
509 {"FIND",
510 "Search for an item, location, or npc.",
511 {{"/qh find item rune of teleport", "Finds a reagent vendor."},
512 {"/qh find npc bragok", "Finds the Ratchet flight point."},
513 {"/qh find loc stormwind 50 60", "Finds the Stormwind auction house."},
514 {"/qh find loc 50 50", "Finds the center of the zone you're in."},
515 {"/qh find something", "Searches for something in all categories."},
516 {"/qh find", "Lists objectives you manually created so that you can remove them."}}, QuestHelper.PerformSearch, QuestHelper},
518 {"COMM",
519 "Toggles showing of the communication between QuestHelper users. Exists mainly for my own personal convenience.",
520 {}, QuestHelper.ToggleComm, QuestHelper},
522 {"RECYCLE",
523 "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.",
524 {{"/qh recycle verbose", "Displays detailed information on which table types are most common"},
525 {"/qh recycle cache", "Displays detailed information on the internal distance cache"}}, QuestHelper.RecycleInfo, QuestHelper},
527 {"CARTWP",
528 "Toggles displaying the current objective using Cartographer Waypoints.",
529 {}, QuestHelper.ToggleCartWP, QuestHelper},
531 {"TOMTOM",
532 "Toggles displaying the current objective using TomTom.",
533 {}, QuestHelper.ToggleTomTomWP, QuestHelper},
535 {"SHARE",
536 "Toggles objective sharing between QuestHelper users.",
537 {}, QuestHelper.ToggleShare, QuestHelper},
539 {"SOLO",
540 "Toggles solo mode. When enabled, assumes your party members don't exist. Objective sharing with party members will also be disabled.",
541 {}, QuestHelper.ToggleSolo, QuestHelper},
543 {"HIDE",
544 "Hides QuestHelper's modifications to the minimap and world map, and pauses routing calculations.",
545 {}, QuestHelper.ToggleHide, QuestHelper},
547 {"ANTS",
548 "Toggles the display of trails on the world map on and off.",
549 {}, QuestHelper.ToggleAnts, QuestHelper},
551 {"LOCALE",
552 "Select the locale to use for displayed messages.",
553 {}, QuestHelper.SetLocale, QuestHelper},
555 {"PERF",
556 "Sets or shows the route workload. Higher means more agressive route updating, lower means better performance Accepts numbers between 10% and 500%.",
557 {{"/qh perf", "Show current Performance Factor"},
558 {"/qh perf 1", "Sets standard performance"},
559 {"/qh perf 50%", "Does half as much background processing"},
560 {"/qh perf 3", "Computes routes 3 times more aggressively. Better have some good horsepower!"}},
561 QuestHelper.genericSetScale, QuestHelper, "perf_scale", "performance factor", .1, 5},
563 {"BUTTON",
564 "Toggles the display of QuestHelper's button on the world map.",
565 {}, QuestHelper.ToggleMapButton, QuestHelper},
567 {"SETTINGS",
568 "Opens the Settings menu at the current cursor location. Note that not all settings can be changed through the menu.",
569 {}, QuestHelper.DoSettingsMenu, QuestHelper},
571 {"CHANGES",
572 "Displays a summary of changes recently made to QuestHelper. This is always displayed when an upgrade is detected.",
573 {}, QuestHelper.ChangeLog, QuestHelper},
575 {"SUBMIT",
576 "Displays instructions for submitting your collected data.",
577 {}, QuestHelper.Submit, QuestHelper},
579 {"HELP",
580 "Displays a list of help commands. Listed commands are filtered by the passed string.",
581 {}, QuestHelper.Help, QuestHelper}
584 function QuestHelper:SlashCommand(input)
585 local _, _, command, argument = string.find(input, "^%s*([^%s]-)%s+(.-)%s*$")
586 if not command then
587 command, argument = input, ""
590 command = string.upper(command)
592 for i, data in ipairs(commands) do
593 if data[1] == command then
594 local st = self:CreateTable()
596 for i = 5,#data do table.insert(st, data[i]) end
597 table.insert(st, argument)
599 if type(data[4]) == "function" then
600 data[4](unpack(st))
601 else
602 self:TextOut(data[1].." is not yet implemented.")
605 self:ReleaseTable(st)
606 return
610 self:Help()
613 SLASH_QuestHelper1 = "/qh"
614 SLASH_QuestHelper2 = "/questhelper"
615 SlashCmdList["QuestHelper"] = function (text) QuestHelper:SlashCommand(text) end