vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | --[[ |
2 | |||
3 | MonkeyQuest: |
||
4 | Displays your quests for quick viewing. |
||
5 | |||
6 | Website: http://wow.visualization.ca/ |
||
7 | Author: Trentin (monkeymods@gmail.com) |
||
8 | |||
9 | |||
10 | Contributors: |
||
11 | Celdor |
||
12 | - Help with the Quest Log Freeze bug |
||
13 | |||
14 | Diungo |
||
15 | - Toggle grow direction |
||
16 | |||
17 | Pkp |
||
18 | - Color Quest Titles the same as the quest level |
||
19 | |||
20 | wowpendium.de |
||
21 | - German translation |
||
22 | |||
23 | MarsMod |
||
24 | - Valid player name before the VARIABLES_LOADED event bug |
||
25 | - Settings resetting bug |
||
26 | |||
27 | --]] |
||
28 | |||
29 | |||
30 | -- define the dialog box for reseting config |
||
31 | StaticPopupDialogs["MONKEYQUEST_RESET"] = { |
||
32 | text = TEXT(MONKEYQUEST_CONFIRM_RESET), |
||
33 | button1 = TEXT(OKAY), |
||
34 | button2 = TEXT(CANCEL), |
||
35 | OnAccept = function() |
||
36 | MonkeyQuestInit_ResetConfig(); |
||
37 | if (DEFAULT_CHAT_FRAME) then |
||
38 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_RESET_MSG); |
||
39 | end |
||
40 | end, |
||
41 | timeout = 0, |
||
42 | exclusive = 1 |
||
43 | }; |
||
44 | |||
45 | -- function to register all the slash commands |
||
46 | function MonkeyQuestSlash_Init() |
||
47 | -- this command toggles the Quest Monkey display |
||
48 | SlashCmdList["MONKEYQUEST_DISPLAY"] = MonkeyQuestSlash_Parse; |
||
49 | SLASH_MONKEYQUEST_DISPLAY1 = "/monkeyquest"; |
||
50 | SLASH_MONKEYQUEST_DISPLAY2 = "/mquest"; |
||
51 | end |
||
52 | |||
53 | function MonkeyQuestSlash_Parse(msg) |
||
54 | -- if not loaded yet then get out |
||
55 | if (MonkeyQuest.m_bLoaded == false) then |
||
56 | return; |
||
57 | end |
||
58 | |||
59 | if (msg == nil or msg == "" or string.find(msg, "help") ~= nil) then |
||
60 | local i, j = string.find(msg, "help"); |
||
61 | |||
62 | if (i ~= nil) then |
||
63 | MonkeyQuestSlash_CmdHelp(string.lower(string.sub(msg, j + 2))); |
||
64 | return; |
||
65 | end |
||
66 | |||
67 | MonkeyQuestSlash_CmdHelp(); |
||
68 | return; |
||
69 | end |
||
70 | if (string.lower(msg) == "reset") then |
||
71 | MonkeyQuestSlash_CmdReset(); |
||
72 | return; |
||
73 | end |
||
74 | if (string.lower(msg) == "open") then |
||
75 | MonkeyQuestSlash_CmdOpen(true); |
||
76 | return; |
||
77 | end |
||
78 | if (string.lower(msg) == "close") then |
||
79 | MonkeyQuestSlash_CmdOpen(false); |
||
80 | return; |
||
81 | end |
||
82 | if (string.lower(msg) == "showhidden") then |
||
83 | MonkeyQuestSlash_CmdShowHidden(true); |
||
84 | return; |
||
85 | end |
||
86 | if (string.lower(msg) == "hidehidden") then |
||
87 | MonkeyQuestSlash_CmdShowHidden(false); |
||
88 | return; |
||
89 | end |
||
90 | if (string.lower(msg) == "useoverviews") then |
||
91 | MonkeyQuestSlash_CmdUseOverviews(true); |
||
92 | return; |
||
93 | end |
||
94 | if (string.lower(msg) == "nooverviews") then |
||
95 | MonkeyQuestSlash_CmdUseOverviews(false); |
||
96 | return; |
||
97 | end |
||
98 | if (string.lower(msg) == "hideheaders") then |
||
99 | MonkeyQuestSlash_CmdHideHeaders(true); |
||
100 | return; |
||
101 | end |
||
102 | if (string.lower(msg) == "showheaders") then |
||
103 | MonkeyQuestSlash_CmdHideHeaders(false); |
||
104 | return; |
||
105 | end |
||
106 | if (string.lower(msg) == "hideborder") then |
||
107 | MonkeyQuestSlash_CmdHideBorder(true); |
||
108 | return; |
||
109 | end |
||
110 | if (string.lower(msg) == "showborder") then |
||
111 | MonkeyQuestSlash_CmdHideBorder(false); |
||
112 | return; |
||
113 | end |
||
114 | if (string.lower(msg) == "growup") then |
||
115 | MonkeyQuestSlash_CmdGrowUp(true); |
||
116 | return; |
||
117 | end |
||
118 | if (string.lower(msg) == "growdown") then |
||
119 | MonkeyQuestSlash_CmdGrowUp(false); |
||
120 | return; |
||
121 | end |
||
122 | if (string.find(msg, "alpha") ~= nil) then |
||
123 | local i, j = string.find(msg, "%d+"); |
||
124 | |||
125 | if (i ~= nil) then |
||
126 | MonkeyQuestSlash_CmdAlpha(tonumber(string.sub(msg, i, j), 10)); |
||
127 | end |
||
128 | return; |
||
129 | end |
||
130 | if (string.find(msg, "width") ~= nil) then |
||
131 | local i, j = string.find(msg, "%d+"); |
||
132 | |||
133 | if (i ~= nil) then |
||
134 | MonkeyQuestSlash_CmdWidth(tonumber(string.sub(msg, i, j), 10)); |
||
135 | end |
||
136 | return; |
||
137 | end |
||
138 | if (string.find(msg, "fontheight") ~= nil) then |
||
139 | local i, j = string.find(msg, "%d+"); |
||
140 | |||
141 | if (i ~= nil) then |
||
142 | MonkeyQuestSlash_CmdFontHeight(tonumber(string.sub(msg, i, j), 10)); |
||
143 | end |
||
144 | return; |
||
145 | end |
||
146 | if (string.find(msg, "tipanchor") ~= nil) then |
||
147 | local i, j = string.find(msg, "="); |
||
148 | |||
149 | if (i ~= nil) then |
||
150 | MonkeyQuestSlash_CmdTipAnchor(string.sub(msg, i + 1)); |
||
151 | end |
||
152 | return; |
||
153 | end |
||
154 | if (string.lower(msg) == "shownumquests") then |
||
155 | MonkeyQuestSlash_CmdShowNumQuests(true); |
||
156 | return; |
||
157 | end |
||
158 | if (string.lower(msg) == "hidenumquests") then |
||
159 | MonkeyQuestSlash_CmdShowNumQuests(false); |
||
160 | return; |
||
161 | end |
||
162 | if (string.lower(msg) == "lock") then |
||
163 | MonkeyQuestSlash_CmdLock(true); |
||
164 | return; |
||
165 | end |
||
166 | if (string.lower(msg) == "unlock") then |
||
167 | MonkeyQuestSlash_CmdLock(false); |
||
168 | return; |
||
169 | end |
||
170 | if (string.lower(msg) == "colourtitleon" or string.lower(msg) == "colortitleon") then |
||
171 | MonkeyQuestSlash_CmdColourTitleOn(true); |
||
172 | return; |
||
173 | end |
||
174 | if (string.lower(msg) == "colourtitleoff" or string.lower(msg) == "colortitleoff") then |
||
175 | MonkeyQuestSlash_CmdColourTitleOn(false); |
||
176 | return; |
||
177 | end |
||
178 | if (string.lower(msg) == "hidecompletedquests") then |
||
179 | MonkeyQuestSlash_CmdHideCompletedQuests(true); |
||
180 | return; |
||
181 | end |
||
182 | if (string.lower(msg) == "showcompletedquests") then |
||
183 | MonkeyQuestSlash_CmdHideCompletedQuests(false); |
||
184 | return; |
||
185 | end |
||
186 | if (string.lower(msg) == "hidecompletedobjectives") then |
||
187 | MonkeyQuestSlash_CmdHideCompletedObjectives(true); |
||
188 | return; |
||
189 | end |
||
190 | if (string.lower(msg) == "showcompletedobjectives") then |
||
191 | MonkeyQuestSlash_CmdHideCompletedObjectives(false); |
||
192 | return; |
||
193 | end |
||
194 | if (string.lower(msg) == "showtooltipobjectives") then |
||
195 | MonkeyQuestSlash_CmdShowTooltipObjectives(true); |
||
196 | return; |
||
197 | end |
||
198 | if (string.lower(msg) == "hidetooltipobjectives") then |
||
199 | MonkeyQuestSlash_CmdShowTooltipObjectives(false); |
||
200 | return; |
||
201 | end |
||
202 | if (string.lower(msg) == "allowrightclick") then |
||
203 | MonkeyQuestSlash_CmdAllowRightClick(true); |
||
204 | return; |
||
205 | end |
||
206 | if (string.lower(msg) == "disallowrightclick") then |
||
207 | MonkeyQuestSlash_CmdAllowRightClick(false); |
||
208 | return; |
||
209 | end |
||
210 | if (string.lower(msg) == "hidetitlebuttons") then |
||
211 | MonkeyQuestSlash_CmdHideTitleButtons(true); |
||
212 | return; |
||
213 | end |
||
214 | if (string.lower(msg) == "showtitlebuttons") then |
||
215 | MonkeyQuestSlash_CmdHideTitleButtons(false); |
||
216 | return; |
||
217 | end |
||
218 | if (string.lower(msg) == "hidetitle") then |
||
219 | MonkeyQuestSlash_CmdHideTitle(true); |
||
220 | return; |
||
221 | end |
||
222 | if (string.lower(msg) == "showtitle") then |
||
223 | MonkeyQuestSlash_CmdHideTitle(false); |
||
224 | return; |
||
225 | end |
||
226 | |||
227 | -- didn't match any others, print out the help msg |
||
228 | MonkeyQuestSlash_CmdHelp(); |
||
229 | end |
||
230 | |||
231 | function MonkeyQuestSlash_CmdHelp(strCommand) |
||
232 | if (not DEFAULT_CHAT_FRAME) then |
||
233 | return; |
||
234 | end |
||
235 | |||
236 | if (strCommand == nil) then |
||
237 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_MSG); |
||
238 | return; |
||
239 | end |
||
240 | if (strCommand == "reset") then |
||
241 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_RESET_MSG); |
||
242 | return; |
||
243 | end |
||
244 | if (strCommand == "open") then |
||
245 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_OPEN_MSG); |
||
246 | return; |
||
247 | end |
||
248 | if (strCommand == "close") then |
||
249 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_CLOSE_MSG); |
||
250 | return; |
||
251 | end |
||
252 | if (strCommand == "showhidden") then |
||
253 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_SHOWHIDDEN_MSG); |
||
254 | return; |
||
255 | end |
||
256 | if (strCommand == "hidehidden") then |
||
257 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_HIDEHIDDEN_MSG); |
||
258 | return; |
||
259 | end |
||
260 | if (strCommand == "useoverviews") then |
||
261 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_USEOVERVIEWS_MSG); |
||
262 | return; |
||
263 | end |
||
264 | if (strCommand == "nooverviews") then |
||
265 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_NOOVERVIEWS_MSG); |
||
266 | return; |
||
267 | end |
||
268 | if (strCommand == "tipanchor") then |
||
269 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_TIPANCHOR_MSG); |
||
270 | return; |
||
271 | end |
||
272 | if (strCommand == "alpha") then |
||
273 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_ALPHA_MSG); |
||
274 | return; |
||
275 | end |
||
276 | if (strCommand == "width") then |
||
277 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_WIDTH_MSG); |
||
278 | return; |
||
279 | end |
||
280 | if (strCommand == "fontheight") then |
||
281 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_FONTHEIGHT_MSG); |
||
282 | return; |
||
283 | end |
||
284 | if (strCommand == "hideheaders") then |
||
285 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_HIDEHEADERS_MSG); |
||
286 | return; |
||
287 | end |
||
288 | if (strCommand == "showheaders") then |
||
289 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_SHOWHEADERS_MSG); |
||
290 | return; |
||
291 | end |
||
292 | if (strCommand == "hideborder") then |
||
293 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_HIDEBORDER_MSG); |
||
294 | return; |
||
295 | end |
||
296 | if (strCommand == "showborder") then |
||
297 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_SHOWBORDER_MSG); |
||
298 | return; |
||
299 | end |
||
300 | if (strCommand == "growup") then |
||
301 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_GROWUP_MSG); |
||
302 | return; |
||
303 | end |
||
304 | if (strCommand == "growdown") then |
||
305 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_GROWDOWN_MSG); |
||
306 | return; |
||
307 | end |
||
308 | if (strCommand == "hidenumquests") then |
||
309 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_HIDENUMQUESTS_MSG); |
||
310 | return; |
||
311 | end |
||
312 | if (strCommand == "shownumquests") then |
||
313 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_SHOWNUMQUESTS_MSG); |
||
314 | return; |
||
315 | end |
||
316 | if (strCommand == "lock") then |
||
317 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_LOCK_MSG); |
||
318 | return; |
||
319 | end |
||
320 | if (strCommand == "unlock") then |
||
321 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_UNLOCK_MSG); |
||
322 | return; |
||
323 | end |
||
324 | if (strCommand == "colourtitleon" or strCommand == "colortitleon") then |
||
325 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_COLOURTITLEON_MSG); |
||
326 | return; |
||
327 | end |
||
328 | if (strCommand == "colourtitleoff" or strCommand == "colortitleoff") then |
||
329 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_COLOURTITLEOFF_MSG); |
||
330 | return; |
||
331 | end |
||
332 | if (strCommand == "hidecompletedquests") then |
||
333 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_HIDECOMPLETEDQUESTS_MSG); |
||
334 | return; |
||
335 | end |
||
336 | if (strCommand == "showcompletedquests") then |
||
337 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_SHOWCOMPLETEDQUESTS_MSG); |
||
338 | return; |
||
339 | end |
||
340 | if (strCommand == "hidecompletedobjectives") then |
||
341 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_HIDECOMPLETEDOBJECTIVES_MSG); |
||
342 | return; |
||
343 | end |
||
344 | if (strCommand == "showcompletedobjectives") then |
||
345 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_SHOWCOMPLETEDOBJECTIVES_MSG); |
||
346 | return; |
||
347 | end |
||
348 | if (strCommand == "fontheight") then |
||
349 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_FONTHEIGHT_MSG); |
||
350 | return; |
||
351 | end |
||
352 | if (strCommand == "showtooltipobjectives") then |
||
353 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_SHOWTOOLTIPOBJECTIVES_MSG); |
||
354 | return; |
||
355 | end |
||
356 | if (strCommand == "hidetooltipobjectives") then |
||
357 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_HIDETOOLTIPOBJECTIVES_MSG); |
||
358 | return; |
||
359 | end |
||
360 | if (strCommand == "allowrightclick") then |
||
361 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_ALLOWRIGHTCLICK_MSG); |
||
362 | return; |
||
363 | end |
||
364 | if (strCommand == "disallowrightclick") then |
||
365 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_DISALLOWRIGHTCLICK_MSG); |
||
366 | return; |
||
367 | end |
||
368 | if (strCommand == "hidetitlebuttons") then |
||
369 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_HIDETITLEBUTTONS_MSG); |
||
370 | return; |
||
371 | end |
||
372 | if (strCommand == "showtitlebuttons") then |
||
373 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_SHOWTITLEBUTTONS_MSG); |
||
374 | return; |
||
375 | end |
||
376 | |||
377 | -- made it to the end just print the default help |
||
378 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_HELP_MSG); |
||
379 | end |
||
380 | |||
381 | function MonkeyQuestSlash_CmdReset() |
||
382 | StaticPopup_Show("MONKEYQUEST_RESET"); |
||
383 | end |
||
384 | |||
385 | function MonkeyQuestSlash_CmdOpen(bOpen) |
||
386 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bDisplay = bOpen; |
||
387 | |||
388 | if (bOpen == true) then |
||
389 | MonkeyQuest_Show(); |
||
390 | else |
||
391 | MonkeyQuest_Hide(); |
||
392 | end |
||
393 | |||
394 | -- check for MonkeyBuddy |
||
395 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
396 | MonkeyBuddyQuestFrame_Refresh(); |
||
397 | end |
||
398 | end |
||
399 | |||
400 | function MonkeyQuestSlash_CmdShowHidden(bShow) |
||
401 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowHidden = bShow; |
||
402 | MonkeyQuest_Refresh(); |
||
403 | |||
404 | -- check for MonkeyBuddy |
||
405 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
406 | MonkeyBuddyQuestFrame_Refresh(); |
||
407 | end |
||
408 | end |
||
409 | |||
410 | function MonkeyQuestSlash_CmdUseOverviews(bOverviews) |
||
411 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bObjectives = bOverviews; |
||
412 | MonkeyQuest_Refresh(); |
||
413 | |||
414 | -- check for MonkeyBuddy |
||
415 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
416 | MonkeyBuddyQuestFrame_Refresh(); |
||
417 | end |
||
418 | end |
||
419 | |||
420 | function MonkeyQuestSlash_CmdHideHeaders(bHide) |
||
421 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bNoHeaders = bHide; |
||
422 | MonkeyQuest_Refresh(); |
||
423 | |||
424 | -- check for MonkeyBuddy |
||
425 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
426 | MonkeyBuddyQuestFrame_Refresh(); |
||
427 | end |
||
428 | end |
||
429 | |||
430 | function MonkeyQuestSlash_CmdAlwaysHeaders(bAlways) |
||
431 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bAlwaysHeaders = bAlways; |
||
432 | MonkeyQuest_Refresh(); |
||
433 | |||
434 | -- check for MonkeyBuddy |
||
435 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
436 | MonkeyBuddyQuestFrame_Refresh(); |
||
437 | end |
||
438 | end |
||
439 | |||
440 | function MonkeyQuestSlash_CmdHideBorder(bNoBorder) |
||
441 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bNoBorder = bNoBorder; |
||
442 | |||
443 | if (bNoBorder == true) then |
||
444 | MonkeyQuestFrame:SetBackdropBorderColor(0.0, 0.0, 0.0, 0.0); |
||
445 | elseif (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bCrashBorder == true) then |
||
446 | MonkeyQuestFrame:SetBackdropBorderColor(MONKEYQUEST_DEFAULT_CRASHCOLOUR.r, MONKEYQUEST_DEFAULT_CRASHCOLOUR.g, MONKEYQUEST_DEFAULT_CRASHCOLOUR.b, 1.0); |
||
447 | else |
||
448 | MonkeyQuestFrame:SetBackdropBorderColor(TOOLTIP_DEFAULT_COLOR.r, TOOLTIP_DEFAULT_COLOR.g, TOOLTIP_DEFAULT_COLOR.b, 1.0); |
||
449 | end |
||
450 | |||
451 | -- check for MonkeyBuddy |
||
452 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
453 | MonkeyBuddyQuestFrame_Refresh(); |
||
454 | end |
||
455 | end |
||
456 | |||
457 | function MonkeyQuestSlash_CmdGrowUp(bGrowUp) |
||
458 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bGrowUp = bGrowUp; |
||
459 | |||
460 | -- check for MonkeyBuddy |
||
461 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
462 | MonkeyBuddyQuestFrame_Refresh(); |
||
463 | end |
||
464 | end |
||
465 | |||
466 | function MonkeyQuestSlash_CmdAlpha(iAlpha) |
||
467 | if (iAlpha >= 0 and iAlpha <= 255) then |
||
468 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iAlpha = iAlpha / 255; |
||
469 | MonkeyQuest_SetAlpha(MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iAlpha); |
||
470 | end |
||
471 | |||
472 | -- check for MonkeyBuddy |
||
473 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
474 | MonkeyBuddyQuestFrame_Refresh(); |
||
475 | end |
||
476 | end |
||
477 | |||
478 | function MonkeyQuestSlash_CmdWidth(iWidth) |
||
479 | if (iWidth >= 200 and iWidth <= 600) then |
||
480 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFrameWidth = iWidth; |
||
481 | MonkeyQuestFrame:SetWidth(MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFrameWidth); |
||
482 | MonkeyQuest_Refresh(); |
||
483 | end |
||
484 | |||
485 | -- check for MonkeyBuddy |
||
486 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
487 | MonkeyBuddyQuestFrame_Refresh(); |
||
488 | end |
||
489 | end |
||
490 | |||
491 | function MonkeyQuestSlash_CmdFontHeight(iHeight) |
||
492 | if (iHeight >= 8 and iHeight <= 48) then |
||
493 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFontHeight = iHeight; |
||
494 | |||
495 | MonkeyQuest_Refresh(); |
||
496 | |||
497 | -- little fix for when changing the font size |
||
498 | MonkeyQuestFrame:SetScale(2); |
||
499 | MonkeyQuestFrame:SetScale(1); |
||
500 | end |
||
501 | |||
502 | -- check for MonkeyBuddy |
||
503 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
504 | MonkeyBuddyQuestFrame_Refresh(); |
||
505 | end |
||
506 | end |
||
507 | |||
508 | function MonkeyQuestSlash_CmdTipAnchor(strAnchor) |
||
509 | if (strAnchor == nil) then |
||
510 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = "DEFAULT"; |
||
511 | return; |
||
512 | end |
||
513 | |||
514 | -- let's check that it's a valid anchor before setting it |
||
515 | if (string.upper(strAnchor) == "ANCHOR_TOPLEFT") then |
||
516 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = string.upper(strAnchor); |
||
517 | return; |
||
518 | end |
||
519 | if (string.upper(strAnchor) == "ANCHOR_TOPRIGHT") then |
||
520 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = string.upper(strAnchor); |
||
521 | return; |
||
522 | end |
||
523 | if (string.upper(strAnchor) == "ANCHOR_TOP") then |
||
524 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = string.upper(strAnchor); |
||
525 | return; |
||
526 | end |
||
527 | if (string.upper(strAnchor) == "ANCHOR_LEFT") then |
||
528 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = string.upper(strAnchor); |
||
529 | return; |
||
530 | end |
||
531 | if (string.upper(strAnchor) == "ANCHOR_RIGHT") then |
||
532 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = string.upper(strAnchor); |
||
533 | return; |
||
534 | end |
||
535 | if (string.upper(strAnchor) == "ANCHOR_BOTTOMLEFT") then |
||
536 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = string.upper(strAnchor); |
||
537 | return; |
||
538 | end |
||
539 | if (string.upper(strAnchor) == "ANCHOR_BOTTOMRIGHT") then |
||
540 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = string.upper(strAnchor); |
||
541 | return; |
||
542 | end |
||
543 | if (string.upper(strAnchor) == "ANCHOR_BOTTOM") then |
||
544 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = string.upper(strAnchor); |
||
545 | return; |
||
546 | end |
||
547 | if (string.upper(strAnchor) == "ANCHOR_CURSOR") then |
||
548 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = string.upper(strAnchor); |
||
549 | return; |
||
550 | end |
||
551 | if (string.upper(strAnchor) == "DEFAULT") then |
||
552 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = string.upper(strAnchor); |
||
553 | return; |
||
554 | end |
||
555 | if (string.upper(strAnchor) == "NONE") then |
||
556 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = string.upper(strAnchor); |
||
557 | return; |
||
558 | end |
||
559 | |||
560 | -- bad input or default, set it to the default position |
||
561 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = "ANCHOR_TOPLEFT"; |
||
562 | |||
563 | -- check for MonkeyBuddy |
||
564 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
565 | MonkeyBuddyQuestFrame_Refresh(); |
||
566 | end |
||
567 | end |
||
568 | |||
569 | function MonkeyQuestSlash_CmdShowNumQuests(bShowNumQuests) |
||
570 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowNumQuests = bShowNumQuests; |
||
571 | MonkeyQuest_Refresh(); |
||
572 | |||
573 | -- check for MonkeyBuddy |
||
574 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
575 | MonkeyBuddyQuestFrame_Refresh(); |
||
576 | end |
||
577 | end |
||
578 | |||
579 | function MonkeyQuestSlash_CmdLock(bLocked) |
||
580 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bLocked = bLocked; |
||
581 | |||
582 | -- check for MonkeyBuddy |
||
583 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
584 | MonkeyBuddyQuestFrame_Refresh(); |
||
585 | end |
||
586 | end |
||
587 | |||
588 | function MonkeyQuestSlash_CmdColourTitleOn(bColourTitle) |
||
589 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bColourTitle = bColourTitle; |
||
590 | MonkeyQuest_Refresh(); |
||
591 | |||
592 | -- check for MonkeyBuddy |
||
593 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
594 | MonkeyBuddyQuestFrame_Refresh(); |
||
595 | end |
||
596 | end |
||
597 | |||
598 | function MonkeyQuestSlash_CmdHideCompletedQuests(bHide) |
||
599 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideCompletedQuests = bHide; |
||
600 | MonkeyQuest_Refresh(); |
||
601 | |||
602 | -- check for MonkeyBuddy |
||
603 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
604 | MonkeyBuddyQuestFrame_Refresh(); |
||
605 | end |
||
606 | end |
||
607 | |||
608 | function MonkeyQuestSlash_CmdHideCompletedObjectives(bHide) |
||
609 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideCompletedObjectives = bHide; |
||
610 | MonkeyQuest_Refresh(); |
||
611 | |||
612 | -- check for MonkeyBuddy |
||
613 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
614 | MonkeyBuddyQuestFrame_Refresh(); |
||
615 | end |
||
616 | end |
||
617 | |||
618 | function MonkeyQuestSlash_CmdShowTooltipObjectives(bShow) |
||
619 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowTooltipObjectives = bShow; |
||
620 | |||
621 | -- check for MonkeyBuddy |
||
622 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
623 | MonkeyBuddyQuestFrame_Refresh(); |
||
624 | end |
||
625 | end |
||
626 | |||
627 | function MonkeyQuestSlash_CmdAllowRightClick(bAllow) |
||
628 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bAllowRightClick = bAllow; |
||
629 | |||
630 | -- check for MonkeyBuddy |
||
631 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
632 | MonkeyBuddyQuestFrame_Refresh(); |
||
633 | end |
||
634 | end |
||
635 | |||
636 | function MonkeyQuestSlash_CmdHideTitleButtons(bHide) |
||
637 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideTitleButtons = bHide; |
||
638 | |||
639 | if (bHide == true) then |
||
640 | MonkeyQuestCloseButton:Hide(); |
||
641 | MonkeyQuestMinimizeButton:Hide(); |
||
642 | MonkeyQuestShowHiddenCheckButton:Hide(); |
||
643 | else |
||
644 | MonkeyQuestCloseButton:Show(); |
||
645 | MonkeyQuestMinimizeButton:Show(); |
||
646 | MonkeyQuestShowHiddenCheckButton:Show(); |
||
647 | end |
||
648 | |||
649 | -- check for MonkeyBuddy |
||
650 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
651 | MonkeyBuddyQuestFrame_Refresh(); |
||
652 | end |
||
653 | end |
||
654 | |||
655 | function MonkeyQuestSlash_CmdHideTitle(bHide) |
||
656 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideTitle = bHide; |
||
657 | MonkeyQuest_Refresh(); |
||
658 | |||
659 | -- check for MonkeyBuddy |
||
660 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
661 | MonkeyBuddyQuestFrame_Refresh(); |
||
662 | end |
||
663 | end |
||
664 | |||
665 | function MonkeyQuestSlash_ToggleDisplay() |
||
666 | -- if not loaded yet then get out |
||
667 | if (MonkeyQuest.m_bLoaded == false) then |
||
668 | return; |
||
669 | end |
||
670 | |||
671 | if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bDisplay) then |
||
672 | MonkeyQuest_Hide(); |
||
673 | else |
||
674 | MonkeyQuest_Show(); |
||
675 | end |
||
676 | |||
677 | -- check for MonkeyBuddy |
||
678 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
679 | MonkeyBuddyQuestFrame_Refresh(); |
||
680 | end |
||
681 | end |
||
682 | |||
683 | function MonkeyQuestSlash_ToggleShowHidden() |
||
684 | -- if not loaded yet then get out |
||
685 | if (MonkeyQuest.m_bLoaded == false) then |
||
686 | return; |
||
687 | end |
||
688 | |||
689 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowHidden = not MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowHidden; |
||
690 | |||
691 | MonkeyQuest_Refresh(); |
||
692 | |||
693 | -- check for MonkeyBuddy |
||
694 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
695 | MonkeyBuddyQuestFrame_Refresh(); |
||
696 | end |
||
697 | end |
||
698 | |||
699 | function MonkeyQuestSlash_ToggleObjectives() |
||
700 | -- if not loaded yet then get out |
||
701 | if (MonkeyQuest.m_bLoaded == false) then |
||
702 | return; |
||
703 | end |
||
704 | |||
705 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bObjectives = not MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bObjectives; |
||
706 | |||
707 | MonkeyQuest_Refresh(); |
||
708 | |||
709 | -- check for MonkeyBuddy |
||
710 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
711 | MonkeyBuddyQuestFrame_Refresh(); |
||
712 | end |
||
713 | end |
||
714 | |||
715 | function MonkeyQuestSlash_ToggleAnchor() |
||
716 | |||
717 | -- if not loaded yet then get out |
||
718 | if (MonkeyQuest.m_bLoaded == false) then |
||
719 | return; |
||
720 | end |
||
721 | |||
722 | if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bDefaultAnchor == true) then |
||
723 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bDefaultAnchor = false; |
||
724 | |||
725 | else |
||
726 | if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor == "ANCHOR_BOTTOMRIGHT") then |
||
727 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = "ANCHOR_BOTTOMLEFT"; |
||
728 | |||
729 | elseif (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor == "ANCHOR_BOTTOMLEFT") then |
||
730 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = "ANCHOR_TOPLEFT"; |
||
731 | |||
732 | elseif (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor == "ANCHOR_TOPLEFT") then |
||
733 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = "ANCHOR_LEFT"; |
||
734 | |||
735 | elseif (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor == "ANCHOR_LEFT") then |
||
736 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = "ANCHOR_CURSOR"; |
||
737 | |||
738 | elseif (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor == "ANCHOR_CURSOR") then |
||
739 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bDefaultAnchor = true; |
||
740 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = "ANCHOR_BOTTOMRIGHT"; |
||
741 | |||
742 | end |
||
743 | end |
||
744 | |||
745 | -- check for MonkeyBuddy |
||
746 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
747 | MonkeyBuddyQuestFrame_Refresh(); |
||
748 | end |
||
749 | end |
||
750 | |||
751 | function MonkeyQuestSlash_Alpha(msg) |
||
752 | -- if not loaded yet then get out |
||
753 | if (MonkeyQuest.m_bLoaded == false) then |
||
754 | return; |
||
755 | end |
||
756 | |||
757 | if (not(tonumber(msg, 10) == nil)) then |
||
758 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iAlpha = tonumber(msg, 10); |
||
759 | else |
||
760 | -- set it to the default |
||
761 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iAlpha = MONKEYQUEST_DEFAULT_ALPHA; |
||
762 | end |
||
763 | |||
764 | MonkeyQuest_SetAlpha(MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iAlpha); |
||
765 | |||
766 | -- check for MonkeyBuddy |
||
767 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
768 | MonkeyBuddyQuestFrame_Refresh(); |
||
769 | end |
||
770 | end |
||
771 | |||
772 | function MonkeyQuestSlash_Width(msg) |
||
773 | -- if not loaded yet then get out |
||
774 | if (MonkeyQuest.m_bLoaded == false) then |
||
775 | return; |
||
776 | end |
||
777 | |||
778 | if (not(tonumber(msg, 10) == nil)) then |
||
779 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFrameWidth = tonumber(msg, 10); |
||
780 | else |
||
781 | -- set it to the default |
||
782 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFrameWidth = MONKEYQUEST_DEFAULT_WIDTH; |
||
783 | end |
||
784 | |||
785 | MonkeyQuest_Refresh(); |
||
786 | |||
787 | -- Let the user know they might have to reload the ui |
||
788 | if (DEFAULT_CHAT_FRAME) then |
||
789 | DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_SET_WIDTH_MSG); |
||
790 | end |
||
791 | |||
792 | -- check for MonkeyBuddy |
||
793 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
794 | MonkeyBuddyQuestFrame_Refresh(); |
||
795 | end |
||
796 | end |
||
797 | |||
798 | function MonkeyQuestSlash_ToggleNoHeaders() |
||
799 | -- if not loaded yet then get out |
||
800 | if (MonkeyQuest.m_bLoaded == false) then |
||
801 | return; |
||
802 | end |
||
803 | |||
804 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bNoHeaders = not MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bNoHeaders; |
||
805 | |||
806 | MonkeyQuest_Refresh(); |
||
807 | |||
808 | -- check for MonkeyBuddy |
||
809 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
810 | MonkeyBuddyQuestFrame_Refresh(); |
||
811 | end |
||
812 | end |
||
813 | |||
814 | function MonkeyQuestSlash_ToggleNoBorder() |
||
815 | -- if not loaded yet then get out |
||
816 | if (MonkeyQuest.m_bLoaded == false) then |
||
817 | return; |
||
818 | end |
||
819 | |||
820 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bNoBorder = not MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bNoBorder; |
||
821 | |||
822 | if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bNoBorder == true) then |
||
823 | MonkeyQuestFrame:SetBackdropBorderColor(0.0, 0.0, 0.0, 0.0); |
||
824 | elseif (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bCrashBorder == false) then |
||
825 | MonkeyQuestFrame:SetBackdropBorderColor(TOOLTIP_DEFAULT_COLOR.r, TOOLTIP_DEFAULT_COLOR.g, TOOLTIP_DEFAULT_COLOR.b, 1.0); |
||
826 | else |
||
827 | MonkeyQuestFrame:SetBackdropBorderColor(MONKEYQUEST_DEFAULT_CRASHCOLOUR.r, MONKEYQUEST_DEFAULT_CRASHCOLOUR.g, MONKEYQUEST_DEFAULT_CRASHCOLOUR.b, 1.0); |
||
828 | end |
||
829 | |||
830 | --MonkeyQuest_Refresh(); |
||
831 | |||
832 | -- check for MonkeyBuddy |
||
833 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
834 | MonkeyBuddyQuestFrame_Refresh(); |
||
835 | end |
||
836 | end |
||
837 | |||
838 | function MonkeyQuestSlash_ToggleGrow() |
||
839 | -- if not loaded yet then get out |
||
840 | if (MonkeyQuest.m_bLoaded == false) then |
||
841 | return; |
||
842 | end |
||
843 | |||
844 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bGrowUp = not MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bGrowUp; |
||
845 | |||
846 | MonkeyQuest_Refresh(); |
||
847 | |||
848 | -- check for MonkeyBuddy |
||
849 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
850 | MonkeyBuddyQuestFrame_Refresh(); |
||
851 | end |
||
852 | end |
||
853 | |||
854 | function MonkeyQuestSlash_CmdShowNoobTips(bShowNoobTips) |
||
855 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowNoobTips = bShowNoobTips; |
||
856 | |||
857 | -- check for MonkeyBuddy |
||
858 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
859 | MonkeyBuddyQuestFrame_Refresh(); |
||
860 | end |
||
861 | end |
||
862 | |||
863 | function MonkeyQuestSlash_CmdSetQuestPadding(iPadding) |
||
864 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iQuestPadding = iPadding; |
||
865 | |||
866 | local i = 2; |
||
867 | |||
868 | -- loop through ALL the quest button and apply the padding |
||
869 | for i = 2, MONKEYQUEST_MAX_BUTTONS, 1 do |
||
870 | getglobal("MonkeyQuestButton" .. i):SetPoint("TOPLEFT", "MonkeyQuestButton" .. (i - 1), "BOTTOMLEFT", 0, -iPadding); |
||
871 | end |
||
872 | |||
873 | -- resize MonkeyQuest |
||
874 | MonkeyQuest_Resize(); |
||
875 | |||
876 | -- check for MonkeyBuddy |
||
877 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
878 | MonkeyBuddyQuestFrame_Refresh(); |
||
879 | end |
||
880 | end |
||
881 | |||
882 | function MonkeyQuestSlash_CmdShowZoneHighlight(bShowZoneHighlight) |
||
883 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowZoneHighlight = bShowZoneHighlight; |
||
884 | |||
885 | MonkeyQuest_Refresh(); |
||
886 | |||
887 | -- check for MonkeyBuddy |
||
888 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
889 | MonkeyBuddyQuestFrame_Refresh(); |
||
890 | end |
||
891 | end |
||
892 | |||
893 | function MonkeyQuestSlash_CmdShowQuestLevel(bShowQuestLevel) |
||
894 | MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowQuestLevel = bShowQuestLevel; |
||
895 | |||
896 | MonkeyQuest_Refresh(); |
||
897 | |||
898 | -- check for MonkeyBuddy |
||
899 | if (MonkeyBuddyQuestFrame_Refresh ~= nil) then |
||
900 | MonkeyBuddyQuestFrame_Refresh(); |
||
901 | end |
||
902 | end |