vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 --------------------------------------------------------------------------
2 -- TitanQuests.lua
3 --------------------------------------------------------------------------
4 --[[
5  
6 Titan Panel [Quests]
7 Displays number of quests in Titan Panel. When hovered over it
8 displays the following info:
9 - total number of quests
10 - number of Elite quests
11 - number of Dungeon quests
12 - number of Raid quests
13 - number of PvP quests
14 - number of regular quests (non elite/dungeon/raid/pvp)
15 - number of quests in log currently completed
16  
17 Right-click to see a color coded list of current quests. When hovered
18 over a dropdown menu will appear with a list of quest objectives, add to
19 Blizzard's Quest Tracker, share quest, abandon quest, open quest details
20 and link quest to chat.
21  
22 The Options menu allows you to sort and groupthe quests by level, zone,
23 or by title. You can also apply a filter to view only dungeon, elite,
24 complete, incomplete, or regular quests.
25  
26 Can toggle MonkeyQuest, QuestHistory, PartyQuests, QuestIon and
27 QuestBank if these AddOns are installed.
28  
29 NOTE: Requires Titan Panel version 1.22+
30  
31 TODO: Minor French and German translations. Complete Korean translations.
32  
33 v0.18 (June 8, 2006 01:00 PST)
34 - updated toc# to latest patch) [Ryessa]
35 - fixed background on quest detail frame [Ryessa]
36 - re-positioned close button on text frame [Ryessa]
37  
38 v0.17 (January 7, 2006 13:30 PST)
39 - fixed quest detail frame
40  
41 v0.16 (January 6, 2006 10:00 PST)
42 - updated toc# for 1.9 patch
43  
44 v0.15 (September 20, 2005 10:15 PST)
45 - updated toc# for 1.70 patch
46 - fixed the error caused when minimizing a quest section in Blizzard's QuestLog
47  
48 v0.14 (July 6, 2005 10:18 PST)
49 - Added persistence of quests over UI reloads and logout [Ryessa]
50 - Refactored Titan [Quests] into smaller, more logical files TitanQuests (.lua, .xml), TitanQuestsDetails (.lua, .xml), and TitanQuestsUtils (.lua) [Ryessa]
51  
52 v0.13 (June 28, 2005 9:11 PST)
53 - fixed bug when clicking on "Quest Details"
54 - minor German translation fix (thanks Scarabeus)
55  
56 v0.12 (June 26, 2005 1:00 PST)
57 - added ability to click on a quest to add to the quest tracker directly [Ryessa]
58 - added option to set "Watch" or "Quest Details" as primary action when clicking a quest [Ryessa]
59 - added SHIFT-click to perform the secondary action ("Watch" or "Quest Details") [Ryessa]
60 - cleaned up info display panel a bit [Ryessa]
61 - set quests to store their toggle state in Titan variables (prep to persist watched quests between sessions) [Ryessa]
62 - added option to disable grouping of quests under Zone or Level headings [Ryessa]
63 - moved a lot of code into utility functions for code cleanliness at cost of a slight perf hit (not noticable) [Ryessa]
64 - added "Failed" quest tag [Corgi]
65  
66 v0.11 (June 15, 2005 16:40 PST)
67 - new quest list layout [Ryessa]
68 - added option to show only incomplete quests (need loc guys to review) [Ryessa]
69 - added grouping headers when sorting by location or level [Ryessa]
70 - moved most options to a side menu because of the larger size from grouping [Ryessa]
71 - Shortened English tooltip descriptors [Ryessa]
72 - Changed Titan button text to be NumComplete/NumCurrent [Ryessa]
73 - updated for Titan Panel 1.24 [Corgi]
74  
75 v0.10 (June 7, 2005 20:30 PST)
76 - German localization changes (thanks Kaesemuffin)
77 - added French localization (thanks Vorpale)
78 - toc updated for 1.50 patch
79  
80 v0.09 (June 2, 2005 15:31 PST)
81 - fixed bug that was causing WoW.exe to crash when changing characters
82 - added German localization (thanks Scarabeus)
83  
84 v0.08 (May 30, 2005 14:00 PST)
85 - added the ability to sort the quest list by location (default), level or title.
86 - added the ability to just show quests based on their type (ie, just show elite quests).
87  
88 v0.07 (May 27, 2005 17:41 PST)
89 - added a [Quests] icon for the Titan Panel, which can be turned on/off.
90 - minor changes to text displayed in mouseover tooltip.
91  
92 v0.06 (May 20, 2005 20:27 PST)
93 - added 'Quest Details' button to quest dropdown menu.
94 - added a 'Link Quest' button to quest dropdown menu.
95 - added Location to Quest Details.
96 - added colored quest level text to Quest Details window title.
97 - fixed ui scaling issue with Quest Details window.
98 - added 'Toggle' dropdown menu to toggle the blizzard's quest log and various 3rd party addons.
99 - clicking on quest now opens a movable window with complete quest info, including rewards.
100 - Share Quest has been added to quest dropdown menu.
101 - Abandon Quest has been added to quest dropdown menu (a window will open for confirmation).
102 - localization.lua is ready for german, french and korean translations
103  
104 v0.05 (May 15, 2005 16:20 PST)
105 - clicking on a quest in the quest list will open a dropdown menu showing the quest objectives and a button to add/remove the quest from Blizzard's Quest Tracker.
106 - added quest location and complete tag to the quest list.
107 - added the ability to toggle PartyQuests, QuestBank, QuestIon if they are installed.
108 - changed 'About' button to open a dropdown menu displaying mod name, version and author name.
109  
110 v0.04 (May 14, 2005 19:43 PST)
111 - added the ability to toggle MonkeyQuest and/or QuestHistory from the right-click menu if they are installed.
112 - added version info to mouseover tooltip.
113 - added 'About' to right-click menu, which opens a window displaying mod name, version and author name.
114  
115 v0.03 (May 13, 2005 14:28 PST)
116 - clicking on quest will now open the quest log to that particular quest.
117  
118 v0.02 (May 13, 2005 12:01 PST)
119 - fixed typo to allow 'Show Label Text' to work.
120  
121 v0.01 (May 13, 2005 10:30 PST)
122 - Initial Release
123  
124 ]]--
125  
126 --
127 -- Titan Panel Variables
128 --
129 TITAN_QUESTS_ID = "Quests";
130  
131 TITAN_QUESTS_ARTWORK_PATH = "Interface\\AddOns\\TitanQuests\\Artwork\\";
132  
133 TitanQuestsWatched = nil;
134 TitanQuestsSettingsInit = nil;
135  
136 --
137 -- OnFunctions
138 --
139 function TitanPanelQuestsButton_OnLoad()
140  
141 this.registry = {
142 id = TITAN_QUESTS_ID,
143 menuText = TITAN_QUESTS_MENU_TEXT,
144 buttonTextFunction = "TitanPanelQuestsButton_GetButtonText",
145 tooltipTitle = TITAN_QUESTS_TOOLTIP,
146 tooltipTextFunction = "TitanPanelQuestsButton_GetTooltipText",
147 icon = TITAN_QUESTS_ARTWORK_PATH.."TitanQuests",
148 iconWidth = 16,
149 savedVariables = {
150 ShowIcon = 1,
151 ShowLabelText = 1,
152 SortByLevel = TITAN_NIL,
153 SortByLocation = 1,
154 SortByTitle = TITAN_NIL,
155 ShowElite = TITAN_NIL,
156 ShowDungeon = TITAN_NIL,
157 ShowRaid = TITAN_NIL,
158 ShowPVP = TITAN_NIL,
159 ShowRegular = TITAN_NIL,
160 ShowCompleted = TITAN_NIL,
161 ShowIncomplete = TITAN_NIL,
162 ShowAll = 1,
163 GroupBehavior = 1,
164 ClickBehavior = TITAN_NIL,
165 QuestsWatched = { nil, nil, nil, nil, nil },
166 }
167 };
168  
169 this:RegisterEvent("VARIABLES_LOADED");
170 this:RegisterEvent("PLAYER_ENTERING_WORLD");
171 this:RegisterEvent("UNIT_NAME_UPDATE");
172 this:RegisterEvent("QUEST_LOG_UPDATE");
173  
174 end
175  
176 function TitanPanelQuestsButton_OnUpdate(elapsed)
177  
178 if ( TitanQuestsWatched ) then
179 return;
180 end
181  
182 if ( TitanQuestsSettingsInit ) then
183 return;
184 end
185  
186 if ( TitanGetVar(TITAN_QUESTS_ID,"QuestsWatched") ~= nil ) then
187 TitanPanelQuests_InitSettings();
188 end
189 end
190  
191 function TitanPanelQuestsButton_OnEvent()
192  
193 if ( event == "VARIABLES_LOADED" or event == "PLAYER_ENTERING_WORLD" or event == "UNIT_NAME_UPDATE" ) then
194 TitanQuestsWatched = nil;
195 TitanQuestsSettingsInit = nil;
196  
197 elseif ( event == "QUEST_LOG_UPDATE" ) then
198 -- Update Details panel if needed.
199 if ( TitanQuests_Details ~= nil ) then
200 if ( TitanQuests_Details:IsVisible() ) then
201 TitanQuests_Details_Update();
202 end
203 end
204  
205 -- Update the QuestWatched trackers
206 TitanPanelQuests_UpdateSettings();
207 end
208  
209 TitanPanelButton_UpdateButton(TITAN_QUESTS_ID);
210 TitanPanelButton_UpdateTooltip();
211  
212 end
213  
214 --
215 -- initialize all Titan Quests settings
216 --
217 function TitanPanelQuests_InitSettings()
218  
219 TitanQuestsSettingsInit = 1;
220  
221 -- Load up the Blizzard Quest Tracker
222 if ( not TitanQuestsWatched ) then
223  
224 if (TitanGetVar(TITAN_QUESTS_ID, "QuestsWatched") ~= nil) then
225 TitanQuestsWatched = TitanGetVar(TITAN_QUESTS_ID, "QuestsWatched");
226 else
227 TitanQuestsWatched = { nil, nil, nil, nil, nil };
228 TitanSetVar(TITAN_QUESTS_ID, "QuestsWatched", TitanQuestsWatched);
229 end
230  
231 for i=1, MAX_WATCHABLE_QUESTS do
232 if (TitanQuestsWatched[i] ~= nil) then
233 if ( GetNumQuestLeaderBoards(TitanQuestsWatched[i]) > 0 ) then
234 local foundQuest = nil;
235 for j=1, GetNumQuestWatches() do
236 local questIndex = GetQuestIndexForWatch(j);
237 if ( questIndex == TitanQuestsWatched[i] ) then
238 foundQuest = 1;
239 end;
240 end
241  
242 if (not foundQuest) then
243 AddQuestWatch(TitanQuestsWatched[i]);
244 end
245 else
246 TitanQuestsWatched[i] = nil;
247 TitanSetVar(TITAN_QUESTS_ID, "QuestsWatched", TitanQuestsWatched);
248 end
249 end
250 end
251  
252 QuestWatch_Update();
253 end
254  
255 end
256  
257 --
258 -- update the Titan Quests settings following a log update
259 --
260 function TitanPanelQuests_UpdateSettings()
261 local questIndex;
262 local numWatched;
263  
264 -- Fill in the watched quests.
265 if ( not TitanQuestsWatched or not TitanGetVar(TITAN_QUESTS_ID, "QuestsWatched") ) then
266 return;
267 end
268  
269 numWatched = GetNumQuestWatches();
270 for i=1, MAX_WATCHABLE_QUESTS do
271 if ( i <= numWatched ) then
272 questIndex = GetQuestIndexForWatch(i);
273 if ( questIndex ) then
274 TitanQuestsWatched[i] = questIndex;
275 end
276 else
277 TitanQuestsWatched[i] = nil;
278 end
279 end
280 TitanSetVar(TITAN_QUESTS_ID, "QuestsWatched", TitanQuestsWatched);
281  
282 end
283  
284 --
285 -- create button text
286 --
287 function TitanPanelQuestsButton_GetButtonText(id)
288  
289 local MaxQuests = 20;
290 local NumCompleteQuests = 0;
291  
292 local NumEntries, NumQuests;
293  
294 NumEntries, NumQuests = GetNumQuestLogEntries();
295  
296 -- get quest list
297 local questlist = TitanPanelQuests_BuildQuestList();
298 local i = 0;
299  
300 -- count the number of incomplete quests
301 for i=1, NumQuests do
302 if ( questlist[i] ~= nil and questlist[i].questisComplete ) then
303 NumCompleteQuests = NumCompleteQuests + 1;
304 end
305 end
306  
307 -- create string for Titan bar display
308 local buttonRichText = format(TITAN_QUESTS_BUTTON_TEXT, TitanUtils_GetGreenText(NumCompleteQuests), TitanUtils_GetHighlightText(NumQuests) );
309  
310 -- Return our button label
311 return TITAN_QUESTS_BUTTON_LABEL, buttonRichText;
312 end
313  
314 --
315 -- create tooltip text
316 --
317 function TitanPanelQuestsButton_GetTooltipText()
318  
319 -- Expand everything
320 ExpandQuestHeader(0);
321  
322 -- return string for tooltip
323 local tooltipRichText = "";
324  
325 -- counters
326 local numElite = 0;
327 local numDungeon = 0;
328 local numRaid = 0;
329 local numPVP = 0;
330 local numReg = 0;
331 local numComplete = 0;
332 local numIncomplete = 0;
333  
334 local i = 0;
335  
336 local numQuests = 0;
337  
338 -- get quest list
339 local questlist = TitanPanelQuests_BuildQuestList();
340  
341 -- total number of quests
342 numQuests = table.getn(questlist);
343  
344 -- count the different type of quests and count completed quests
345 for i=1, numQuests do
346 if ( questlist[i].questTag == ELITE ) then
347 numElite = numElite + 1;
348 elseif ( questlist[i].questTag == TITAN_QUESTS_DUNGEON ) then
349 numDungeon = numDungeon + 1;
350 elseif ( questlist[i].questTag == TITAN_QUESTS_RAID ) then
351 numRaid = numRaid + 1;
352 elseif ( questlist[i].questTag == TITAN_QUESTS_PVP ) then
353 numPVP = numPVP + 1;
354 else
355 numReg = numReg + 1;
356 end
357  
358 if ( questlist[i].questisComplete ) then
359 numComplete = numComplete + 1;
360 else
361 numIncomplete = numIncomplete + 1;
362 end
363 end
364  
365 tooltipRichText = tooltipRichText..TitanUtils_GetNormalText(TITAN_QUESTS_TOOLTIP_QUESTS_TEXT)..TitanUtils_GetHighlightText(numQuests.."\n");
366 tooltipRichText = tooltipRichText..TitanUtils_GetNormalText(TITAN_QUESTS_TOOLTIP_ELITE_TEXT)..TitanUtils_GetHighlightText(numElite.."\n");
367 tooltipRichText = tooltipRichText..TitanUtils_GetNormalText(TITAN_QUESTS_TOOLTIP_DUNGEON_TEXT)..TitanUtils_GetHighlightText(numDungeon.."\n");
368 tooltipRichText = tooltipRichText..TitanUtils_GetNormalText(TITAN_QUESTS_TOOLTIP_RAID_TEXT)..TitanUtils_GetHighlightText(numRaid.."\n");
369 tooltipRichText = tooltipRichText..TitanUtils_GetNormalText(TITAN_QUESTS_TOOLTIP_PVP_TEXT)..TitanUtils_GetHighlightText(numPVP.."\n");
370 tooltipRichText = tooltipRichText..TitanUtils_GetNormalText(TITAN_QUESTS_TOOLTIP_REGULAR_TEXT)..TitanUtils_GetHighlightText(numReg.."\n");
371 tooltipRichText = tooltipRichText.."\n";
372 tooltipRichText = tooltipRichText..TitanUtils_GetNormalText(TITAN_QUESTS_TOOLTIP_COMPLETED_TEXT)..TitanUtils_GetHighlightText(numComplete).."\n";
373 tooltipRichText = tooltipRichText..TitanUtils_GetNormalText(TITAN_QUESTS_TOOLTIP_INCOMPLETE_TEXT)..TitanUtils_GetHighlightText(numIncomplete).."\n";
374 tooltipRichText = tooltipRichText.."\n"..TitanUtils_GetGreenText(TITAN_QUESTS_TOOLTIP_HINT_TEXT);
375 return tooltipRichText;
376 end
377  
378 --
379 -- create toplevel right-click menu
380 --
381 function TitanPanelRightClickMenu_PrepareQuestsMenu()
382 -- Large sections commented out, since they are replaced by various utility functions. - Ryessa
383  
384 if ( UIDROPDOWNMENU_MENU_LEVEL >= 2 ) then
385 TitanPanelQuestsRightClickMenu_CreateMenu();
386 else
387 -- get quest list
388 local questlist = TitanPanelQuests_BuildQuestList();
389  
390 -- total number of quests
391 local numQuests = table.getn(questlist);
392  
393 local groupBy = "Location";
394  
395 -- tracking length of list
396 local numButtons = 1; -- Starts at 1 because "Quests" header is added elsewhere. - Ryessa
397  
398 if ( TitanGetVar(TITAN_QUESTS_ID, "SortByLevel") ) then
399 table.sort(questlist, function(a,b) return (a.questLevel < b.questLevel); end);
400 groupBy = "Level";
401 end
402  
403 if ( TitanGetVar(TITAN_QUESTS_ID, "SortByTitle") ) then
404 table.sort(questlist, function(a,b) return (a.questTitle < b.questTitle); end);
405 groupBy = "Title";
406 end
407  
408 local useTag;
409 local completeTag;
410 local questWatched = "";
411 local diff;
412  
413 local groupId = "";
414 local lastGroupId = "";
415  
416 local questDisplayCount = 0;
417  
418 local i = 0;
419  
420 local info = {};
421  
422 TitanPanelRightClickMenu_AddTitle(TitanPlugins[TITAN_QUESTS_ID].menuText);
423  
424 -- create a configuration entry
425 info = {};
426 info.text = TITAN_QUESTS_OPTIONS_TEXT;
427 info.value = "Options";
428 info.hasArrow = 1;
429 UIDropDownMenu_AddButton(info);
430 numButtons = numButtons + 1;
431  
432 -- output quest list to menu
433 for i=1, numQuests do
434 local unCheckableQuest = nil; -- added
435 if ( TitanGetVar(TITAN_QUESTS_ID, "SortByLocation") and TitanGetVar(TITAN_QUESTS_ID, "GroupBehavior") ) then
436 groupId = questlist[i].questLocation;
437 elseif ( TitanGetVar(TITAN_QUESTS_ID, "SortByLevel") and TitanGetVar(TITAN_QUESTS_ID, "GroupBehavior") ) then
438 groupId = TITAN_QUESTS_LEVEL_TEXT..questlist[i].questLevel;
439 end
440  
441 -- check to see if quest is to be displayed
442 local checkDisplay = 0;
443  
444 if ( TitanGetVar(TITAN_QUESTS_ID, "ShowElite") ) then
445 if ( questlist[i].questTag == ELITE ) then
446 checkDisplay = 1;
447 end
448 elseif ( TitanGetVar(TITAN_QUESTS_ID, "ShowDungeon") ) then
449 if ( questlist[i].questTag == TITAN_QUESTS_DUNGEON ) then
450 checkDisplay = 1;
451 end
452 elseif ( TitanGetVar(TITAN_QUESTS_ID, "ShowRaid") ) then
453 if ( questlist[i].questTag == TITAN_QUESTS_RAID ) then
454 checkDisplay = 1;
455 end
456 elseif ( TitanGetVar(TITAN_QUESTS_ID, "ShowPVP") ) then
457 if ( questlist[i].questTag == TITAN_QUESTS_PVP ) then
458 checkDisplay = 1;
459 end
460 elseif ( TitanGetVar(TITAN_QUESTS_ID, "ShowRegular") ) then
461 if ( questlist[i].questTag == nil ) then
462 checkDisplay = 1;
463 end
464 elseif ( TitanGetVar(TITAN_QUESTS_ID, "ShowCompleted") ) then
465 if ( questlist[i].questisComplete ) then
466 checkDisplay = 1;
467 end
468 elseif ( TitanGetVar(TITAN_QUESTS_ID, "ShowIncomplete") ) then
469 if ( not questlist[i].questisComplete ) then
470 checkDisplay = 1;
471 end
472 else
473 checkDisplay = 1;
474 end
475  
476 if ( checkDisplay == 1 ) then
477  
478 -- Check if this will be the last item displayed
479 if ( (questDisplayCount == 29) or ((groupId ~= "" and groupId ~= lastGroupId) and (questDisplayCount==28)) ) then
480  
481 -- Display a truncation notice and exit for loop
482 info.text = TITAN_QUESTS_QUESTLOG_TRUNCATED_TEXT;
483 info.isTitle = 1;
484 info.value = "QuestLogTruncated";
485 info.hasArrow = nil;
486 info.notCheckable = 1;
487 UIDropDownMenu_AddButton(info);
488 numButtons = numButtons + 1;
489  
490 break;
491 else
492 questDisplayCount = questDisplayCount + 1;
493 info = {};
494 if ( groupId ~= "" and groupId ~= lastGroupId ) then
495 info.text = groupId;
496 info.isTitle = 1;
497 info.notCheckable = 1;
498 UIDropDownMenu_AddButton(info);
499 numButtons = numButtons + 1;
500 info = {};
501 lastGroupId = groupId;
502 questDisplayCount = questDisplayCount + 1;
503 end
504  
505 if ( IsQuestWatched(questlist[i].questID) ) then
506 -- May want to move part of this code to OnLoad() - Ryessa
507 TitanSetVar(TITAN_QUESTS_ID, questlist[i].questID, 1);
508 info.checked = TitanGetVar(TITAN_QUESTS_ID, questlist[i].questID);
509 end
510  
511 info.text = TitanPanelQuests_GetQuestText(questlist[i].questID); -- added
512  
513 info.value = {TITAN_QUESTS_ID, questlist[i].questID, nil};
514 info.hasArrow = 1;
515  
516 info.func = TitanPanelQuests_ClickQuest;
517 --info.notCheckable = 1;
518 info.keepShownOnClick = 1;
519 UIDropDownMenu_AddButton(info);
520 numButtons = numButtons + 1;
521  
522 -- Add a tracking variable to set the button id for this quest.
523 TitanSetVar(TITAN_QUESTS_ID, questlist[i].questID.."ButtonID", numButtons);
524 end
525 end
526 end
527 end
528 end
529  
530  
531 --
532 -- create 2nd level right-click menu
533 --
534 function TitanPanelQuestsRightClickMenu_CreateMenu()
535  
536 local info = {};
537  
538 if ( UIDROPDOWNMENU_MENU_LEVEL == 2 ) then
539 if ( UIDROPDOWNMENU_MENU_VALUE == "Options" ) then
540 -- sort selection
541 info = {};
542 info.text = TITAN_QUESTS_SORT_TEXT;
543 info.value = "Sort";
544 info.hasArrow = 1;
545 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
546  
547 -- show selection
548 info = {};
549 info.text = TITAN_QUESTS_SHOW_TEXT;
550 info.value = "Show";
551 info.hasArrow = 1;
552 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
553  
554 -- toggle dropdown menu
555 info = {};
556 info.text = TITAN_QUESTS_TOGGLE_TEXT;
557 info.value = "Toggle";
558 info.hasArrow = 1;
559 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
560  
561 TitanPanelRightClickMenu_AddSpacer(UIDROPDOWNMENU_MENU_LEVEL);
562  
563 -- toggle click behavior
564 info = {};
565 info.text = TITAN_QUESTS_CLICK_BEHAVIOR_TEXT;
566 info.value = "ClickBehavior";
567 info.hasArrow = nil;
568 info.keepShownOnClick = 1;
569 info.func = TitanPanelQuests_ToggleClickBehavior;
570 info.checked = TitanGetVar(TITAN_QUESTS_ID, "ClickBehavior");
571 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
572  
573 -- toggle grouping
574 info = {};
575 info.text = TITAN_QUESTS_GROUP_BEHAVIOR_TEXT;
576 info.value = "GroupBehavior";
577 info.hasArrow = nil;
578 info.keepShownOnClick = nil;
579 info.func = TitanPanelQuests_ToggleGroupBehavior;
580 info.checked = TitanGetVar(TITAN_QUESTS_ID, "GroupBehavior");
581 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
582  
583 TitanPanelRightClickMenu_AddSpacer(UIDROPDOWNMENU_MENU_LEVEL);
584  
585 -- Toggle icon
586 info = {};
587 info.text = TITAN_PANEL_MENU_SHOW_ICON;
588 info.value = {TITAN_QUESTS_ID, "ShowIcon", nil};
589 info.func = TitanPanelRightClickMenu_ToggleVar;
590 info.checked = TitanGetVar(TITAN_QUESTS_ID, "ShowIcon");
591 info.keepShownOnClick = 1;
592 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
593  
594 -- Toggle Label Text
595 info = {};
596 info.text = TITAN_PANEL_MENU_SHOW_LABEL_TEXT;
597 info.value = {TITAN_QUESTS_ID, "ShowLabelText", nil};
598 info.func = TitanPanelRightClickMenu_ToggleVar;
599 info.checked = TitanGetVar(TITAN_QUESTS_ID, "ShowLabelText");
600 info.keepShownOnClick = 1;
601 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
602  
603 TitanPanelRightClickMenu_AddCommand(TITAN_PANEL_MENU_HIDE,TITAN_QUESTS_ID,TITAN_PANEL_MENU_FUNC_HIDE, UIDROPDOWNMENU_MENU_LEVEL);
604 TitanPanelRightClickMenu_AddSpacer(UIDROPDOWNMENU_MENU_LEVEL);
605  
606 -- info about plugin
607 info = {};
608 info.text = TITAN_QUESTS_ABOUT_TEXT;
609 info.value = "DisplayAbout";
610 info.hasArrow = 1;
611 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
612  
613 else
614 --
615 -- build quest objectives list
616 --
617 local questID = UIDROPDOWNMENU_MENU_VALUE[2];
618 --TitanPanelQuests_ChatPrint("QuestID: "..questID);
619  
620 --local questTitle, questLevel, questTag, questisHeader, questisCollapsed, questisComplete;
621 --local diff, useTag, completeTag;
622 --questTitle, questLevel, questTag, questisHeader, questisCollapsed, questisComplete = GetQuestLogTitle(questID);
623  
624 local questTitle, questLevel = GetQuestLogTitle(questID);
625  
626 local questDescription = "";
627 local questObjectives = "";
628  
629 local numObjectives = 0;
630  
631 local ObjectivesText = "";
632  
633 -- select the quest entry
634 SelectQuestLogEntry(questID);
635 QuestLog_SetSelection(questID);
636  
637 questDescription, questObjectives = GetQuestLogQuestText();
638  
639 numObjectives = GetNumQuestLeaderBoards();
640  
641 info = {};
642 info.value = questTitle;
643 info.text = questTitle;
644 info.isTitle = 1;
645 info.notClickable = 1;
646 info.notCheckable = 1;
647 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
648  
649 if ( numObjectives > 0 ) then
650 for j = 1, numObjectives, 1 do
651 local text;
652 local type;
653 local finished;
654  
655 info = {};
656  
657 text, type, finished = GetQuestLogLeaderBoard(j);
658  
659 if ( finished ) then
660 info.text = TitanUtils_GetRedText(text);
661 else
662 info.text = text;
663 end
664 info.value = text;
665 info.notClickable = 1;
666 --info.isTitle = 0;
667 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
668 end
669 else
670 info = {};
671 if ( strlen(questObjectives) < 65 ) then
672 info.text = TitanUtils_GetHighlightText(questObjectives);
673 else
674 info.text = TitanUtils_GetHighlightText(TITAN_QUESTS_OBJECTIVESTXT_LONG_TEXT);
675 end
676 info.value = "noobjective";
677 info.notClickable = 1;
678 info.func = TitanPanelQuests_DisplayQuest;
679 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
680 end
681  
682 -- spacer
683 info = {};
684 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
685  
686 -- Header for options stuff
687 info = {};
688 info.value = "Quest Options";
689 info.text = TITAN_QUESTS_QUEST_DETAILS_OPTIONS_TEXT;
690 info.isTitle = 1;
691 info.notClickable = 1;
692 info.notCheckable = 1;
693 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
694  
695 -- Add/Remove quest from Quest Tracker
696 if ( IsQuestWatched(questID) ) then
697 info = {};
698 info.text = TITAN_QUESTS_REMOVE_FROM_WATCHER_TEXT;
699 info.value = {TITAN_QUESTS_ID, questID, nil};
700 info.isTitle = nil;
701 info.notClickable = nil;
702 info.notCheckable = nil;
703 info.func = TitanPanelQuests_ToggleWatchStatus;
704 --function ()
705 -- RemoveQuestWatch(questID);
706 -- QuestWatch_Update();
707 --end
708 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
709 else
710 if ( GetNumQuestLeaderBoards(questID) > 0 ) then
711 info.text = TITAN_QUESTS_ADD_TO_WATCHER_TEXT;
712 info.value = {TITAN_QUESTS_ID, questID, nil};
713 info.isTitle = nil;
714 info.notClickable = nil;
715 info.notCheckable = nil;
716 info.disabled = nil;
717 info.func = TitanPanelQuests_ToggleWatchStatus;
718 --function ()
719 -- if ( GetNumQuestWatches() >= MAX_WATCHABLE_QUESTS ) then
720 -- -- Set an error message if trying to show too many quests
721 -- UIErrorsFrame:AddMessage(format(QUEST_WATCH_TOO_MANY, MAX_WATCHABLE_QUESTS), 1.0, 0.1, 0.1, 1.0, UIERRORS_HOLD_TIME);
722 -- else
723 -- AddQuestWatch(questID);
724 -- QuestWatch_Update();
725 -- end
726 --end
727  
728 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
729 end
730 end
731  
732 -- share quest
733 if ( GetQuestLogPushable() ) then
734 info = {};
735 info.value = "ShareQuest";
736 info.text = SHARE_QUEST;
737 info.func = function ()
738 QuestLogPushQuest();
739 end
740 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
741 end
742  
743 -- abandon quest
744 info = {};
745 info.value = "AbandonQuest";
746 info.text = ABANDON_QUEST;
747 info.func = function ()
748 DropDownList1:Hide();
749 SetAbandonQuest();
750 StaticPopup_Show("ABANDON_QUEST", GetAbandonQuestName());
751 end
752 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
753  
754 -- spacer
755 info = {};
756 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
757  
758 -- quest details
759 info = {};
760 --info.value = questID;
761 info.value = {TITAN_QUESTS_ID, questID, nil};
762 info.text = TITAN_QUESTS_QUEST_DETAILS_TEXT;
763 info.func = TitanPanelQuests_DisplayQuest;
764 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
765  
766 -- link quest
767 info = {};
768 info.value = "LinkQuest";
769 info.text = TITAN_QUESTS_LINK_QUEST_TEXT;
770 info.func = function ()
771 ChatFrameEditBox:Insert("["..questLevel.."]"..questTitle.." ");
772 end
773 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
774  
775 end
776 elseif ( UIDROPDOWNMENU_MENU_LEVEL == 3 ) then
777  
778 if ( UIDROPDOWNMENU_MENU_VALUE == "DisplayAbout" ) then
779  
780 local AboutText = TITAN_QUESTS_ABOUT_POPUP_TEXT;
781  
782 info.text = AboutText;
783 info.value = "AboutTextPopUP";
784 info.notClickable = 1;
785 info.isTitle = 0;
786 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
787  
788 elseif ( UIDROPDOWNMENU_MENU_VALUE == "Sort" ) then
789  
790 info = { };
791 info.text = TITAN_QUESTS_SORT_TEXT;
792 info.isTitle = 1;
793 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
794  
795 -- sort by location (default)
796 info = {};
797 info.text = TITAN_QUESTS_SORT_LOCATION_TEXT;
798 info.func = TitanPanelQuests_SortByLocation;
799 info.checked = TitanGetVar(TITAN_QUESTS_ID, "SortByLocation");
800 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
801  
802 -- sort by level
803 info = {};
804 info.text = TITAN_QUESTS_SORT_LEVEL_TEXT;
805 info.func = TitanPanelQuests_SortByLevel;
806 info.checked = TitanGetVar(TITAN_QUESTS_ID, "SortByLevel");
807 --info.checked = 1;
808 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
809  
810 -- sort by title
811 info = {};
812 info.text = TITAN_QUESTS_SORT_TITLE_TEXT;
813 info.func = TitanPanelQuests_SortByTitle;
814 info.checked = TitanGetVar(TITAN_QUESTS_ID, "SortByTitle");
815 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
816  
817 elseif ( UIDROPDOWNMENU_MENU_VALUE == "Show" ) then
818  
819 info = { };
820 info.text = TITAN_QUESTS_SHOW_TEXT;
821 info.isTitle = 1;
822 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
823  
824 -- show just elite
825 info = {};
826 info.text = TITAN_QUESTS_SHOW_ELITE_TEXT;
827 info.func = TitanPanelQuests_ShowElite;
828 info.checked = TitanGetVar(TITAN_QUESTS_ID, "ShowElite");
829 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
830  
831 -- show just dungeon
832 info = {};
833 info.text = TITAN_QUESTS_SHOW_DUNGEON_TEXT;
834 info.func = TitanPanelQuests_ShowDungeon;
835 info.checked = TitanGetVar(TITAN_QUESTS_ID, "ShowDungeon");
836 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
837  
838 -- show just raid
839 info = {};
840 info.text = TITAN_QUESTS_SHOW_RAID_TEXT;
841 info.func = TitanPanelQuests_ShowRaid;
842 info.checked = TitanGetVar(TITAN_QUESTS_ID, "ShowRaid");
843 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
844  
845 -- show just pvp
846 info = {};
847 info.text = TITAN_QUESTS_SHOW_PVP_TEXT;
848 info.func = TitanPanelQuests_ShowPVP;
849 info.checked = TitanGetVar(TITAN_QUESTS_ID, "ShowPVP");
850 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
851  
852 -- show just regular
853 info = {};
854 info.text = TITAN_QUESTS_SHOW_REGULAR_TEXT;
855 info.func = TitanPanelQuests_ShowRegular;
856 info.checked = TitanGetVar(TITAN_QUESTS_ID, "ShowRegular");
857 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
858  
859 -- show just completed
860 info = {};
861 info.text = TITAN_QUESTS_SHOW_COMPLETED_TEXT;
862 info.func = TitanPanelQuests_ShowCompleted;
863 info.checked = TitanGetVar(TITAN_QUESTS_ID, "ShowCompleted");
864 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
865  
866 -- show only incomplete
867 info = {};
868 info.text = TITAN_QUESTS_SHOW_INCOMPLETE_TEXT;
869 info.func = TitanPanelQuests_ShowIncomplete;
870 info.checked = TitanGetVar(TITAN_QUESTS_ID, "ShowIncomplete");
871 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
872  
873 -- show all
874 info = {};
875 info.text = TITAN_QUESTS_SHOW_ALL_TEXT;
876 info.func = TitanPanelQuests_ShowAll;
877 info.checked = TitanGetVar(TITAN_QUESTS_ID, "ShowAll");
878 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
879  
880  
881 elseif ( UIDROPDOWNMENU_MENU_VALUE == "Toggle" ) then
882  
883 info = { };
884 info.text = TITAN_QUESTS_TOGGLE_TEXT;
885 info.isTitle = 1;
886 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
887  
888 -- toggle blizzard's questlog
889 info = {};
890 if ( QuestLogFrame:IsVisible() ) then
891 info.text = TITAN_QUESTS_CLOSE_QUESTLOG_TEXT;
892 else
893 info.text = TITAN_QUESTS_OPEN_QUESTLOG_TEXT;
894 end
895  
896 info.value = "OpenQuestLog";
897 info.func = ToggleQuestLog;
898 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
899  
900 -- toggle MonkeyQuest
901 if ( MonkeyQuestFrame ~= nil ) then
902 info = {};
903 if ( MonkeyQuestFrame:IsVisible() ) then
904 info.text = TITAN_QUESTS_CLOSE_MONKEYQUEST_TEXT;
905 else
906 info.text = TITAN_QUESTS_OPEN_MONKEYQUEST_TEXT;
907 end
908 info.value = "OpenMonkeyQuest";
909 info.func = TitanPanelQuests_ToggleMonkeyQuest;
910 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
911 end
912  
913 -- toggle QuestIon
914 if ( QuestIon_Frame ~= nil ) then
915 info = {};
916 if ( QuestIon_Frame:IsVisible() ) then
917 info.text = TITAN_QUESTS_CLOSE_QUESTION_TEXT;
918 else
919 info.text = TITAN_QUESTS_OPEN_QUESTION_TEXT;
920 end
921 info.value = "OpenQuestIon";
922 info.func = QuestIon_ToggleVisible;
923 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
924 end
925  
926 -- toggle PartyQuests
927 if ( PartyQuestsFrame ~= nil ) then
928 info = {};
929 if ( PartyQuestsFrame:IsVisible() ) then
930 info.text = TITAN_QUESTS_CLOSE_PARTYQUESTS_TEXT;
931 else
932 info.text = TITAN_QUESTS_OPEN_PARTYQUESTS_TEXT;
933 end
934 info.value = "OpenPartyQuests";
935 info.func = TogglePartyQuests;
936 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
937 end
938  
939 -- toggle QuestHistory
940 if ( QuestHistoryFrame ~= nil ) then
941 info = {};
942 if ( QuestHistoryFrame:IsVisible() ) then
943 info.text = TITAN_QUESTS_CLOSE_QUESTHISTORY_TEXT;
944 else
945 info.text = TITAN_QUESTS_OPEN_QUESTHISTORY_TEXT;
946 end
947 info.value = "OpenQuestHistory";
948 info.func = QuestHistory_Toggle;
949 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
950 end
951  
952 -- toggle QuestBank
953 if (QuestBankFrame ~= nil ) then
954 info = {};
955 if ( QuestBankFrame:IsVisible() ) then
956 info.text = TITAN_QUESTS_CLOSE_QUESTBANK_TEXT;
957 else
958 info.text = TITAN_QUESTS_OPEN_QUESTHISTORY_TEXT;
959 end
960 info.value = "OpenQuestBank";
961 info.func = QuestBank_Toggle;
962 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
963 end
964 -- end toggles
965 end
966 end
967 end
968  
969 --
970 -- Click on a Quest entry
971 --
972 function TitanPanelQuests_ClickQuest()
973 if ( (TitanGetVar(TITAN_QUESTS_ID, "ClickBehavior") and not IsShiftKeyDown()) or (not TitanGetVar(TITAN_QUESTS_ID, "ClickBehavior") and IsShiftKeyDown()) ) then
974 TitanPanelQuests_ToggleWatchStatus()
975 else
976 TitanPanelQuests_DisplayQuest();
977 this:GetParent():Hide();
978 end
979 end
980  
981 --
982 -- Toggle Watch Status
983 --
984 function TitanPanelQuests_ToggleWatchStatus()
985 local questID;
986 local button;
987  
988 -- Get current Quest selected
989 questID = this.value[2];
990  
991 -- Get the quest button
992 for i=1, UIDROPDOWNMENU_MAXBUTTONS, 1 do
993 button = getglobal("DropDownList1Button"..i);
994 if ( type(button.value) == type(this.value) ) then
995 if ( button.value[2] and this.value[2] == button.value[2] ) then
996 break;
997 else
998 button = nil;
999 end
1000 else
1001 button = nil;
1002 end
1003 end
1004  
1005 -- Add/Remove quest from Quest Tracker
1006 if ( IsQuestWatched(questID) ) then
1007 -- Update Quest Tracker
1008 RemoveQuestWatch(questID);
1009 QuestWatch_Update();
1010 TitanPanelQuests_UpdateSettings();
1011 -- Toggle Status
1012 TitanPanelRightClickMenu_ToggleVar(TITAN_QUESTS_ID, questID);
1013 -- Update watcher tag.
1014 button:SetText(TitanPanelQuests_GetQuestText(questID));
1015 -- Update the secondary pane
1016 getglobal("DropDownList2"):Hide();
1017 if ( this:GetParent():GetName() == "DropDownList2" ) then
1018 button.checked = nil;
1019 getglobal(button:GetName().."Check"):Hide();
1020 UIDropDownMenu_Refresh();
1021 end
1022 else
1023 if (TitanPanelQuests_IsWatchAllowed(questID)) then
1024 -- Update Quest Tracker
1025 AddQuestWatch(questID);
1026 QuestWatch_Update();
1027 TitanPanelQuests_UpdateSettings();
1028 -- Toggle Status
1029 TitanPanelRightClickMenu_ToggleVar(TITAN_QUESTS_ID, questID);
1030 -- Update watcher tag.
1031 button:SetText(TitanPanelQuests_GetQuestText(questID));
1032 -- Update the secondary pane
1033 getglobal("DropDownList2"):Hide();
1034 if ( this:GetParent():GetName() == "DropDownList2" ) then
1035 button.checked = 1;
1036 getglobal(button:GetName().."Check"):Show();
1037 UIDropDownMenu_Refresh();
1038 end
1039 else
1040 -- Prevent checkmark from showing up... pretty counter-intuitive, we need to set this to checked
1041 -- so that the later code in UIDropDownMenu.lua will uncheck it again. - Ryessa
1042 if ( this:GetParent():GetName() == "DropDownList1" ) then
1043 button.checked = 1;
1044 else
1045 button.checked = nil;
1046 getglobal(button:GetName().."Check"):Hide();
1047 this:GetParent():Hide();
1048 UIDropDownMenu_Refresh();
1049 end;
1050 end
1051 end
1052 end
1053  
1054 --
1055 -- SortBy toggle functions
1056 --
1057 function TitanPanelQuests_SortByLevel()
1058 if ( TitanGetVar(TITAN_QUESTS_ID, "SortByLevel") ) then
1059 TitanSetVar(TITAN_QUESTS_ID, "SortByLevel", nil);
1060 TitanSetVar(TITAN_QUESTS_ID, "SortByLocation", 1);
1061 TitanSetVar(TITAN_QUESTS_ID, "SortByTitle", nil);
1062 else
1063 TitanSetVar(TITAN_QUESTS_ID, "SortByLevel", 1);
1064 TitanSetVar(TITAN_QUESTS_ID, "SortByLocation", nil);
1065 TitanSetVar(TITAN_QUESTS_ID, "SortByTitle", nil);
1066 end
1067 DropDownList1:Hide();
1068 end
1069  
1070 function TitanPanelQuests_SortByLocation()
1071 TitanSetVar(TITAN_QUESTS_ID, "SortByLevel", nil);
1072 TitanSetVar(TITAN_QUESTS_ID, "SortByLocation", 1);
1073 TitanSetVar(TITAN_QUESTS_ID, "SortByTitle", nil);
1074 TitanPanelButton_UpdateButton(TITAN_QUESTS_ID)
1075 DropDownList1:Hide();
1076 end
1077  
1078 function TitanPanelQuests_SortByTitle()
1079 if ( TitanGetVar(TITAN_QUESTS_ID, "SortByTitle") ) then
1080 TitanSetVar(TITAN_QUESTS_ID, "SortByLevel", nil);
1081 TitanSetVar(TITAN_QUESTS_ID, "SortByLocation", 1);
1082 TitanSetVar(TITAN_QUESTS_ID, "SortByTitle", nil);
1083 else
1084 TitanSetVar(TITAN_QUESTS_ID, "SortByLevel", nil);
1085 TitanSetVar(TITAN_QUESTS_ID, "SortByLocation", nil);
1086 TitanSetVar(TITAN_QUESTS_ID, "SortByTitle", 1);
1087 end
1088 DropDownList1:Hide();
1089 end
1090  
1091 --
1092 -- Show toggle functions
1093 --
1094 function TitanPanelQuests_ShowElite()
1095 if ( TitanGetVar(TITAN_QUESTS_ID, "ShowElite") ) then
1096 TitanSetVar(TITAN_QUESTS_ID, "ShowElite", nil);
1097 TitanSetVar(TITAN_QUESTS_ID, "ShowAll", 1);
1098 else
1099 TitanSetVar(TITAN_QUESTS_ID, "ShowElite", 1);
1100 TitanSetVar(TITAN_QUESTS_ID, "ShowDungeon", nil);
1101 TitanSetVar(TITAN_QUESTS_ID, "ShowRaid", nil);
1102 TitanSetVar(TITAN_QUESTS_ID, "ShowPVP", nil);
1103 TitanSetVar(TITAN_QUESTS_ID, "ShowRegular", nil);
1104 TitanSetVar(TITAN_QUESTS_ID, "ShowCompleted", nil);
1105 TitanSetVar(TITAN_QUESTS_ID, "ShowIncomplete", nil);
1106 TitanSetVar(TITAN_QUESTS_ID, "ShowAll", nil);
1107 end
1108 DropDownList1:Hide();
1109 end
1110  
1111 function TitanPanelQuests_ShowDungeon()
1112 if ( TitanGetVar(TITAN_QUESTS_ID, "ShowDungeon") ) then
1113 TitanSetVar(TITAN_QUESTS_ID, "ShowDungeon", nil);
1114 TitanSetVar(TITAN_QUESTS_ID, "ShowAll", 1);
1115 else
1116 TitanSetVar(TITAN_QUESTS_ID, "ShowDungeon", 1);
1117 TitanSetVar(TITAN_QUESTS_ID, "ShowElite", nil);
1118 TitanSetVar(TITAN_QUESTS_ID, "ShowRaid", nil);
1119 TitanSetVar(TITAN_QUESTS_ID, "ShowPVP", nil);
1120 TitanSetVar(TITAN_QUESTS_ID, "ShowRegular", nil);
1121 TitanSetVar(TITAN_QUESTS_ID, "ShowCompleted", nil);
1122 TitanSetVar(TITAN_QUESTS_ID, "ShowIncomplete", nil);
1123 TitanSetVar(TITAN_QUESTS_ID, "ShowAll", nil);
1124 end
1125 DropDownList1:Hide();
1126 end
1127  
1128 function TitanPanelQuests_ShowRaid()
1129 if ( TitanGetVar(TITAN_QUESTS_ID, "ShowRaid") ) then
1130 TitanSetVar(TITAN_QUESTS_ID, "ShowRaid", nil);
1131 TitanSetVar(TITAN_QUESTS_ID, "ShowAll", 1);
1132 else
1133 TitanSetVar(TITAN_QUESTS_ID, "ShowRaid", 1);
1134 TitanSetVar(TITAN_QUESTS_ID, "ShowElite", nil);
1135 TitanSetVar(TITAN_QUESTS_ID, "ShowDungeon", nil);
1136 TitanSetVar(TITAN_QUESTS_ID, "ShowPVP", nil);
1137 TitanSetVar(TITAN_QUESTS_ID, "ShowRegular", nil);
1138 TitanSetVar(TITAN_QUESTS_ID, "ShowCompleted", nil);
1139 TitanSetVar(TITAN_QUESTS_ID, "ShowIncomplete", nil);
1140 TitanSetVar(TITAN_QUESTS_ID, "ShowAll", nil);
1141 end
1142 DropDownList1:Hide();
1143 end
1144  
1145 function TitanPanelQuests_ShowPVP()
1146 if ( TitanGetVar(TITAN_QUESTS_ID, "ShowPVP") ) then
1147 TitanSetVar(TITAN_QUESTS_ID, "ShowPVP", nil);
1148 TitanSetVar(TITAN_QUESTS_ID, "ShowAll", 1);
1149 else
1150 TitanSetVar(TITAN_QUESTS_ID, "ShowPVP", 1);
1151 TitanSetVar(TITAN_QUESTS_ID, "ShowElite", nil);
1152 TitanSetVar(TITAN_QUESTS_ID, "ShowDungeon", nil);
1153 TitanSetVar(TITAN_QUESTS_ID, "ShowRaid", nil);
1154 TitanSetVar(TITAN_QUESTS_ID, "ShowRegular", nil);
1155 TitanSetVar(TITAN_QUESTS_ID, "ShowCompleted", nil);
1156 TitanSetVar(TITAN_QUESTS_ID, "ShowIncomplete", nil);
1157 TitanSetVar(TITAN_QUESTS_ID, "ShowAll", nil);
1158 end
1159 DropDownList1:Hide();
1160 end
1161  
1162 function TitanPanelQuests_ShowRegular()
1163 if ( TitanGetVar(TITAN_QUESTS_ID, "ShowRegular") ) then
1164 TitanSetVar(TITAN_QUESTS_ID, "ShowRegular", nil);
1165 TitanSetVar(TITAN_QUESTS_ID, "ShowAll", 1);
1166 else
1167 TitanSetVar(TITAN_QUESTS_ID, "ShowRegular", 1);
1168 TitanSetVar(TITAN_QUESTS_ID, "ShowElite", nil);
1169 TitanSetVar(TITAN_QUESTS_ID, "ShowDungeon", nil);
1170 TitanSetVar(TITAN_QUESTS_ID, "ShowRaid", nil);
1171 TitanSetVar(TITAN_QUESTS_ID, "ShowPVP", nil);
1172 TitanSetVar(TITAN_QUESTS_ID, "ShowCompleted", nil);
1173 TitanSetVar(TITAN_QUESTS_ID, "ShowIncomplete", nil);
1174 TitanSetVar(TITAN_QUESTS_ID, "ShowAll", nil);
1175 end
1176 DropDownList1:Hide();
1177 end
1178  
1179 function TitanPanelQuests_ShowCompleted()
1180 if ( TitanGetVar(TITAN_QUESTS_ID, "ShowCompleted") ) then
1181 TitanSetVar(TITAN_QUESTS_ID, "ShowCompleted", nil);
1182 TitanSetVar(TITAN_QUESTS_ID, "ShowAll", 1);
1183 else
1184 TitanSetVar(TITAN_QUESTS_ID, "ShowCompleted", 1);
1185 TitanSetVar(TITAN_QUESTS_ID, "ShowIncomplete", nil);
1186 TitanSetVar(TITAN_QUESTS_ID, "ShowElite", nil);
1187 TitanSetVar(TITAN_QUESTS_ID, "ShowDungeon", nil);
1188 TitanSetVar(TITAN_QUESTS_ID, "ShowRaid", nil);
1189 TitanSetVar(TITAN_QUESTS_ID, "ShowPVP", nil);
1190 TitanSetVar(TITAN_QUESTS_ID, "ShowRegular", nil);
1191 TitanSetVar(TITAN_QUESTS_ID, "ShowAll", nil);
1192 end
1193 DropDownList1:Hide();
1194 end
1195  
1196 function TitanPanelQuests_ShowIncomplete()
1197 if ( TitanGetVar(TITAN_QUESTS_ID, "ShowIncomplete") ) then
1198 TitanSetVar(TITAN_QUESTS_ID, "ShowIncomplete", nil);
1199 TitanSetVar(TITAN_QUESTS_ID, "ShowAll", 1);
1200 else
1201 TitanSetVar(TITAN_QUESTS_ID, "ShowIncomplete", 1);
1202 TitanSetVar(TITAN_QUESTS_ID, "ShowCompleted", nil);
1203 TitanSetVar(TITAN_QUESTS_ID, "ShowElite", nil);
1204 TitanSetVar(TITAN_QUESTS_ID, "ShowDungeon", nil);
1205 TitanSetVar(TITAN_QUESTS_ID, "ShowRaid", nil);
1206 TitanSetVar(TITAN_QUESTS_ID, "ShowPVP", nil);
1207 TitanSetVar(TITAN_QUESTS_ID, "ShowRegular", nil);
1208 TitanSetVar(TITAN_QUESTS_ID, "ShowAll", nil);
1209 end
1210 DropDownList1:Hide();
1211 end
1212  
1213 function TitanPanelQuests_ShowAll()
1214 TitanSetVar(TITAN_QUESTS_ID, "ShowAll", 1);
1215 TitanSetVar(TITAN_QUESTS_ID, "ShowElite", nil);
1216 TitanSetVar(TITAN_QUESTS_ID, "ShowDungeon", nil);
1217 TitanSetVar(TITAN_QUESTS_ID, "ShowRaid", nil);
1218 TitanSetVar(TITAN_QUESTS_ID, "ShowPVP", nil);
1219 TitanSetVar(TITAN_QUESTS_ID, "ShowRegular", nil);
1220 TitanSetVar(TITAN_QUESTS_ID, "ShowCompleted", nil);
1221 TitanSetVar(TITAN_QUESTS_ID, "ShowIncomplete", nil);
1222 DropDownList1:Hide();
1223 end
1224  
1225 --
1226 -- Click Behavior toggle function
1227 --
1228 function TitanPanelQuests_ToggleClickBehavior()
1229 TitanToggleVar(TITAN_QUESTS_ID, "ClickBehavior");
1230 end
1231  
1232 --
1233 -- Group Behavior toggle function
1234 --
1235 function TitanPanelQuests_ToggleGroupBehavior()
1236 TitanToggleVar(TITAN_QUESTS_ID, "GroupBehavior");
1237 TitanPanelRightClickMenu_Close();
1238 end
1239  
1240 --
1241 -- toggle quest details window
1242 --
1243 function TitanQuests_DetailsShowHide()
1244 if ( TitanQuests_Details:IsVisible() ) then
1245 TitanQuests_Details:Hide();
1246 else
1247 TitanQuests_Details:Show();
1248 TitanQuests_Details_Update();
1249 TitanPanelQuests_DisplayQuest();
1250 end
1251 end
1252  
1253 --
1254 -- toggle MonkeyQuest
1255 --
1256 function TitanPanelQuests_ToggleMonkeyQuest()
1257 if ( MonkeyQuestFrame:IsVisible() ) then
1258 HideUIPanel(MonkeyQuestFrame);
1259 else
1260 ShowUIPanel(MonkeyQuestFrame);
1261 end
1262 end