vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 --[[
2  
3 MonkeyQuest:
4 Displays your quests for quick viewing.
5  
6 Website: http://wow.visualization.ca/
7 Author: Trentin (monkeymods@gmail.com)
8  
9  
10 Contributors:
11 Celdor
12 - Help with the Quest Log Freeze bug
13  
14 Diungo
15 - Toggle grow direction
16  
17 Pkp
18 - Color Quest Titles the same as the quest level
19  
20 wowpendium.de
21 - German translation
22  
23 MarsMod
24 - Valid player name before the VARIABLES_LOADED event bug
25 - Settings resetting bug
26  
27 --]]
28  
29  
30 function MonkeyQuestInit_LoadConfig()
31  
32 -- double check that we aren't already loaded
33 if (MonkeyQuest.m_bLoaded == true) then
34 -- how did it even get here?
35 return;
36 end
37  
38 -- double check that variables loaded event triggered, if not, exit
39 if (MonkeyQuest.m_bVariablesLoaded == false) then
40 return;
41 end
42  
43 -- add the realm to the "player's name" for the config settings
44 MonkeyQuest.m_strPlayer = GetCVar("realmName").."|"..MonkeyQuest.m_strPlayer;
45  
46 -- check if the variable needs initializing
47 if (not MonkeyQuestConfig) then
48 MonkeyQuestConfig = {};
49 end
50  
51 -- if there's not an entry for this
52 if (not MonkeyQuestConfig[MonkeyQuest.m_strPlayer]) then
53 MonkeyQuestConfig[MonkeyQuest.m_strPlayer] = {};
54 end
55  
56 -- set the defaults if the variables don't exist
57 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bDisplay == nil) then
58 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bDisplay = true;
59 end
60 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor == nil) then
61 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = "ANCHOR_TOPLEFT";
62 end
63 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bObjectives == nil) then
64 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bObjectives = true;
65 end
66 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iAlpha == nil) then
67 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iAlpha = MONKEYQUEST_DEFAULT_ALPHA;
68 end
69 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFrameAlpha == nil) then
70 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFrameAlpha = MONKEYQUEST_DEFAULT_FRAME_ALPHA;
71 end
72 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bMinimized == nil) then
73 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bMinimized = false;
74 end
75 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_aQuestList == nil) then
76 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_aQuestList = {};
77 end
78 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFrameWidth == nil) then
79 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFrameWidth = MONKEYQUEST_DEFAULT_WIDTH;
80 end
81 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowHidden == nil) then
82 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowHidden = false;
83 end
84 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bNoHeaders == nil) then
85 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bNoHeaders = false;
86 end
87 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bAlwaysHeaders == nil) then
88 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bAlwaysHeaders = false;
89 end
90 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bNoBorder == nil) then
91 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bNoBorder = false;
92 end
93 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bGrowUp == nil) then
94 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bGrowUp = false;
95 end
96 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowNumQuests == nil) then
97 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowNumQuests = false;
98 end
99 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bLocked == nil) then
100 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bLocked = false;
101 end
102 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideCompletedQuests == nil) then
103 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideCompletedQuests = false;
104 end
105 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideCompletedObjectives == nil) then
106 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideCompletedObjectives = false;
107 end
108 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bAllowRightClick == nil) then
109 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bAllowRightClick = true;
110 end
111 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowTooltipObjectives == nil) then
112 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowTooltipObjectives = true;
113 end
114 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideTitleButtons == nil) then
115 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideTitleButtons = false;
116 end
117 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideTitle == nil) then
118 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideTitle = false;
119 end
120  
121 -- colour config vars
122 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bColourTitle == nil) then
123 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bColourTitle = false;
124 end
125 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strQuestTitleColour == nil) then
126 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strQuestTitleColour = MONKEYQUEST_DEFAULT_QUESTTITLECOLOUR;
127 end
128 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strHeaderOpenColour == nil) then
129 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strHeaderOpenColour = MONKEYQUEST_DEFAULT_HEADEROPENCOLOUR;
130 end
131 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strHeaderClosedColour == nil) then
132 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strHeaderClosedColour = MONKEYQUEST_DEFAULT_HEADERCLOSEDCOLOUR;
133 end
134 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strOverviewColour == nil) then
135 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strOverviewColour = MONKEYQUEST_DEFAULT_OVERVIEWCOLOUR;
136 end
137 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strSpecialObjectiveColour == nil) then
138 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strSpecialObjectiveColour = MONKEYQUEST_DEFAULT_SPECIALOBJECTIVECOLOUR;
139 end
140 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strInitialObjectiveColour == nil) then
141 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strInitialObjectiveColour = MONKEYQUEST_DEFAULT_INITIALOBJECTIVECOLOUR;
142 end
143 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strMidObjectiveColour == nil) then
144 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strMidObjectiveColour = MONKEYQUEST_DEFAULT_MIDOBJECTIVECOLOUR;
145 end
146 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strCompleteObjectiveColour == nil) then
147 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strCompleteObjectiveColour = MONKEYQUEST_DEFAULT_COMPLETEOBJECTIVECOLOUR;
148 end
149 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strZoneHighlightColour == nil) then
150 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strZoneHighlightColour = MONKEYQUEST_DEFAULT_ZONEHILIGHTCOLOUR;
151 end
152  
153 -- font configs
154 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFontHeight == nil) then
155 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFontHeight = 12;
156 end
157  
158 -- Skinny font
159 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bCrashFont == nil) then
160 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bCrashFont = false;
161 end
162  
163 -- Golden border
164 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bCrashBorder == nil) then
165 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bCrashBorder = false;
166 end
167  
168 -- Noob tips
169 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowNoobTips == nil) then
170 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowNoobTips = MONKEYQUEST_DEFAULT_SHOWNOOBTIPS;
171 end
172  
173 -- quest padding
174 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iQuestPadding == nil) then
175 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iQuestPadding = MONKEYQUEST_DEFAULT_QUESTPADDING;
176 end
177  
178 -- show zone highlight
179 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowZoneHighlight == nil) then
180 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowZoneHighlight = MONKEYQUEST_DEFAULT_SHOWZONEHIGHLIGHT;
181 end
182  
183 -- show quest levels in MonkeyQuest frame
184 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowQuestLevel == nil) then
185 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowQuestLevel = MONKEYQUEST_DEFAULT_SHOWQUESTLEVEL;
186 end
187  
188 -- BIB vars
189 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bLockBIB == nil) then
190 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bLockBIB = false;
191 end
192  
193 -- force unlocked from bib if there is no bib
194 if (not IsAddOnLoaded("BhaldieInfoBar") and MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bLockBIB == true) then
195 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bLockBIB = false;
196 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = "ANCHOR_TOPLEFT";
197 end
198  
199 -- All variables are loaded now
200 MonkeyQuest.m_bLoaded = true;
201  
202 -- finally apply the settings
203 MonkeyQuestInit_ApplySettings();
204  
205 -- Let the user know the mod is loaded
206 if (DEFAULT_CHAT_FRAME) then
207 DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_LOADED_MSG);
208 end
209 end
210  
211 function MonkeyQuestInit_CleanQuestList()
212 -- make sure the hidden array is ready to go
213 local iNumEntries, iNumQuests = GetNumQuestLogEntries();
214  
215 -- Remember the currently selected quest log entry
216 local tmpQuestLogSelection = GetQuestLogSelection();
217  
218 MonkeyQuest.m_iNumEntries = iNumEntries;
219  
220 -- go through the quest list and m_aQuestList is initialized
221 for i = 1, iNumEntries, 1 do
222 -- strQuestLogTitleText the title text of the quest, may be a header (ex. Wetlands)
223 -- strQuestLevel the level of the quest
224 -- strQuestTag the tag on the quest (ex. COMPLETED)
225 local strQuestLogTitleText, strQuestLevel, strQuestTag, isHeader, isCollapsed, isComplete = GetQuestLogTitle(i);
226  
227 MonkeyQuest.m_aQuestList[strQuestLogTitleText] = {};
228  
229 -- put the entry in the hidden list if it's not there already
230 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_aQuestList[strQuestLogTitleText] == nil) then
231 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_aQuestList[strQuestLogTitleText] = {};
232 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_aQuestList[strQuestLogTitleText].m_bChecked = true;
233 end
234  
235 MonkeyQuest.m_aQuestList[strQuestLogTitleText].m_bChecked =
236 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_aQuestList[strQuestLogTitleText].m_bChecked;
237 end
238  
239 -- clean up the config hidden list
240 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_aQuestList = nil;
241 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_aQuestList = {};
242  
243  
244 -- delete the objective list, we're about to rebuild it
245 MonkeyQuest.m_aQuestItemList = nil;
246 MonkeyQuest.m_aQuestItemList = {};
247  
248  
249 -- go through the quest list one more time and copy the entries from the temp list to the real list.
250 -- this gets rid of any list entries for quests the user doesn't have
251 for i = 1, iNumEntries, 1 do
252 -- strQuestLogTitleText the title text of the quest, may be a header (ex. Wetlands)
253 -- strQuestLevel the level of the quest
254 -- strQuestTag the tag on the quest (ex. COMPLETED)
255 local strQuestLogTitleText, strQuestLevel, strQuestTag, isHeader, isCollapsed, isComplete = GetQuestLogTitle(i);
256  
257 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_aQuestList[strQuestLogTitleText] = {};
258 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_aQuestList[strQuestLogTitleText].m_bChecked =
259 MonkeyQuest.m_aQuestList[strQuestLogTitleText].m_bChecked;
260  
261  
262 -- Select the quest log entry for other functions like GetNumQuestLeaderBoards()
263 SelectQuestLogEntry(i);
264  
265 -- here's a good place to create the objective list
266 if (GetNumQuestLeaderBoards() > 0) then
267 for ii = 1, GetNumQuestLeaderBoards(), 1 do
268 --local string = getglobal("QuestLogObjective"..ii);
269 local strLeaderBoardText, strType, iFinished = GetQuestLogLeaderBoard(ii);
270  
271 MonkeyQuest_AddQuestItemToList(strLeaderBoardText);
272 end
273 end
274 end
275  
276 -- Restore the currently quest log selection
277 SelectQuestLogEntry(tmpQuestLogSelection);
278  
279 -- kill it
280 MonkeyQuest.m_aQuestList = nil;
281 end
282  
283 function MonkeyQuestInit_ResetConfig()
284  
285 -- reset all the config variables to the defaults, but keep the hidden list intact
286 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bDisplay = true;
287 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bDefaultAnchor = false;
288 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = "ANCHOR_TOPLEFT";
289 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bObjectives = true;
290 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iAlpha = MONKEYQUEST_DEFAULT_ALPHA;
291 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFrameAlpha = MONKEYQUEST_DEFAULT_FRAME_ALPHA;
292 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bMinimized = false;
293 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFrameWidth = MONKEYQUEST_DEFAULT_WIDTH;
294 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowHidden = false;
295 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bNoHeaders = false;
296 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bNoBorder = false;
297 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bGrowUp = false;
298 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFrameLeft = MONKEYQUEST_DEFAULT_LEFT;
299 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFrameTop = MONKEYQUEST_DEFAULT_TOP;
300 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFrameBottom = MONKEYQUEST_DEFAULT_BOTTOM;
301 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowNumQuests = false;
302 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bLocked = false;
303 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideCompletedQuests = false;
304 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideCompletedObjectives = false;
305 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bAllowRightClick = true;
306 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowTooltipObjectives = true;
307 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideTitleButtons = false;
308 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideTitle = false;
309  
310 -- colours
311 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strQuestTitleColour = MONKEYQUEST_DEFAULT_QUESTTITLECOLOUR;
312 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strHeaderOpenColour = MONKEYQUEST_DEFAULT_HEADEROPENCOLOUR;
313 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strHeaderClosedColour = MONKEYQUEST_DEFAULT_HEADERCLOSEDCOLOUR;
314 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strOverviewColour = MONKEYQUEST_DEFAULT_OVERVIEWCOLOUR;
315 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strSpecialObjectiveColour = MONKEYQUEST_DEFAULT_SPECIALOBJECTIVECOLOUR;
316 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strMidObjectiveColour = MONKEYQUEST_DEFAULT_MIDOBJECTIVECOLOUR;
317 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strInitialObjectiveColour = MONKEYQUEST_DEFAULT_INITIALOBJECTIVECOLOUR;
318 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strCompleteObjectiveColour = MONKEYQUEST_DEFAULT_COMPLETEOBJECTIVECOLOUR;
319 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strZoneHighlightColour = MONKEYQUEST_DEFAULT_ZONEHILIGHTCOLOUR;
320  
321 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFontHeight = 12;
322 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bCrashFont = false;
323  
324 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bCrashBorder = false;
325  
326 -- noob tips
327 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowNoobTips = MONKEYQUEST_DEFAULT_SHOWNOOBTIPS;
328  
329 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iQuestPadding = MONKEYQUEST_DEFAULT_QUESTPADDING;
330  
331 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowZoneHighlight = MONKEYQUEST_DEFAULT_SHOWZONEHIGHLIGHT;
332 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowQuestLevel = MONKEYQUEST_DEFAULT_SHOWQUESTLEVEL;
333  
334 -- BhaldieInfoBar
335 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bLockBIB = false;
336  
337 -- finally apply the settings
338 MonkeyQuestInit_ApplySettings();
339 end
340  
341 function MonkeyQuestInit_Font(bCrashFont)
342  
343 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bCrashFont = bCrashFont;
344  
345 if (bCrashFont) then
346  
347 -- change the fonts
348 --MonkeyQuestTitleText:SetFont("Interface\\AddOns\\MonkeyLibrary\\Fonts\\adventure.ttf", MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFontHeight + 2);
349 MonkeyQuestInit_SetButtonFonts("Interface\\AddOns\\MonkeyLibrary\\Fonts\\myriapsc.ttf", MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFontHeight);
350  
351 else
352 -- Default look
353  
354 -- change the fonts
355 MonkeyQuestInit_SetButtonFonts("Interface\\AddOns\\MonkeyLibrary\\Fonts\\framd.ttf", MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFontHeight);
356 --MonkeyQuestTitleText:SetFont("Fonts\\FRIZQT__.TTF", MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFontHeight + 2);
357 end
358  
359 -- check for MonkeyBuddy
360 if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
361 MonkeyBuddyQuestFrame_Refresh();
362 end
363 end
364  
365 function MonkeyQuestInit_Border(bCrashBorder)
366  
367 MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bCrashBorder = bCrashBorder;
368  
369 if (bCrashBorder) then
370  
371 -- change the border colour
372 MonkeyQuest.m_colourBorder.r = MONKEYQUEST_DEFAULT_CRASHCOLOUR.r;
373 MonkeyQuest.m_colourBorder.g = MONKEYQUEST_DEFAULT_CRASHCOLOUR.g;
374 MonkeyQuest.m_colourBorder.b = MONKEYQUEST_DEFAULT_CRASHCOLOUR.b;
375  
376 else
377 -- Default look
378 -- change the border colour
379 MonkeyQuest.m_colourBorder.r = TOOLTIP_DEFAULT_COLOR.r;
380 MonkeyQuest.m_colourBorder.g = TOOLTIP_DEFAULT_COLOR.g;
381 MonkeyQuest.m_colourBorder.b = TOOLTIP_DEFAULT_COLOR.b;
382  
383 end
384  
385 -- set the border
386 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bNoBorder == true) then
387 MonkeyQuestFrame:SetBackdropBorderColor(0.0, 0.0, 0.0, 0.0);
388 else
389 MonkeyQuestFrame:SetBackdropBorderColor(MonkeyQuest.m_colourBorder.r, MonkeyQuest.m_colourBorder.g, MonkeyQuest.m_colourBorder.b, 1.0);
390 end
391  
392 -- check for MonkeyBuddy
393 if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
394 MonkeyBuddyQuestFrame_Refresh();
395 end
396 end
397  
398 function MonkeyQuestInit_SetButtonFonts(strFontName, iFontHeight)
399  
400 local i = 0;
401  
402 -- set the font for all buttons
403 for i = 1, MonkeyQuest.m_iNumQuestButtons, 1 do
404 getglobal("MonkeyQuestButton" .. i .. "Text"):SetFont(strFontName, iFontHeight);
405 end
406 end
407  
408 function MonkeyQuestInit_ApplySettings()
409  
410 -- init the look
411 MonkeyQuestInit_Font(MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bCrashFont);
412 MonkeyQuestInit_Border(MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bCrashBorder);
413  
414 -- show or hide the main frame
415 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bDisplay == true) then
416 MonkeyQuestFrame:Show();
417 else
418 MonkeyQuestFrame:Hide();
419 end
420  
421 -- make sure the minimize button has the right texture
422 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bMinimized == true) then
423 MonkeyQuestMinimizeButton:SetNormalTexture("Interface\\AddOns\\MonkeyLibrary\\Textures\\MinimizeButton-Down");
424 else
425 MonkeyQuestMinimizeButton:SetNormalTexture("Interface\\AddOns\\MonkeyLibrary\\Textures\\MinimizeButton-Up");
426 end
427  
428 -- show or hide the title buttons
429 MonkeyQuestSlash_CmdHideTitleButtons(MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideTitleButtons);
430  
431 -- set the alpha
432 MonkeyQuest_SetAlpha(MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iAlpha);
433 MonkeyQuest_SetFrameAlpha(MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFrameAlpha);
434  
435 -- set the border
436 if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bNoBorder == true) then
437 MonkeyQuestFrame:SetBackdropBorderColor(0.0, 0.0, 0.0, 0.0);
438 else
439 MonkeyQuestFrame:SetBackdropBorderColor(MonkeyQuest.m_colourBorder.r, MonkeyQuest.m_colourBorder.g, MonkeyQuest.m_colourBorder.b, 1.0);
440 end
441  
442 -- set the width
443 MonkeyQuestFrame:SetWidth(MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFrameWidth);
444  
445 -- set the quest padding
446 MonkeyQuestSlash_CmdSetQuestPadding(MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iQuestPadding);
447  
448 -- finally refresh the quest list
449 MonkeyQuest_Refresh();
450  
451 -- check for MonkeyBuddy
452 if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
453 MonkeyBuddyQuestFrame_Refresh();
454 end
455 end