vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 SLASH_EXTENDEDQUESTLOG1 = "/eql";
2  
3 function EQL_Options_OnLoad()
4 SlashCmdList["EXTENDEDQUESTLOG"] = function(msg)
5 EQL3_SlashCmd(msg);
6 end
7 this:RegisterEvent("VARIABLES_LOADED");
8 this:RegisterEvent("QUEST_LOG_UPDATE");
9 end
10  
11 -- Let's see how of theese are needed
12 old_GetNumQuestLogEntries = GetNumQuestLogEntries;
13 -- local existingGetQuestLogTitle = GetQuestLogTitle;
14 old_SelectQuestLogEntry = SelectQuestLogEntry;
15 old_GetQuestLogSelection = GetQuestLogSelection;
16 old_ExpandQuestHeader = ExpandQuestHeader;
17 old_CollapseQuestHeader = CollapseQuestHeader;
18 old_IsUnitOnQuest = IsUnitOnQuest;
19 -- local existingIsQuestWatched = IsQuestWatched;
20 -- local existingAddQuestWatch = AddQuestWatch;
21 -- local existingRemoveQuestWatch = RemoveQuestWatch;
22 -- local existingGetQuestIndexForWatch = GetQuestIndexForWatch;
23 old_GetNumQuestLeaderBoards = GetNumQuestLeaderBoards;
24 old_GetQuestLogLeaderBoard = GetQuestLogLeaderBoard;
25  
26 function EQL_Options_OnEvent(event)
27 -- Only for organizer...
28 if ( event == "QUEST_LOG_UPDATE" ) then
29 if(not EQL3_Temp.GotQuestLogUpdate) then
30 EQL3_Temp.GotQuestLogUpdate = 1;
31 EQL3_RefreshOtherQuestDisplays();
32 return;
33 end
34 EQL3_UpdateDB();
35 end
36  
37 if (event == "VARIABLES_LOADED") then
38  
39 EQL_Options_SetStates();
40  
41 end
42 end
43  
44  
45  
46 function EQL_Options_SetStates()
47 if(QuestlogOptions[EQL3_Player].ShowQuestLevels == 1) then
48 EQL3_OptionsFrame_Checkbox_ShowQuestLevels:SetChecked(1);
49 EQL3_OptionsFrame_Checkbox_QuestLevelsOnlyInLog:Enable();
50 else
51 EQL3_OptionsFrame_Checkbox_ShowQuestLevels:SetChecked(0);
52 EQL3_OptionsFrame_Checkbox_QuestLevelsOnlyInLog:Disable();
53 end
54  
55 if(QuestlogOptions[EQL3_Player].RestoreUponSelect == 1) then
56 EQL3_OptionsFrame_Checkbox_RestoreUponSelect:SetChecked(1);
57 else
58 EQL3_OptionsFrame_Checkbox_RestoreUponSelect:SetChecked(0);
59 end
60  
61 if(QuestlogOptions[EQL3_Player].MinimizeUponClose == 1) then
62 EQL3_OptionsFrame_Checkbox_MinimizeUponClose:SetChecked(1);
63 else
64 EQL3_OptionsFrame_Checkbox_MinimizeUponClose:SetChecked(0);
65 end
66  
67 if(QuestlogOptions[EQL3_Player].CustomZoneColor == 1) then
68 EQL3_OptionsFrame_Checkbox_CustomZoneColor:SetChecked(1);
69 else
70 EQL3_OptionsFrame_Checkbox_CustomZoneColor:SetChecked(0);
71 end
72  
73 if(QuestlogOptions[EQL3_Player].CustomHeaderColor == 1) then
74 EQL3_OptionsFrame_Checkbox_CustomHeaderColor:SetChecked(1);
75 else
76 EQL3_OptionsFrame_Checkbox_CustomHeaderColor:SetChecked(0);
77 end
78  
79 if(QuestlogOptions[EQL3_Player].CustomObjetiveColor == 1) then
80 EQL3_OptionsFrame_Checkbox_CustomObjectiveColor:SetChecked(1);
81 else
82 EQL3_OptionsFrame_Checkbox_CustomObjectiveColor:SetChecked(0);
83 end
84  
85 if(QuestlogOptions[EQL3_Player].FadeHeaderColor == 1) then
86 EQL3_OptionsFrame_Checkbox_FadeHeaderColor:SetChecked(1);
87 else
88 EQL3_OptionsFrame_Checkbox_FadeHeaderColor:SetChecked(0);
89 end
90  
91 if(QuestlogOptions[EQL3_Player].FadeObjectiveColor == 1) then
92 EQL3_OptionsFrame_Checkbox_FadeObjectiveColor:SetChecked(1);
93 else
94 EQL3_OptionsFrame_Checkbox_FadeObjectiveColor:SetChecked(0);
95 end
96  
97 if(QuestlogOptions[EQL3_Player].CustomTrackerBGColor == 1) then
98 EQL3_OptionsFrame_Checkbox_CustomTrackerBGColor:SetChecked(1);
99 else
100 EQL3_OptionsFrame_Checkbox_CustomTrackerBGColor:SetChecked(0);
101 end
102  
103 if ( QuestlogOptions[EQL3_Player].ShowObjectiveMarkers == 1) then
104 EQL3_OptionsFrame_Checkbox_ShowObjectiveMarkers:SetChecked(1);
105 EQL3_OptionsFrame_Checkbox_UseTrackerListing:Enable();
106 if(QuestlogOptions[EQL3_Player].UseTrackerListing == 1) then
107 EQL3_OptionsFrame_Checkbox_Symbol1:Disable();
108 EQL3_OptionsFrame_Checkbox_Symbol2:Disable();
109 EQL3_OptionsFrame_Checkbox_Symbol3:Disable();
110 EQL3_OptionsFrame_Checkbox_Symbol4:Disable();
111 EQL3_OptionsFrame_Checkbox_List1:Enable();
112 EQL3_OptionsFrame_Checkbox_List2:Enable();
113 EQL3_OptionsFrame_Checkbox_List3:Enable();
114 EQL3_OptionsFrame_Checkbox_List4:Enable();
115 else
116 EQL3_OptionsFrame_Checkbox_List1:Disable();
117 EQL3_OptionsFrame_Checkbox_List2:Disable();
118 EQL3_OptionsFrame_Checkbox_List3:Disable();
119 EQL3_OptionsFrame_Checkbox_List4:Disable();
120 EQL3_OptionsFrame_Checkbox_Symbol1:Enable();
121 EQL3_OptionsFrame_Checkbox_Symbol2:Enable();
122 EQL3_OptionsFrame_Checkbox_Symbol3:Enable();
123 EQL3_OptionsFrame_Checkbox_Symbol4:Enable();
124 end
125 else
126 EQL3_OptionsFrame_Checkbox_ShowObjectiveMarkers:SetChecked(0);
127 EQL3_OptionsFrame_Checkbox_UseTrackerListing:Disable();
128 EQL3_OptionsFrame_Checkbox_List1:Disable();
129 EQL3_OptionsFrame_Checkbox_List2:Disable();
130 EQL3_OptionsFrame_Checkbox_List3:Disable();
131 EQL3_OptionsFrame_Checkbox_List4:Disable();
132 EQL3_OptionsFrame_Checkbox_Symbol1:Disable();
133 EQL3_OptionsFrame_Checkbox_Symbol2:Disable();
134 EQL3_OptionsFrame_Checkbox_Symbol3:Disable();
135 EQL3_OptionsFrame_Checkbox_Symbol4:Disable();
136 end
137  
138 if(QuestlogOptions[EQL3_Player].UseTrackerListing == 1) then
139 EQL3_OptionsFrame_Checkbox_UseTrackerListing:SetChecked(1);
140 else
141 EQL3_OptionsFrame_Checkbox_UseTrackerListing:SetChecked(0);
142 end
143  
144 EQL3_OptionsFrame_Checkbox_List1:SetChecked(0);
145 EQL3_OptionsFrame_Checkbox_List2:SetChecked(0);
146 EQL3_OptionsFrame_Checkbox_List3:SetChecked(0);
147 EQL3_OptionsFrame_Checkbox_List4:SetChecked(0);
148 EQL3_OptionsFrame_Checkbox_Symbol1:SetChecked(0);
149 EQL3_OptionsFrame_Checkbox_Symbol2:SetChecked(0);
150 EQL3_OptionsFrame_Checkbox_Symbol3:SetChecked(0);
151 EQL3_OptionsFrame_Checkbox_Symbol4:SetChecked(0);
152  
153 getglobal("EQL3_OptionsFrame_Checkbox_List"..(QuestlogOptions[EQL3_Player].TrackerList+1)):SetChecked(1);
154 getglobal("EQL3_OptionsFrame_Checkbox_Symbol"..(QuestlogOptions[EQL3_Player].TrackerSymbol+1)):SetChecked(1);
155  
156  
157 EQL3_OptionsFrame_Checkbox_ShowZones:SetChecked(0);
158 EQL3_OptionsFrame_Checkbox_SortTracker:Enable();
159 EQL3_OptionsFrame_Checkbox_SortTracker:SetChecked(0);
160  
161 if(QuestlogOptions[EQL3_Player].ShowZonesInTracker == 1) then
162 EQL3_OptionsFrame_Checkbox_ShowZones:SetChecked(1);
163 EQL3_OptionsFrame_Checkbox_SortTracker:Disable();
164 EQL3_OptionsFrame_Checkbox_SortTracker:SetChecked(1);
165 end
166  
167 if(QuestlogOptions[EQL3_Player].SortTrackerItems == 1) then
168 EQL3_OptionsFrame_Checkbox_SortTracker:SetChecked(1);
169 end
170  
171 if(QuestlogOptions[EQL3_Player].Color["TrackerBG"]) then
172 EQL3_OptionsFrame_ColorSwatch_TrackerBGNormalTexture:SetVertexColor( QuestlogOptions[EQL3_Player].Color["TrackerBG"].r,
173 QuestlogOptions[EQL3_Player].Color["TrackerBG"].g,
174 QuestlogOptions[EQL3_Player].Color["TrackerBG"].b );
175 end
176  
177 if(QuestlogOptions[EQL3_Player].Color["Zone"]) then
178 EQL3_OptionsFrame_ColorSwatch_ZoneNormalTexture:SetVertexColor( QuestlogOptions[EQL3_Player].Color["Zone"].r,
179 QuestlogOptions[EQL3_Player].Color["Zone"].g,
180 QuestlogOptions[EQL3_Player].Color["Zone"].b );
181 end
182  
183 if(QuestlogOptions[EQL3_Player].Color["HeaderEmpty"]) then
184 EQL3_OptionsFrame_ColorSwatch_Header_EmptyNormalTexture:SetVertexColor( QuestlogOptions[EQL3_Player].Color["HeaderEmpty"].r,
185 QuestlogOptions[EQL3_Player].Color["HeaderEmpty"].g,
186 QuestlogOptions[EQL3_Player].Color["HeaderEmpty"].b );
187 end
188  
189 if(QuestlogOptions[EQL3_Player].Color["HeaderComplete"]) then
190 EQL3_OptionsFrame_ColorSwatch_Header_CompleteNormalTexture:SetVertexColor( QuestlogOptions[EQL3_Player].Color["HeaderComplete"].r,
191 QuestlogOptions[EQL3_Player].Color["HeaderComplete"].g,
192 QuestlogOptions[EQL3_Player].Color["HeaderComplete"].b );
193 end
194  
195 if(QuestlogOptions[EQL3_Player].Color["ObjectiveEmpty"]) then
196 EQL3_OptionsFrame_ColorSwatch_Objective_EmptyNormalTexture:SetVertexColor( QuestlogOptions[EQL3_Player].Color["ObjectiveEmpty"].r,
197 QuestlogOptions[EQL3_Player].Color["ObjectiveEmpty"].g,
198 QuestlogOptions[EQL3_Player].Color["ObjectiveEmpty"].b );
199 end
200  
201 if(QuestlogOptions[EQL3_Player].Color["ObjectiveComplete"]) then
202 EQL3_OptionsFrame_ColorSwatch_Objective_CompleteNormalTexture:SetVertexColor( QuestlogOptions[EQL3_Player].Color["ObjectiveComplete"].r,
203 QuestlogOptions[EQL3_Player].Color["ObjectiveComplete"].g,
204 QuestlogOptions[EQL3_Player].Color["ObjectiveComplete"].b );
205 end
206  
207 if(QuestlogOptions[EQL3_Player].Color["Tooltip"]) then
208 EQL3_OptionsFrame_ColorSwatch_TooltipInfoNormalTexture:SetVertexColor( QuestlogOptions[EQL3_Player].Color["Tooltip"].r,
209 QuestlogOptions[EQL3_Player].Color["Tooltip"].g,
210 QuestlogOptions[EQL3_Player].Color["Tooltip"].b );
211 end
212  
213  
214  
215 if(QuestlogOptions[EQL3_Player].LockTracker == 1) then
216 EQL3_OptionsFrame_Checkbox_LockTracker:SetChecked(1);
217 else
218 EQL3_OptionsFrame_Checkbox_LockTracker:SetChecked(0);
219 end
220  
221 if(QuestlogOptions[EQL3_Player].AddNew == 1) then
222 EQL3_OptionsFrame_Checkbox_AddNew:SetChecked(1);
223 else
224 EQL3_OptionsFrame_Checkbox_AddNew:SetChecked(0);
225 end
226  
227 EQL3_OptionsFrame_Checkbox_RemoveFinished:SetChecked(0);
228 EQL3_OptionsFrame_Checkbox_MinimizeFinished:Enable();
229 EQL3_OptionsFrame_Checkbox_MinimizeFinished:SetChecked(0);
230  
231 if(QuestlogOptions[EQL3_Player].RemoveFinished == 1) then
232 EQL3_OptionsFrame_Checkbox_RemoveFinished:SetChecked(1);
233 EQL3_OptionsFrame_Checkbox_MinimizeFinished:Disable();
234 end
235  
236 if(QuestlogOptions[EQL3_Player].MinimizeFinished == 1) then
237 EQL3_OptionsFrame_Checkbox_MinimizeFinished:SetChecked(1);
238 end
239  
240 if(QuestlogOptions[EQL3_Player].AddUntracked == 1) then
241 EQL3_OptionsFrame_Checkbox_AddUntracked:SetChecked(1);
242 else
243 EQL3_OptionsFrame_Checkbox_AddUntracked:SetChecked(0);
244 end
245  
246 if(QuestlogOptions[EQL3_Player].LockQuestLog == 1) then
247 EQL3_OptionsFrame_Checkbox_LockQuestLog:SetChecked(1);
248 else
249 EQL3_OptionsFrame_Checkbox_LockQuestLog:SetChecked(0);
250 end
251  
252 if(QuestlogOptions[EQL3_Player].TrackerShowMinimizer == 1) then
253 EQL3_OptionsFrame_Checkbox_ShowMinimizer:SetChecked(1);
254 EQL3_Tracker_MinimizeButton:Show();
255 else
256 EQL3_OptionsFrame_Checkbox_ShowMinimizer:SetChecked(0);
257 EQL3_Tracker_MinimizeButton:Hide();
258 QuestlogOptions[EQL3_Player].TrackerIsMinimized = 0;
259 end
260  
261 -- new to 3.5.6
262  
263 if(QuestlogOptions[EQL3_Player].AutoCompleteQuests == 1) then
264 EQL3_OptionsFrame_Checkbox_AutoCompleteQuests:SetChecked(1);
265 else
266 EQL3_OptionsFrame_Checkbox_AutoCompleteQuests:SetChecked(0);
267 end
268  
269 if(QuestlogOptions[EQL3_Player].OnlyLevelsInLog == 1) then
270 EQL3_OptionsFrame_Checkbox_QuestLevelsOnlyInLog:SetChecked(1);
271 else
272 EQL3_OptionsFrame_Checkbox_QuestLevelsOnlyInLog:SetChecked(0);
273 end
274  
275 if(QuestlogOptions[EQL3_Player].RemoveCompletedObjectives == 1) then
276 EQL3_OptionsFrame_Checkbox_HideCompletedObjectives:SetChecked(1);
277 else
278 EQL3_OptionsFrame_Checkbox_HideCompletedObjectives:SetChecked(0);
279 end
280  
281 -- new to 3.5.9
282  
283 if(QuestlogOptions[EQL3_Player].ItemTooltip == 1) then
284 EQL3_OptionsFrame_Checkbox_ShowItemTooltip:SetChecked(1);
285 else
286 EQL3_OptionsFrame_Checkbox_ShowItemTooltip:SetChecked(0);
287 end
288  
289 if(QuestlogOptions[EQL3_Player].MobTooltip == 1) then
290 EQL3_OptionsFrame_Checkbox_ShowMobTooltip:SetChecked(1);
291 else
292 EQL3_OptionsFrame_Checkbox_ShowMobTooltip:SetChecked(0);
293 end
294  
295 if(QuestlogOptions[EQL3_Player].InfoOnQuestCompletion == 1) then
296 EQL3_OptionsFrame_Checkbox_InfoOnQuestComplete:SetChecked(1);
297 else
298 EQL3_OptionsFrame_Checkbox_InfoOnQuestComplete:SetChecked(0);
299 end
300  
301 if(QuestlogOptions[EQL3_Player].CustomTooltipColor == 1) then
302 EQL3_OptionsFrame_Checkbox_CustomTooltipInfoColor:SetChecked(1);
303 else
304 EQL3_OptionsFrame_Checkbox_CustomTooltipInfoColor:SetChecked(0);
305 end
306 end
307  
308  
309  
310  
311 function EQL3_Toggle_QuestLevels()
312 if (this:GetChecked() == 1) then
313 QuestlogOptions[EQL3_Player].ShowQuestLevels = 1;
314 EQL3_OptionsFrame_Checkbox_QuestLevelsOnlyInLog:Enable();
315 else
316 QuestlogOptions[EQL3_Player].ShowQuestLevels = 0;
317 EQL3_OptionsFrame_Checkbox_QuestLevelsOnlyInLog:Disable();
318 end
319  
320 QuestLog_Update();
321 QuestWatch_Update();
322 end
323  
324 function EQL3_Toggle_RestoreUponSelect()
325 if (this:GetChecked() == 1) then
326 QuestlogOptions[EQL3_Player].RestoreUponSelect = 1;
327 else
328 QuestlogOptions[EQL3_Player].RestoreUponSelect = 0;
329 end
330 end
331  
332 function EQL3_Toggle_MinimizeUponClose()
333 if (this:GetChecked() == 1) then
334 QuestlogOptions[EQL3_Player].MinimizeUponClose = 1;
335 else
336 QuestlogOptions[EQL3_Player].MinimizeUponClose = 0;
337 end
338 end
339  
340 function EQL3_Toggle_CustomZoneColor()
341 if (this:GetChecked() == 1) then
342 QuestlogOptions[EQL3_Player].CustomZoneColor = 1;
343 else
344 QuestlogOptions[EQL3_Player].CustomZoneColor = 0;
345 end
346 QuestWatch_Update();
347 end
348  
349 function EQL3_Toggle_CustomHeaderColor()
350 if (this:GetChecked() == 1) then
351 QuestlogOptions[EQL3_Player].CustomHeaderColor = 1;
352 else
353 QuestlogOptions[EQL3_Player].CustomHeaderColor = 0;
354 end
355 QuestWatch_Update();
356 end
357  
358 function EQL3_Toggle_CustomObjectiveColor()
359 if (this:GetChecked() == 1) then
360 QuestlogOptions[EQL3_Player].CustomObjetiveColor = 1;
361 else
362 QuestlogOptions[EQL3_Player].CustomObjetiveColor = 0;
363 end
364 QuestWatch_Update();
365 end
366  
367  
368 function EQL3_Toggle_FadeHeaderColor()
369 if (this:GetChecked() == 1) then
370 QuestlogOptions[EQL3_Player].FadeHeaderColor = 1;
371 else
372 QuestlogOptions[EQL3_Player].FadeHeaderColor = 0;
373 end
374 QuestWatch_Update();
375 end
376  
377 function EQL3_Toggle_FadeObjectiveColor()
378 if (this:GetChecked() == 1) then
379 QuestlogOptions[EQL3_Player].FadeObjectiveColor = 1;
380 else
381 QuestlogOptions[EQL3_Player].FadeObjectiveColor = 0;
382 end
383 QuestWatch_Update();
384 end
385  
386 function EQL3_Toggle_CustomTrackerBGColor()
387 if (this:GetChecked() == 1) then
388 QuestlogOptions[EQL3_Player].CustomTrackerBGColor = 1;
389 else
390 QuestlogOptions[EQL3_Player].CustomTrackerBGColor = 0;
391 end
392 TrackerBackground_Update();
393 end
394  
395 --new to 3.5.6
396  
397 function EQL3_Toggle_ShowObjectiveMarkers()
398 if (this:GetChecked() == 1) then
399 QuestlogOptions[EQL3_Player].ShowObjectiveMarkers = 1;
400 EQL3_OptionsFrame_Checkbox_UseTrackerListing:Enable();
401 EQL3_Toggle_UseTrackerListing();
402 else
403 QuestlogOptions[EQL3_Player].ShowObjectiveMarkers = 0;
404 EQL3_OptionsFrame_Checkbox_UseTrackerListing:Disable();
405 EQL3_OptionsFrame_Checkbox_Symbol1:Disable();
406 EQL3_OptionsFrame_Checkbox_Symbol2:Disable();
407 EQL3_OptionsFrame_Checkbox_Symbol3:Disable();
408 EQL3_OptionsFrame_Checkbox_Symbol4:Disable();
409 EQL3_OptionsFrame_Checkbox_List1:Disable();
410 EQL3_OptionsFrame_Checkbox_List2:Disable();
411 EQL3_OptionsFrame_Checkbox_List3:Disable();
412 EQL3_OptionsFrame_Checkbox_List4:Disable();
413 end
414 QuestWatch_Update();
415 end
416  
417 -- end
418  
419  
420 function EQL3_Toggle_UseTrackerListing()
421 if (EQL3_OptionsFrame_Checkbox_UseTrackerListing:GetChecked() == 1) then
422 QuestlogOptions[EQL3_Player].UseTrackerListing = 1;
423 EQL3_OptionsFrame_Checkbox_List1:Enable();
424 EQL3_OptionsFrame_Checkbox_List2:Enable();
425 EQL3_OptionsFrame_Checkbox_List3:Enable();
426 EQL3_OptionsFrame_Checkbox_List4:Enable();
427  
428 EQL3_OptionsFrame_Checkbox_Symbol1:Disable();
429 EQL3_OptionsFrame_Checkbox_Symbol2:Disable();
430 EQL3_OptionsFrame_Checkbox_Symbol3:Disable();
431 EQL3_OptionsFrame_Checkbox_Symbol4:Disable();
432 else
433 QuestlogOptions[EQL3_Player].UseTrackerListing = 0;
434 EQL3_OptionsFrame_Checkbox_List1:Disable();
435 EQL3_OptionsFrame_Checkbox_List2:Disable();
436 EQL3_OptionsFrame_Checkbox_List3:Disable();
437 EQL3_OptionsFrame_Checkbox_List4:Disable();
438  
439 EQL3_OptionsFrame_Checkbox_Symbol1:Enable();
440 EQL3_OptionsFrame_Checkbox_Symbol2:Enable();
441 EQL3_OptionsFrame_Checkbox_Symbol3:Enable();
442 EQL3_OptionsFrame_Checkbox_Symbol4:Enable();
443 end
444 QuestWatch_Update();
445 end
446  
447 function EQL3_Set_TrackerListing(id)
448 QuestlogOptions[EQL3_Player].TrackerList = id;
449 EQL3_OptionsFrame_Checkbox_List1:SetChecked(0);
450 EQL3_OptionsFrame_Checkbox_List2:SetChecked(0);
451 EQL3_OptionsFrame_Checkbox_List3:SetChecked(0);
452 EQL3_OptionsFrame_Checkbox_List4:SetChecked(0);
453 getglobal("EQL3_OptionsFrame_Checkbox_List"..(id+1)):SetChecked(1);
454 QuestWatch_Update();
455 end
456  
457 function EQL3_Set_TrackerSymbol(id)
458 QuestlogOptions[EQL3_Player].TrackerSymbol = id;
459 EQL3_OptionsFrame_Checkbox_Symbol1:SetChecked(0);
460 EQL3_OptionsFrame_Checkbox_Symbol2:SetChecked(0);
461 EQL3_OptionsFrame_Checkbox_Symbol3:SetChecked(0);
462 EQL3_OptionsFrame_Checkbox_Symbol4:SetChecked(0);
463 getglobal("EQL3_OptionsFrame_Checkbox_Symbol"..(id+1)):SetChecked(1);
464 QuestWatch_Update();
465 end
466  
467  
468 function EQL3_Toggle_ShowZones()
469 if (this:GetChecked() == 1) then
470 QuestlogOptions[EQL3_Player].ShowZonesInTracker = 1;
471 EQL3_OptionsFrame_Checkbox_SortTracker:Disable();
472 EQL3_OptionsFrame_Checkbox_SortTracker:SetChecked(1);
473 else
474 QuestlogOptions[EQL3_Player].ShowZonesInTracker = 0;
475 EQL3_OptionsFrame_Checkbox_SortTracker:Enable();
476 end
477 SortWatchedQuests();
478 QuestWatch_Update();
479 end
480  
481 function EQL3_Toggle_SortTracker()
482 if (this:GetChecked() == 1) then
483 QuestlogOptions[EQL3_Player].SortTrackerItems = 1;
484 else
485 QuestlogOptions[EQL3_Player].SortTrackerItems = 0;
486 end
487 SortWatchedQuests();
488 QuestWatch_Update();
489 end
490  
491  
492  
493  
494  
495 function EQL3_OpenColorPicker(color, useOpacity, swatch)
496 local c={};
497  
498 c.r = QuestlogOptions[EQL3_Player].Color[color].r;
499 c.g = QuestlogOptions[EQL3_Player].Color[color].g;
500 c.b = QuestlogOptions[EQL3_Player].Color[color].b;
501 if (useOpacity) then
502 c.a = 1.0 - QuestlogOptions[EQL3_Player].Color[color].a;
503 end
504 if(not c.a) then
505 c.a = 0.0;
506 end
507 EQL3_Temp.CurrentColor = color;
508 EQL3_Temp.CurrentSwatch = swatch;
509 ColorPickerFrame.opacity = c.a;
510 ColorPickerFrame:SetColorRGB(c.r, c.g, c.b);
511 ColorPickerFrame.previousValues = {r = c.r, g = c.g, b = c.b, a = c.a};
512 ColorPickerFrame.hasOpacity = useOpacity;
513 ColorPickerFrame.func = EQL3_SaveColorPicker;
514 ColorPickerFrame.cancelFunc = EQL3_CancelColorPicker;
515 ColorPickerFrame:Show();
516 ColorPickerFrame:Raise();
517  
518 end
519  
520 function EQL3_SaveColorPicker()
521 local r, g, b = ColorPickerFrame:GetColorRGB();
522 QuestlogOptions[EQL3_Player].Color[EQL3_Temp.CurrentColor].r = r;
523 QuestlogOptions[EQL3_Player].Color[EQL3_Temp.CurrentColor].g = g;
524 QuestlogOptions[EQL3_Player].Color[EQL3_Temp.CurrentColor].b = b;
525 if (ColorPickerFrame.hasOpacity) then
526 QuestlogOptions[EQL3_Player].Color[EQL3_Temp.CurrentColor].a = 1.0 - OpacitySliderFrame:GetValue();
527 end
528  
529 getglobal(EQL3_Temp.CurrentSwatch.."NormalTexture"):SetVertexColor(r, g, b);
530  
531 if (not ColorPickerFrame:IsVisible()) then
532 if (EQL3_Temp.CurrentColor == "TrackerBG") then
533 TrackerBackground_Update();
534 else
535 QuestWatch_Update();
536 end
537 ColorPickerFrame.func = nil;
538 ColorPickerFrame.cancelFunc = nil;
539 end
540  
541 end
542  
543 function EQL3_CancelColorPicker(color)
544 QuestlogOptions[EQL3_Player].Color[EQL3_Temp.CurrentColor].r = ColorPickerFrame.previousValues.r;
545 QuestlogOptions[EQL3_Player].Color[EQL3_Temp.CurrentColor].g = ColorPickerFrame.previousValues.g;
546 QuestlogOptions[EQL3_Player].Color[EQL3_Temp.CurrentColor].b = ColorPickerFrame.previousValues.b;
547 if (ColorPickerFrame.hasOpacity) then
548 QuestlogOptions[EQL3_Player].Color[EQL3_Temp.CurrentColor].a = 1.0 - ColorPickerFrame.previousValues.a;
549 end
550  
551 getglobal(EQL3_Temp.CurrentSwatch.."NormalTexture"):SetVertexColor(ColorPickerFrame.previousValues.r, ColorPickerFrame.previousValues.g, ColorPickerFrame.previousValues.b);
552  
553 if (not ColorPickerFrame:IsVisible()) then
554 if (EQL3_Temp.CurrentColor == "TrackerBG") then
555 TrackerBackground_Update();
556 else
557 QuestWatch_Update();
558 end
559 ColorPickerFrame.func = nil;
560 ColorPickerFrame.cancelFunc = nil;
561 end
562 end
563  
564 function TrackerBackground_Update()
565 if(QuestlogOptions[EQL3_Player].CustomTrackerBGColor == 1) then
566  
567 QuestWatchFrameBackdrop:SetBackdropBorderColor( QuestlogOptions[EQL3_Player].Color["TrackerBG"].r,
568 QuestlogOptions[EQL3_Player].Color["TrackerBG"].g,
569 QuestlogOptions[EQL3_Player].Color["TrackerBG"].b );
570 QuestWatchFrameBackdrop:SetBackdropColor( QuestlogOptions[EQL3_Player].Color["TrackerBG"].r,
571 QuestlogOptions[EQL3_Player].Color["TrackerBG"].g,
572 QuestlogOptions[EQL3_Player].Color["TrackerBG"].b );
573 QuestWatchFrameBackdrop:SetAlpha(QuestlogOptions[EQL3_Player].Color["TrackerBG"].a);
574  
575 else
576  
577 QuestWatchFrameBackdrop:SetBackdropBorderColor( TOOLTIP_DEFAULT_BACKGROUND_COLOR.r,
578 TOOLTIP_DEFAULT_BACKGROUND_COLOR.g,
579 TOOLTIP_DEFAULT_BACKGROUND_COLOR.b );
580 QuestWatchFrameBackdrop:SetBackdropColor( TOOLTIP_DEFAULT_BACKGROUND_COLOR.r,
581 TOOLTIP_DEFAULT_BACKGROUND_COLOR.g,
582 TOOLTIP_DEFAULT_BACKGROUND_COLOR.b );
583 QuestWatchFrameBackdrop:SetAlpha(0.0);
584  
585 end
586 end
587  
588  
589  
590 function EQL3_Toggle_LockTracker()
591 if (this:GetChecked() == 1) then
592 QuestlogOptions[EQL3_Player].LockTracker = 1;
593 EQL3_QuestWatchFrame:SetUserPlaced(0);
594 EQL3_QuestWatchFrame:RegisterForDrag(0);
595 EQL3_QuestWatchFrame:SetMovable(false);
596 EQL3_QuestWatchFrame:EnableMouse(false);
597 else
598 QuestlogOptions[EQL3_Player].LockTracker = 0;
599 EQL3_QuestWatchFrame:SetMovable(true);
600 EQL3_QuestWatchFrame:EnableMouse(true);
601 EQL3_QuestWatchFrame:SetUserPlaced(1);
602 EQL3_QuestWatchFrame:RegisterForDrag("LeftButton");
603 end
604 end
605  
606 function EQL3_RestoreTracker()
607 EQL3_QuestWatchFrame:ClearAllPoints();
608 EQL3_QuestWatchFrame:SetPoint("TOPRIGHT","MinimapCluster","BOTTOMRIGHT",-100,10);
609 QuestWatchFrame_LockCornerForGrowth();
610 end
611  
612 function EQL3_RestoreColors()
613 QuestlogOptions[EQL3_Player].Color["TrackerBG"] = { r = TOOLTIP_DEFAULT_BACKGROUND_COLOR.r,
614 g = TOOLTIP_DEFAULT_BACKGROUND_COLOR.g,
615 b = TOOLTIP_DEFAULT_BACKGROUND_COLOR.b,
616 a = 0.0};
617  
618 QuestlogOptions[EQL3_Player].Color["Zone"] = {r = 1.0, g = 1.0, b = 1.0};
619 QuestlogOptions[EQL3_Player].Color["HeaderEmpty"] = {r = 0.75, g = 0.61, b = 0.0};
620 QuestlogOptions[EQL3_Player].Color["HeaderComplete"] = {r = NORMAL_FONT_COLOR.r, g = NORMAL_FONT_COLOR.g, b = NORMAL_FONT_COLOR.b};
621 QuestlogOptions[EQL3_Player].Color["ObjectiveEmpty"] = {r = 0.8, g = 0.8, b = 0.8};
622 QuestlogOptions[EQL3_Player].Color["ObjectiveComplete"] = {r = HIGHLIGHT_FONT_COLOR.r, g = HIGHLIGHT_FONT_COLOR.g, b = HIGHLIGHT_FONT_COLOR.b};
623 QuestlogOptions[EQL3_Player].Color["Tooltip"] = {r = 1.0, g = 0.8, b = 0.0};
624  
625 if(QuestlogOptions[EQL3_Player].Color["TrackerBG"]) then
626 EQL3_OptionsFrame_ColorSwatch_TrackerBGNormalTexture:SetVertexColor( QuestlogOptions[EQL3_Player].Color["TrackerBG"].r,
627 QuestlogOptions[EQL3_Player].Color["TrackerBG"].g,
628 QuestlogOptions[EQL3_Player].Color["TrackerBG"].b );
629 end
630  
631 if(QuestlogOptions[EQL3_Player].Color["Zone"]) then
632 EQL3_OptionsFrame_ColorSwatch_ZoneNormalTexture:SetVertexColor( QuestlogOptions[EQL3_Player].Color["Zone"].r,
633 QuestlogOptions[EQL3_Player].Color["Zone"].g,
634 QuestlogOptions[EQL3_Player].Color["Zone"].b );
635 end
636  
637 if(QuestlogOptions[EQL3_Player].Color["HeaderEmpty"]) then
638 EQL3_OptionsFrame_ColorSwatch_Header_EmptyNormalTexture:SetVertexColor( QuestlogOptions[EQL3_Player].Color["HeaderEmpty"].r,
639 QuestlogOptions[EQL3_Player].Color["HeaderEmpty"].g,
640 QuestlogOptions[EQL3_Player].Color["HeaderEmpty"].b );
641 end
642  
643 if(QuestlogOptions[EQL3_Player].Color["HeaderComplete"]) then
644 EQL3_OptionsFrame_ColorSwatch_Header_CompleteNormalTexture:SetVertexColor( QuestlogOptions[EQL3_Player].Color["HeaderComplete"].r,
645 QuestlogOptions[EQL3_Player].Color["HeaderComplete"].g,
646 QuestlogOptions[EQL3_Player].Color["HeaderComplete"].b );
647 end
648  
649 if(QuestlogOptions[EQL3_Player].Color["ObjectiveEmpty"]) then
650 EQL3_OptionsFrame_ColorSwatch_Objective_EmptyNormalTexture:SetVertexColor( QuestlogOptions[EQL3_Player].Color["ObjectiveEmpty"].r,
651 QuestlogOptions[EQL3_Player].Color["ObjectiveEmpty"].g,
652 QuestlogOptions[EQL3_Player].Color["ObjectiveEmpty"].b );
653 end
654  
655 if(QuestlogOptions[EQL3_Player].Color["ObjectiveComplete"]) then
656 EQL3_OptionsFrame_ColorSwatch_Objective_CompleteNormalTexture:SetVertexColor( QuestlogOptions[EQL3_Player].Color["ObjectiveComplete"].r,
657 QuestlogOptions[EQL3_Player].Color["ObjectiveComplete"].g,
658 QuestlogOptions[EQL3_Player].Color["ObjectiveComplete"].b );
659 end
660  
661 if(QuestlogOptions[EQL3_Player].Color["Tooltip"]) then
662 EQL3_OptionsFrame_ColorSwatch_TooltipInfoNormalTexture:SetVertexColor( QuestlogOptions[EQL3_Player].Color["Tooltip"].r,
663 QuestlogOptions[EQL3_Player].Color["Tooltip"].g,
664 QuestlogOptions[EQL3_Player].Color["Tooltip"].b );
665 end
666  
667 TrackerBackground_Update();
668 QuestWatch_Update();
669 end
670  
671  
672  
673 function EQL3_Toggle_AddNew()
674 if (this:GetChecked() == 1) then
675 QuestlogOptions[EQL3_Player].AddNew = 1
676 else
677 QuestlogOptions[EQL3_Player].AddNew = 0;
678 end
679 end
680  
681 function EQL3_Toggle_RemoveFinished()
682 if (this:GetChecked() == 1) then
683 QuestlogOptions[EQL3_Player].RemoveFinished = 1
684 EQL3_OptionsFrame_Checkbox_MinimizeFinished:Disable();
685 else
686 QuestlogOptions[EQL3_Player].RemoveFinished = 0;
687 EQL3_OptionsFrame_Checkbox_MinimizeFinished:Enable();
688 end
689 MagageTrackedQuests();
690 QuestLog_Update();
691 QuestWatch_Update();
692 end
693  
694 function EQL3_Toggle_MinimizeFinished()
695 if (this:GetChecked() == 1) then
696 QuestlogOptions[EQL3_Player].MinimizeFinished = 1
697 else
698 QuestlogOptions[EQL3_Player].MinimizeFinished = 0;
699 end
700 QuestWatch_Update();
701 end
702  
703 function EQL3_Toggle_AddUntracked()
704 if (this:GetChecked() == 1) then
705 QuestlogOptions[EQL3_Player].AddUntracked = 1
706 else
707 QuestlogOptions[EQL3_Player].AddUntracked = 0;
708 end
709 end
710  
711  
712  
713  
714 function EQL3_Toggle_LockQuestLog()
715 if (this:GetChecked() == 1) then
716 QuestlogOptions[EQL3_Player].LockQuestLog = 1;
717 EQL3_QuestLogFrame:RegisterForDrag(0);
718 EQL3_QuestLogFrame_Description:RegisterForDrag(0);
719 else
720 QuestlogOptions[EQL3_Player].LockQuestLog = 0;
721 EQL3_QuestLogFrame:RegisterForDrag("LeftButton");
722 EQL3_QuestLogFrame_Description:RegisterForDrag("LeftButton");
723 end
724 end
725  
726 function EQL3_RestoreQuestLog()
727 EQL3_QuestLogFrame:ClearAllPoints();
728 EQL3_QuestLogFrame:SetPoint("TOPLEFT", 0, -104);
729 QuestLogFrame_LockCorner();
730 end
731  
732  
733  
734  
735 -- Organizer
736 function EQL3_SortComparison(value1, value2)
737 if(value1.header == value2.header) then
738 if(value1.level == value2.level) then
739 return value1.title < value2.title;
740 end
741 return value1.level < value2.level;
742 end
743 return value1.header < value2.header;
744 end
745  
746  
747 function EQL3_UpdateDB()
748 if(not EQL3_Temp.GotQuestLogUpdate) then
749 return nil;
750 end
751 local numEntries, numQuests = old_GetNumQuestLogEntries();
752 if(numEntries == EQL3_Temp.lastExistingNumEntries) then
753 return 1;
754 end
755 if(EQL3_Temp.lastExistingNumEntries == -1 and numEntries < 1) then
756 if(not EQL3_Temp.reportedNoQuests) then
757 EQL3_Temp.reportedNoQuests = 1;
758 end
759 return nil;
760 end
761 if(EQL3_Temp.reportedNoQuests) then
762 EQL3_Temp.reportedNoQuests = nil;
763 end
764 EQL3_Temp.lastExistingNumEntries = numEntries;
765 local index;
766 for index in QuestlogOptions[EQL3_Player].OrganizerSettings do
767 QuestlogOptions[EQL3_Player].OrganizerSettings[index].cleanup = 1;
768 end
769 local i;
770 local questLogTitleText, level, questTag, isHeader, isCollapsed, isComplete;
771 local sortData = {};
772 local j = 1;
773 local lastHeader = "NoHeader";
774 for i=1, numEntries, 1 do
775 questLogTitleText, level, questTag, isHeader, isCollapsed, isComplete = old_GetQuestLogTitle(i);
776 if(isHeader) then
777 lastHeader = questLogTitleText;
778 else
779 sortData[j] = {};
780 if(QuestlogOptions[EQL3_Player].OrganizerSettings[questLogTitleText]) then
781 sortData[j].header = QuestlogOptions[EQL3_Player].OrganizerSettings[questLogTitleText].header;
782 QuestlogOptions[EQL3_Player].OrganizerSettings[questLogTitleText].cleanup = nil;
783 else
784 sortData[j].header = lastHeader;
785 end
786 sortData[j].level = level;
787 sortData[j].title = questLogTitleText;
788 sortData[j].questID = i;
789 j = j + 1;
790 end
791 end
792 table.sort(sortData, EQL3_SortComparison);
793 EQL3_Temp.savedNumQuests = j - 1;
794 local selectedQuest = old_GetQuestLogSelection();
795 EQL3_Temp.savedSelectedQuest = selectedQuest;
796 EQL3_Temp.savedQuestIDMap = {};
797 j = 1;
798 lastHeader = nil;
799 for i=1, EQL3_Temp.savedNumQuests, 1 do
800 if(sortData[i].header ~= lastHeader) then
801 lastHeader = sortData[i].header;
802 EQL3_Temp.savedQuestIDMap[j] = {};
803 EQL3_Temp.savedQuestIDMap[j].header = lastHeader;
804 j = j + 1;
805 end
806 EQL3_Temp.savedQuestIDMap[j] = {};
807 EQL3_Temp.savedQuestIDMap[j].questID = sortData[i].questID;
808 if(EQL3_Temp.savedQuestIDMap[j].questID == EQL3_Temp.selectedQuest) then
809 EQL3_Temp.savedSelectedQuest = j;
810 end
811 j = j + 1;
812 end
813 EQL3_Temp.savedNumEntries = j - 1;
814 for index in QuestlogOptions[EQL3_Player].OrganizerSettings do
815 if(QuestlogOptions[EQL3_Player].OrganizerSettings[index].cleanup) then
816 QuestlogOptions[EQL3_Player].OrganizerSettings[index] = nil;
817 end
818 end
819 return 1;
820 end
821  
822 function EQL3_RefreshOtherQuestDisplays()
823 EQL3_Temp.lastExistingNumEntries = -1;
824 old_ExpandQuestHeader(0);
825 end
826  
827  
828  
829 function FixGroupChangedQuest(title, headern)
830 local temp, temp2, isHeader, foundQuest, header=nil;
831 if(headern ~= nil) then header = headern end
832 for i=1, GetNumQuestWatches(), 1 do
833 temp = string.gsub(QuestlogOptions[EQL3_Player].QuestWatches[i], ".+,%d+,", "");
834 if(title == temp) then
835 if(header == nil) then
836 -- Find the header...
837 foundQuest = false;
838 for j=GetNumQuestLogEntries(), 1, -1 do
839 temp2, _, _, isHeader = GetQuestLogTitle(j);
840 if(not foundQuest and temp2 == title) then
841 foundQuest = true;
842 end
843 if (foundQuest and isHeader) then
844 header = temp2;
845 break;
846 end
847 end
848 end
849 if (header == nil) then
850 SortWatchedQuests();
851 return;
852 end
853 temp2 = string.gsub(QuestlogOptions[EQL3_Player].QuestWatches[i], ",%d+,.+", "");
854 temp = header..string.gsub(QuestlogOptions[EQL3_Player].QuestWatches[i], temp2, "");
855 QuestlogOptions[EQL3_Player].QuestWatches[i] = temp;
856 SortWatchedQuests();
857 return;
858 end
859 end
860 end
861  
862 function EQL3_OrganizeFunctions(command)
863 if(not EQL3_UpdateDB()) then
864 return;
865 end
866 local questID = GetQuestLogSelection();
867 if(not (questID and questID > 0)) then
868 return;
869 end
870 if(command == "!!!resetall") then
871 table.foreach (QuestlogOptions[EQL3_Player].OrganizerSettings, function (key, v)
872 QuestlogOptions[EQL3_Player].OrganizerSettings[key] = nil;
873 EQL3_RefreshOtherQuestDisplays();
874 FixGroupChangedQuest(key, nil);
875 return nil;
876 end);
877 QuestlogOptions[EQL3_Player].OrganizerSettings = {};
878 EQL3_RefreshOtherQuestDisplays();
879 else
880 local title = GetQuestLogTitle(questID);
881 if(not title) then
882 return;
883 end
884 if(command == "!!!reset") then
885 QuestlogOptions[EQL3_Player].OrganizerSettings[title] = nil;
886 EQL3_RefreshOtherQuestDisplays();
887 FixGroupChangedQuest(title, nil);
888 else
889 QuestlogOptions[EQL3_Player].OrganizerSettings[title] = {};
890 QuestlogOptions[EQL3_Player].OrganizerSettings[title].header = command;
891 EQL3_RefreshOtherQuestDisplays();
892 FixGroupChangedQuest(title, command);
893 end
894 end
895 EQL3_RefreshOtherQuestDisplays();
896 end
897  
898  
899 function EQL3_Toggle_Track()
900 if ( EQL3_IsQuestWatched(GetQuestLogSelection()) ) then
901 EQL3_RemoveQuestWatch(GetQuestLogSelection());
902 else
903 EQL3_AddQuestWatch(GetQuestLogSelection());
904 end
905 QuestLog_Update();
906 QuestWatch_Update();
907 end
908  
909  
910 function EQL3_Organize_ShowNameWindow()
911 EQL3_OrganizeFrame:Show();
912 EQL3_OrganizeFrame:Raise();
913 EQL3_OrganizeFrame_Text:SetFocus();
914 end
915  
916  
917 function EQL3_SlashCmd(msg)
918 if (string.len(msg) > 0) then
919 if(not EQL3_UpdateDB()) then
920 return;
921 end
922 local questID = GetQuestLogSelection();
923 if(not (questID and questID > 0)) then
924 return;
925 end
926 if(msg == "resetall") then
927 table.foreach (QuestlogOptions[EQL3_Player].OrganizerSettings, function (key, v)
928 QuestlogOptions[EQL3_Player].OrganizerSettings[key] = nil;
929 EQL3_RefreshOtherQuestDisplays();
930 FixGroupChangedQuest(key, nil);
931 return nil;
932 end);
933 QuestlogOptions[EQL3_Player].OrganizerSettings = {};
934 EQL3_RefreshOtherQuestDisplays();
935 else
936 local title = GetQuestLogTitle(questID);
937 if(not title) then
938 return;
939 end
940 if(msg == "reset") then
941 QuestlogOptions[EQL3_Player].OrganizerSettings[title] = nil;
942 EQL3_RefreshOtherQuestDisplays();
943 FixGroupChangedQuest(title, nil);
944 else
945 QuestlogOptions[EQL3_Player].OrganizerSettings[title] = {};
946 QuestlogOptions[EQL3_Player].OrganizerSettings[title].header = msg;
947 EQL3_RefreshOtherQuestDisplays();
948 FixGroupChangedQuest(title, msg);
949 end
950 end
951 EQL3_RefreshOtherQuestDisplays();
952 else
953 DEFAULT_CHAT_FRAME:AddMessage("Usage:");
954 DEFAULT_CHAT_FRAME:AddMessage("/eql - shows this message");
955 DEFAULT_CHAT_FRAME:AddMessage("/eql <header> - moves the currently selected quest to this header");
956 DEFAULT_CHAT_FRAME:AddMessage("/eql reset - reset the currently selected quest to its default header");
957 DEFAULT_CHAT_FRAME:AddMessage("/eql resetall - resets all quests to their default headers");
958 end
959 end
960  
961  
962  
963  
964 function GetNumQuestLogEntries()
965 if(not EQL3_UpdateDB()) then
966 return old_GetNumQuestLogEntries();
967 end
968 return EQL3_Temp.savedNumEntries, EQL3_Temp.savedNumQuests;
969 end
970  
971  
972  
973 function SelectQuestLogEntry(questID)
974 if(not EQL3_UpdateDB()) then
975 return old_SelectQuestLogEntry(questID);
976 end
977 if(EQL3_Temp.savedQuestIDMap and EQL3_Temp.savedQuestIDMap[questID] and EQL3_Temp.savedQuestIDMap[questID].questID) then
978 EQL3_Temp.savedSelectedQuest = questID;
979 return old_SelectQuestLogEntry(EQL3_Temp.savedQuestIDMap[questID].questID);
980 end
981 end
982  
983  
984  
985 function GetQuestLogSelection()
986 if(not EQL3_UpdateDB()) then
987 return old_GetQuestLogSelection();
988 end
989 return EQL3_Temp.savedSelectedQuest;
990 end
991  
992  
993  
994  
995 function ExpandQuestHeader(questID)
996 -- DISABLED!
997 end
998  
999 function CollapseQuestHeader(questID)
1000 -- DEFAULT_CHAT_FRAME:AddMessage("Collapsing quest headers will cause errors.");
1001 EQL3_QuestLogCollapseAllButton.collapsed = nil;
1002 end
1003  
1004  
1005  
1006 function IsUnitOnQuest(questID, unit)
1007 if(not EQL3_UpdateDB()) then
1008 return old_IsUnitOnQuest(questID, unit);
1009 end
1010 if(EQL3_Temp.savedQuestIDMap and EQL3_Temp.savedQuestIDMap[questID] and EQL3_Temp.savedQuestIDMap[questID].questID) then
1011 return old_IsUnitOnQuest(EQL3_Temp.savedQuestIDMap[questID].questID, unit);
1012 end
1013 end
1014  
1015  
1016  
1017 function IsQuestWatched(questID)
1018 if(not EQL3_UpdateDB()) then
1019 return EQL3_IsQuestWatched(questID);
1020 end
1021 if(EQL3_Temp.savedQuestIDMap and EQL3_Temp.savedQuestIDMap[questID] and EQL3_Temp.savedQuestIDMap[questID].questID) then
1022 return EQL3_IsQuestWatched(questID); -- EQL3_IsQuestWatched(EQL3_Temp.savedQuestIDMap[questID].questID);
1023 end
1024 end
1025  
1026 function AddQuestWatch(questID)
1027 if(not EQL3_UpdateDB()) then
1028 return EQL3_AddQuestWatch(questID);
1029 end
1030 if(EQL3_Temp.savedQuestIDMap and EQL3_Temp.savedQuestIDMap[questID] and EQL3_Temp.savedQuestIDMap[questID].questID) then
1031 return EQL3_AddQuestWatch(questID);-- EQL3_AddQuestWatch(EQL3_Temp.savedQuestIDMap[questID].questID);
1032 end
1033 end
1034  
1035 function RemoveQuestWatch(questID)
1036 if(not EQL3_UpdateDB()) then
1037 return EQL3_RemoveQuestWatch(questID);
1038 end
1039 if(EQL3_Temp.savedQuestIDMap and EQL3_Temp.savedQuestIDMap[questID] and EQL3_Temp.savedQuestIDMap[questID].questID) then
1040 return EQL3_RemoveQuestWatch(questID); -- EQL3_RemoveQuestWatch(EQL3_Temp.savedQuestIDMap[questID].questID);
1041 end
1042 end
1043  
1044  
1045 function GetQuestIndexForWatch(watchID)
1046 if(not EQL3_UpdateDB()) then
1047 return EQL3_GetQuestIndexForWatch(watchID);
1048 end
1049  
1050 if(EQL3_Temp.savedQuestIDMap) then
1051  
1052 local mappedQuestID = EQL3_GetQuestIndexForWatch(watchID);
1053 local questID;
1054 for questID in EQL3_Temp.savedQuestIDMap do
1055 if(EQL3_Temp.savedQuestIDMap[questID].questID and (EQL3_Temp.savedQuestIDMap[questID].questID == mappedQuestID)) then
1056 return EQL3_GetQuestIndexForWatch(watchID); -- return questID;
1057 end
1058 end
1059 end
1060 end
1061  
1062  
1063  
1064 function GetNumQuestLeaderBoards(questID)
1065 if(not questID or not EQL3_UpdateDB()) then
1066 return old_GetNumQuestLeaderBoards(questID);
1067 end
1068 if(EQL3_Temp.savedQuestIDMap and EQL3_Temp.savedQuestIDMap[questID] and EQL3_Temp.savedQuestIDMap[questID].questID) then
1069 return old_GetNumQuestLeaderBoards(EQL3_Temp.savedQuestIDMap[questID].questID);
1070 end
1071 end
1072  
1073 function GetQuestLogLeaderBoard(objectiveID, questID)
1074 if(not questID or not EQL3_UpdateDB()) then
1075 return old_GetQuestLogLeaderBoard(objectiveID, questID);
1076 end
1077 if(EQL3_Temp.savedQuestIDMap and EQL3_Temp.savedQuestIDMap[questID] and EQL3_Temp.savedQuestIDMap[questID].questID) then
1078 return old_GetQuestLogLeaderBoard(objectiveID, EQL3_Temp.savedQuestIDMap[questID].questID);
1079 end
1080 end
1081  
1082  
1083  
1084  
1085  
1086 function SetTrackerFontSize()
1087 local temp, t1, t2;
1088  
1089 t1, _, t2 = EQL3_QuestWatchLine1:GetFont();
1090  
1091 for i=1, MAX_QUESTWATCH_LINES, 1 do
1092 temp = getglobal("EQL3_QuestWatchLine"..i);
1093 --temp:SetTextHeight(QuestlogOptions[EQL3_Player].TrackerFontHeight);
1094 temp:SetFont(t1, QuestlogOptions[EQL3_Player].TrackerFontHeight, t2);
1095 temp:SetHeight(QuestlogOptions[EQL3_Player].TrackerFontHeight+1);
1096 end
1097  
1098 QuestWatch_Update();
1099 end
1100  
1101 function EQL3_Toggle_ShowMinimizer()
1102 if (this:GetChecked() == 1) then
1103 QuestlogOptions[EQL3_Player].TrackerShowMinimizer = 1;
1104 EQL3_Tracker_MinimizeButton:Show();
1105 else
1106 QuestlogOptions[EQL3_Player].TrackerShowMinimizer = 0;
1107 QuestlogOptions[EQL3_Player].TrackerIsMinimized = 0;
1108 EQL3_Tracker_MinimizeButton:Hide();
1109 end
1110  
1111 QuestWatch_Update();
1112 end
1113  
1114 function EQL3_Toggle_Tracker()
1115 if ( QuestlogOptions[EQL3_Player].TrackerIsMinimized == 1 ) then
1116 QuestlogOptions[EQL3_Player].TrackerIsMinimized = 0;
1117 else
1118 QuestlogOptions[EQL3_Player].TrackerIsMinimized = 1;
1119 end
1120  
1121 QuestWatch_Update();
1122 end
1123  
1124  
1125  
1126  
1127 function EQL3_ShowLoadDropDown(button)
1128 if ( button == "LeftButton" ) then
1129 ToggleDropDownMenu(1, nil, EQL3_RealmDropDown, this:GetName(), 0, 0);
1130 return;
1131 end
1132 end
1133  
1134  
1135 function EQL3_RealmDropDown_OnLoad()
1136 UIDropDownMenu_Initialize(this, EQL3_RealmDropDown_Initialize, "MENU");
1137 UIDropDownMenu_SetButtonWidth(50);
1138 UIDropDownMenu_SetWidth(50);
1139 end
1140  
1141  
1142  
1143 function EQL3_RealmDropDown_Initialize()
1144  
1145 if ( UIDROPDOWNMENU_MENU_LEVEL == 1 ) then
1146  
1147 local info = {};
1148 local realms = {};
1149  
1150 -- Loop through Realms and add to menu
1151 for i in QuestlogOptions do
1152 for w in string.gfind(i, "%-([^%-]+)") do
1153 if ( not realms[w] ) then
1154  
1155 -- Make sure every realm is only shown once
1156 realms[w] = 1;
1157 -- Realms List
1158 info = {};
1159 info.text = w;
1160 info.hasArrow = 1;
1161 info.func = nil;
1162 info.notCheckable = 1;
1163 UIDropDownMenu_AddButton(info);
1164  
1165 break;
1166 end
1167 end
1168 end
1169  
1170 elseif ( UIDROPDOWNMENU_MENU_LEVEL == 2 ) then
1171  
1172 info = {};
1173 info.text = UIDROPDOWNMENU_MENU_VALUE;
1174 info.notClickable = 1;
1175 info.isTitle = 1;
1176 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
1177  
1178 for i in QuestlogOptions do
1179 for x, w in string.gfind(i, "([^%-]+)%-([^%-]+)") do
1180 if(w == UIDROPDOWNMENU_MENU_VALUE) then
1181 info = {};
1182 info.text = x;
1183 info.value = i;
1184 info.func = EQL3_LoadCharacterSettings;
1185 info.notCheckable = 1;
1186 UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
1187 end
1188 end
1189 end
1190  
1191 end
1192 end
1193  
1194 function EQL3_LoadCharacterSettings()
1195 -- toggle the menu.. in this case hide it
1196 ToggleDropDownMenu(1, nil, EQL3_RealmDropDown, EQL3_OptionsFrameLoadButton:GetName(), 0, 0);
1197  
1198 --load the settings...
1199 QuestlogOptions[EQL3_Player].ShowQuestLevels = QuestlogOptions[this.value].ShowQuestLevels;
1200  
1201 QuestlogOptions[EQL3_Player].RestoreUponSelect = QuestlogOptions[this.value].RestoreUponSelect;
1202  
1203 QuestlogOptions[EQL3_Player].MinimizeUponClose = QuestlogOptions[this.value].MinimizeUponClose;
1204  
1205 QuestlogOptions[EQL3_Player].LockQuestLog = QuestlogOptions[this.value].LockQuestLog;
1206  
1207  
1208 if(QuestlogOptions[EQL3_Player].LockQuestLog == 1) then
1209 EQL3_QuestLogFrame:RegisterForDrag(0);
1210 EQL3_QuestLogFrame_Description:RegisterForDrag(0);
1211 else
1212 EQL3_QuestLogFrame:RegisterForDrag("LeftButton");
1213 EQL3_QuestLogFrame_Description:RegisterForDrag("LeftButton");
1214 end
1215  
1216  
1217 QuestlogOptions[EQL3_Player].LogLockPoints = QuestlogOptions[this.value].LogLockPoints;
1218  
1219  
1220 if (QuestlogOptions[EQL3_Player].LogLockPoints and
1221 QuestlogOptions[EQL3_Player].LogLockPoints.pointone and
1222 QuestlogOptions[EQL3_Player].LogLockPoints.pointtwo) then
1223 EQL3_QuestLogFrame:ClearAllPoints();
1224 EQL3_QuestLogFrame:SetPoint("TOPLEFT","UIParent","BOTTOMLEFT",QuestlogOptions[EQL3_Player].LogLockPoints.pointone,QuestlogOptions[EQL3_Player].LogLockPoints.pointtwo);
1225 end
1226  
1227  
1228 QuestlogOptions[EQL3_Player].MinimizeUponClose = QuestlogOptions[this.value].MinimizeUponClose;
1229  
1230 QuestlogOptions[EQL3_Player].LogOpacity = QuestlogOptions[this.value].LogOpacity;
1231 EQL3_QuestLogFrame:SetAlpha(QuestlogOptions[EQL3_Player].LogOpacity);
1232 EQL3_OptionsFrame_Slider_LogOpacity:SetValue(QuestlogOptions[EQL3_Player].LogOpacity);
1233  
1234 QuestlogOptions[EQL3_Player].ShowZonesInTracker = QuestlogOptions[this.value].ShowZonesInTracker;
1235  
1236 QuestlogOptions[EQL3_Player].SortTrackerItems = QuestlogOptions[this.value].SortTrackerItems;
1237  
1238 QuestlogOptions[EQL3_Player].CustomZoneColor = QuestlogOptions[this.value].CustomZoneColor;
1239  
1240 QuestlogOptions[EQL3_Player].CustomHeaderColor = QuestlogOptions[this.value].CustomHeaderColor;
1241  
1242 QuestlogOptions[EQL3_Player].CustomObjetiveColor = QuestlogOptions[this.value].CustomObjetiveColor;
1243  
1244 QuestlogOptions[EQL3_Player].FadeHeaderColor = QuestlogOptions[this.value].FadeHeaderColor;
1245  
1246 QuestlogOptions[EQL3_Player].FadeObjectiveColor = QuestlogOptions[this.value].FadeObjectiveColor;
1247  
1248 QuestlogOptions[EQL3_Player].CustomTrackerBGColor = QuestlogOptions[this.value].CustomTrackerBGColor;
1249  
1250 QuestlogOptions[EQL3_Player].UseTrackerListing = QuestlogOptions[this.value].UseTrackerListing;
1251  
1252 QuestlogOptions[EQL3_Player].TrackerList = QuestlogOptions[this.value].TrackerList;
1253  
1254 QuestlogOptions[EQL3_Player].TrackerSymbol = QuestlogOptions[this.value].TrackerSymbol;
1255  
1256 QuestlogOptions[EQL3_Player].Color["TrackerBG"] = {r=QuestlogOptions[this.value].Color["TrackerBG"].r,
1257 g=QuestlogOptions[this.value].Color["TrackerBG"].g,
1258 b=QuestlogOptions[this.value].Color["TrackerBG"].b,
1259 a=QuestlogOptions[this.value].Color["TrackerBG"].a};
1260  
1261  
1262 QuestlogOptions[EQL3_Player].Color["Zone"] = {r=QuestlogOptions[this.value].Color["Zone"].r,
1263 g=QuestlogOptions[this.value].Color["Zone"].g,
1264 b=QuestlogOptions[this.value].Color["Zone"].b};
1265  
1266 QuestlogOptions[EQL3_Player].Color["HeaderEmpty"] = {r=QuestlogOptions[this.value].Color["HeaderEmpty"].r,
1267 g=QuestlogOptions[this.value].Color["HeaderEmpty"].g,
1268 b=QuestlogOptions[this.value].Color["HeaderEmpty"].b};
1269  
1270 QuestlogOptions[EQL3_Player].Color["HeaderComplete"] = {r=QuestlogOptions[this.value].Color["HeaderComplete"].r,
1271 g=QuestlogOptions[this.value].Color["HeaderComplete"].g,
1272 b=QuestlogOptions[this.value].Color["HeaderComplete"].b};
1273  
1274 QuestlogOptions[EQL3_Player].Color["ObjectiveEmpty"] = {r=QuestlogOptions[this.value].Color["ObjectiveEmpty"].r,
1275 g=QuestlogOptions[this.value].Color["ObjectiveEmpty"].g,
1276 b=QuestlogOptions[this.value].Color["ObjectiveEmpty"].b};
1277  
1278 QuestlogOptions[EQL3_Player].Color["ObjectiveComplete"] = {r=QuestlogOptions[this.value].Color["ObjectiveComplete"].r,
1279 g=QuestlogOptions[this.value].Color["ObjectiveComplete"].g,
1280 b=QuestlogOptions[this.value].Color["ObjectiveComplete"].b};
1281  
1282 QuestlogOptions[EQL3_Player].Color["Tooltip"] = {r=QuestlogOptions[this.value].Color["Tooltip"].r,
1283 g=QuestlogOptions[this.value].Color["Tooltip"].g,
1284 b=QuestlogOptions[this.value].Color["Tooltip"].b};
1285  
1286  
1287 QuestlogOptions[EQL3_Player].LockTracker = QuestlogOptions[this.value].LockTracker;
1288  
1289 QuestlogOptions[EQL3_Player].LockPoints = QuestlogOptions[this.value].LockPoints;
1290  
1291 QuestlogOptions[EQL3_Player].AddNew = QuestlogOptions[this.value].AddNew;
1292  
1293 QuestlogOptions[EQL3_Player].RemoveFinished = QuestlogOptions[this.value].RemoveFinished;
1294  
1295 QuestlogOptions[EQL3_Player].MinimizeFinished = QuestlogOptions[this.value].MinimizeFinished;
1296  
1297 QuestlogOptions[EQL3_Player].AddUntracked = QuestlogOptions[this.value].AddUntracked;
1298  
1299 QuestlogOptions[EQL3_Player].TrackerFontHeight = QuestlogOptions[this.value].TrackerFontHeight;
1300  
1301 EQL3_OptionsFrame_Slider_TrackerFontSize:SetValue(QuestlogOptions[EQL3_Player].TrackerFontHeight);
1302  
1303 QuestlogOptions[EQL3_Player].TrackerShowMinimizer = QuestlogOptions[this.value].TrackerShowMinimizer;
1304  
1305 QuestlogOptions[EQL3_Player].TrackerIsMinimized = QuestlogOptions[this.value].TrackerIsMinimized;
1306  
1307 -- new to 3.5.6
1308  
1309 QuestlogOptions[EQL3_Player].AutoCompleteQuests = QuestlogOptions[this.value].AutoCompleteQuests;
1310  
1311 QuestlogOptions[EQL3_Player].RemoveCompletedObjectives = QuestlogOptions[this.value].RemoveCompletedObjectives;
1312  
1313 QuestlogOptions[EQL3_Player].ShowObjectiveMarkers = QuestlogOptions[this.value].ShowObjectiveMarkers;
1314  
1315 QuestlogOptions[EQL3_Player].OnlyLevelsInLog = QuestlogOptions[this.value].OnlyLevelsInLog;
1316  
1317 -- new to 3.5.9
1318  
1319 QuestlogOptions[EQL3_Player].ItemTooltip = QuestlogOptions[this.value].ItemTooltip;
1320  
1321 QuestlogOptions[EQL3_Player].MobTooltip = QuestlogOptions[this.value].MobTooltip;
1322  
1323 QuestlogOptions[EQL3_Player].InfoOnQuestCompletion = QuestlogOptions[this.value].InfoOnQuestCompletion;
1324  
1325 QuestlogOptions[EQL3_Player].CustomTooltipColor = QuestlogOptions[this.value].CustomTooltipColor;
1326  
1327  
1328 EQL_Options_SetStates();
1329  
1330 QuestLog_Update();
1331 QuestWatch_Update();
1332 end
1333  
1334 -- new to 3.5.6
1335 function EQL3_Toggle_AutoCompleteQuests()
1336 if (this:GetChecked() == 1) then
1337 QuestlogOptions[EQL3_Player].AutoCompleteQuests = 1;
1338 else
1339 QuestlogOptions[EQL3_Player].AutoCompleteQuests = 0;
1340 end
1341 end
1342  
1343 function EQL3_Toggle_OnlyLevelsInLog()
1344 if (this:GetChecked() == 1) then
1345 QuestlogOptions[EQL3_Player].OnlyLevelsInLog = 1;
1346 else
1347 QuestlogOptions[EQL3_Player].OnlyLevelsInLog = 0;
1348 end
1349 end
1350  
1351 function EQL3_Toggle_HideCompletedObjectives()
1352 if (this:GetChecked() == 1) then
1353 QuestlogOptions[EQL3_Player].RemoveCompletedObjectives = 1;
1354 else
1355 QuestlogOptions[EQL3_Player].RemoveCompletedObjectives = 0;
1356 end
1357 QuestWatch_Update();
1358 end
1359  
1360  
1361 -- new to3.5.9
1362  
1363 function EQL3_Toggle_ShowItemTooltip()
1364 if (this:GetChecked() == 1) then
1365 QuestlogOptions[EQL3_Player].ItemTooltip = 1;
1366 else
1367 QuestlogOptions[EQL3_Player].ItemTooltip = 0;
1368 end
1369 end
1370  
1371  
1372 function EQL3_Toggle_ShowMobTooltip()
1373 if (this:GetChecked() == 1) then
1374 QuestlogOptions[EQL3_Player].MobTooltip = 1;
1375 else
1376 QuestlogOptions[EQL3_Player].MobTooltip = 0;
1377 end
1378 end
1379  
1380 function EQL3_Toggle_InfoOnQuestComplete()
1381 if (this:GetChecked() == 1) then
1382 QuestlogOptions[EQL3_Player].InfoOnQuestCompletion = 1;
1383 LookForCompletedQuests(false)
1384 else
1385 QuestlogOptions[EQL3_Player].InfoOnQuestCompletion = 0;
1386 end
1387 end
1388  
1389 function EQL3_Toggle_CustomTooltipInfoColor()
1390 if (this:GetChecked() == 1) then
1391 QuestlogOptions[EQL3_Player].CustomTooltipColor = 1;
1392 else
1393 QuestlogOptions[EQL3_Player].CustomTooltipColor = 0;
1394 end
1395 end
1396  
1397  
1398  
1399  
1400 -- end
1401  
1402  
1403  
1404  
1405 --;
1406 --
1407 --