vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | -- ## Loading function for the main frames. |
2 | function TitanBG_Menu_LoadMenuFrames() |
||
3 | |||
4 | -- GENERAL |
||
5 | TitanBG_Menu_Header_General:SetText(TITANBG_COLOR_BLUE .. TITANBG_MENU_GENERAL_OPTIONS); |
||
6 | |||
7 | UIDropDownMenu_SetText(TITANBG_MENU_GENERAL_OPTIONS, TitanBG_Menu_DD_General); |
||
8 | TitanBG_Menu_DD_GeneralText:SetFontObject("GameFontNormalSmall"); |
||
9 | TitanBG_Menu_DD_GeneralMiddle:SetWidth(540); |
||
10 | |||
11 | -- BATTLEGROUND |
||
12 | TitanBG_Menu_Header_General_Battleground:SetText(TITANBG_COLOR_GREEN .. CHAT_MSG_BATTLEGROUND); |
||
13 | |||
14 | UIDropDownMenu_SetText(CHAT_MSG_BATTLEGROUND, TitanBG_Menu_DD_General_Battleground); |
||
15 | TitanBG_Menu_DD_General_BattlegroundText:SetFontObject("GameFontNormalSmall"); |
||
16 | TitanBG_Menu_DD_General_BattlegroundMiddle:SetWidth(520); |
||
17 | |||
18 | -- INTERFACE |
||
19 | TitanBG_Menu_Header_General_Interface:SetText(TITANBG_COLOR_GREEN .. TITANBG_MENU_HEADER_INTERFACE); |
||
20 | |||
21 | UIDropDownMenu_SetText(TITANBG_MENU_HEADER_INTERFACE, TitanBG_Menu_DD_General_Interface); |
||
22 | TitanBG_Menu_DD_General_InterfaceText:SetFontObject("GameFontNormalSmall"); |
||
23 | TitanBG_Menu_DD_General_InterfaceMiddle:SetWidth(520); |
||
24 | |||
25 | UIDropDownMenu_SetText(TITANBG_MENU_PLAYWHICHSOUND, TitanBG_Menu_DD_General_Interface_WhichSound); |
||
26 | TitanBG_Menu_DD_General_Interface_WhichSoundMiddle:SetWidth(520); |
||
27 | |||
28 | -- DISPLAY |
||
29 | TitanBG_Menu_Header_Display:SetText(TITANBG_COLOR_BLUE .. TITANBG_MENU_DISP_OPTIONS); |
||
30 | |||
31 | UIDropDownMenu_SetText(TITANBG_MENU_DISP_OPTIONS, TitanBG_Menu_DD_Display); |
||
32 | TitanBG_Menu_DD_DisplayText:SetFontObject("GameFontNormalSmall"); |
||
33 | TitanBG_Menu_DD_DisplayMiddle:SetWidth(540); |
||
34 | |||
35 | -- WORLD |
||
36 | TitanBG_Menu_Header_Display_World:SetText(TITANBG_COLOR_GREEN .. TITANBG_MENU_HEADER_WORLD); |
||
37 | |||
38 | UIDropDownMenu_SetText(TITANBG_MENU_BUTTON_OPTIONS, TitanBG_Menu_DD_Display_World_Button); |
||
39 | TitanBG_Menu_DD_Display_World_ButtonText:SetFontObject("GameFontNormalSmall"); |
||
40 | TitanBG_Menu_DD_Display_World_ButtonMiddle:SetWidth(158); |
||
41 | |||
42 | UIDropDownMenu_SetText(TITANBG_MENU_TT_OPTIONS, TitanBG_Menu_DD_Display_World_Tooltip); |
||
43 | TitanBG_Menu_DD_Display_World_TooltipText:SetFontObject("GameFontNormalSmall"); |
||
44 | TitanBG_Menu_DD_Display_World_TooltipMiddle:SetWidth(158); |
||
45 | |||
46 | UIDropDownMenu_SetText(TITANBG_MENU_POPUP_OPTIONS, TitanBG_Menu_DD_Display_World_Popup); |
||
47 | TitanBG_Menu_DD_Display_World_PopupText:SetFontObject("GameFontNormalSmall"); |
||
48 | TitanBG_Menu_DD_Display_World_PopupMiddle:SetWidth(158); |
||
49 | |||
50 | -- BATTLEGROUND |
||
51 | TitanBG_Menu_Header_Display_Battleground:SetText(TITANBG_COLOR_GREEN .. CHAT_MSG_BATTLEGROUND); |
||
52 | |||
53 | UIDropDownMenu_SetText(TITANBG_MENU_BUTTON_OPTIONS, TitanBG_Menu_DD_Display_Battleground_Button); |
||
54 | TitanBG_Menu_DD_Display_Battleground_ButtonText:SetFontObject("GameFontNormalSmall"); |
||
55 | TitanBG_Menu_DD_Display_Battleground_ButtonMiddle:SetWidth(158); |
||
56 | |||
57 | UIDropDownMenu_SetText(TITANBG_MENU_TT_OPTIONS, TitanBG_Menu_DD_Display_Battleground_Tooltip); |
||
58 | TitanBG_Menu_DD_Display_Battleground_TooltipText:SetFontObject("GameFontNormalSmall"); |
||
59 | TitanBG_Menu_DD_Display_Battleground_TooltipMiddle:SetWidth(158); |
||
60 | |||
61 | UIDropDownMenu_SetText(TITANBG_MENU_PANEL_OPTIONS, TitanBG_Menu_DD_Display_Battleground_Panel); |
||
62 | TitanBG_Menu_DD_Display_Battleground_PanelText:SetFontObject("GameFontNormalSmall"); |
||
63 | TitanBG_Menu_DD_Display_Battleground_PanelMiddle:SetWidth(158); |
||
64 | |||
65 | end |
||
66 | |||
67 | -- ## Hides and shows the options menu. |
||
68 | function TitanBG_Menu_Toggle() |
||
69 | if (TitanBG_Menu:IsVisible()) then |
||
70 | TitanBG_Menu:Hide(); |
||
71 | else |
||
72 | TitanBG_Menu:Show(); |
||
73 | end |
||
74 | |||
75 | CloseDropDownMenus(); |
||
76 | end |
||
77 | |||
78 | -- ## GENERAL |
||
79 | |||
80 | function TitanBG_Menu_DropDownInit_General() |
||
81 | info = {}; |
||
82 | info.keepShownOnClick = 1; |
||
83 | |||
84 | info.text = TITANBG_MENU_OVERWRITESIMILAR; |
||
85 | info.value = "I_OverwriteOtherSettings"; |
||
86 | info.func = TitanPanelTitanBG_MenuToggleOverwriteSettings; |
||
87 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
88 | UIDropDownMenu_AddButton(info); |
||
89 | end |
||
90 | |||
91 | function TitanBG_Menu_DropDownInit_General_Battleground() |
||
92 | info = {}; |
||
93 | info.keepShownOnClick = 1; |
||
94 | |||
95 | info.text = TITANBG_MENU_AUTOJOIN; |
||
96 | info.value = "B_AutoJoinBG"; |
||
97 | info.func = TitanPanelTitanBG_MenuToggleAutoJoin; |
||
98 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
99 | UIDropDownMenu_AddButton(info); |
||
100 | |||
101 | info.text = TITANBG_MENU_AUTOLEAVE; |
||
102 | info.value = "B_AutoLeaveBG"; |
||
103 | info.func = TitanPanelTitanBG_MenuToggleAutoLeave; |
||
104 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
105 | UIDropDownMenu_AddButton(info); |
||
106 | |||
107 | TitanBG_Menu_AddDropDownSpacer(); |
||
108 | |||
109 | info.text = TITANBG_MENU_AUTORELEASE; |
||
110 | info.value = "B_AutoRelease"; |
||
111 | info.func = TitanPanelTitanBG_MenuClicked; |
||
112 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
113 | UIDropDownMenu_AddButton(info); |
||
114 | |||
115 | info.text = TITANBG_MENU_RELEASECHECK; |
||
116 | info.value = "B_ReleaseCheck"; |
||
117 | info.func = TitanPanelTitanBG_MenuClicked; |
||
118 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
119 | UIDropDownMenu_AddButton(info); |
||
120 | end |
||
121 | |||
122 | function TitanBG_Menu_DropDownInit_General_Interface() |
||
123 | info = {}; |
||
124 | info.keepShownOnClick = 1; |
||
125 | |||
126 | info.text = TITANBG_MENU_HIDEMINIMAPBUTTON; |
||
127 | info.value = "B_HideMinimapButton"; |
||
128 | info.func = TitanPanelTitanBG_MenuToggleMinimapIcon; |
||
129 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
130 | UIDropDownMenu_AddButton(info); |
||
131 | |||
132 | info.text = TITANBG_MENU_AUTOSHOWBATTLEMAP; |
||
133 | info.value = "B_AutoShowBGMinimap"; |
||
134 | info.func = TitanPanelTitanBG_MenuToggleBattlegroundMinimap; |
||
135 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
136 | UIDropDownMenu_AddButton(info); |
||
137 | |||
138 | TitanBG_Menu_AddDropDownSpacer(); |
||
139 | |||
140 | info.text = TITANBG_MENU_HIDEJOINPOPUP; |
||
141 | info.value = "B_HideJoinPopup"; |
||
142 | info.func = TitanPanelTitanBG_MenuHideBattlegroundReadyPopup; |
||
143 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
144 | UIDropDownMenu_AddButton(info); |
||
145 | |||
146 | info.text = TITANBG_MENU_REPEATSOUND; |
||
147 | info.value = "D_S_RepeatSound"; |
||
148 | info.func = TitanPanelTitanBG_MenuClicked; |
||
149 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
150 | UIDropDownMenu_AddButton(info); |
||
151 | end |
||
152 | |||
153 | function TitanBG_Menu_DropDownInit_General_Interface_WhichSound() |
||
154 | info = {}; |
||
155 | |||
156 | info.text = NONE; |
||
157 | info.value = "D_S_Sound"; |
||
158 | info.arg1 = "D_S_PlayWhatSound"; |
||
159 | info.arg2 = 0; |
||
160 | info.func = TitanPanelTitanBG_MenuChangeSoundOnReady; |
||
161 | if (sv_menu[info.arg1] == info.arg2) then info.checked = 1; else info.checked = nil; end |
||
162 | UIDropDownMenu_AddButton(info); |
||
163 | |||
164 | info.text = TITANBG_SOUNDS_BGWARNING[1].name; |
||
165 | info.value = "D_S_Sound"; |
||
166 | info.arg1 = "D_S_PlayWhatSound"; |
||
167 | info.arg2 = 1; |
||
168 | info.func = TitanPanelTitanBG_MenuChangeSoundOnReady; |
||
169 | if (sv_menu[info.arg1] == info.arg2) then info.checked = 1; else info.checked = nil; end |
||
170 | UIDropDownMenu_AddButton(info); |
||
171 | |||
172 | TitanBG_Menu_AddDropDownSpacer(); |
||
173 | |||
174 | for i = 2, table.getn(TITANBG_SOUNDS_BGWARNING) do |
||
175 | info.text = TITANBG_SOUNDS_BGWARNING[i].name; |
||
176 | info.value = "D_S_Sound"; |
||
177 | info.arg1 = "D_S_PlayWhatSound"; |
||
178 | info.arg2 = i; |
||
179 | info.func = TitanPanelTitanBG_MenuChangeSoundOnReady; |
||
180 | if (sv_menu[info.arg1] == info.arg2) then info.checked = 1; else info.checked = nil; end |
||
181 | |||
182 | UIDropDownMenu_AddButton(info); |
||
183 | end |
||
184 | end |
||
185 | |||
186 | -- ## DISPLAY |
||
187 | |||
188 | function TitanBG_Menu_DropDownInit_Display() |
||
189 | info = {}; |
||
190 | info.keepShownOnClick = 1; |
||
191 | |||
192 | info.text = TITANBG_MENU_B_SPACERS; |
||
193 | info.value = "D_B_Spacers"; |
||
194 | info.func = TitanPanelTitanBG_MenuClicked; |
||
195 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
196 | UIDropDownMenu_AddButton(info); |
||
197 | end |
||
198 | |||
199 | function TitanBG_Menu_DropDownInit_Display_World_Button() |
||
200 | info = {}; |
||
201 | info.keepShownOnClick = 1; |
||
202 | |||
203 | info.text = TITANBG_MENU_B_TIME; |
||
204 | info.value = "D_B_Time"; |
||
205 | info.func = TitanPanelTitanBG_MenuClicked; |
||
206 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
207 | UIDropDownMenu_AddButton(info); |
||
208 | |||
209 | info.text = TITANBG_MENU_B_TIMELEFT; |
||
210 | info.value = "D_B_QueueExpire"; |
||
211 | info.func = TitanPanelTitanBG_MenuClicked; |
||
212 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
213 | UIDropDownMenu_AddButton(info); |
||
214 | end |
||
215 | |||
216 | function TitanBG_Menu_DropDownInit_Display_World_Tooltip() |
||
217 | info = {}; |
||
218 | info.keepShownOnClick = 1; |
||
219 | |||
220 | info.text = TITANBG_MENU_TT_QUEUETIMERS; |
||
221 | info.value = "D_TT_QueueTimers"; |
||
222 | info.func = TitanPanelTitanBG_MenuClicked; |
||
223 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
224 | UIDropDownMenu_AddButton(info); |
||
225 | |||
226 | info.text = TITANBG_MENU_TT_REMBGSOPEN; |
||
227 | info.value = "D_TT_RememberOpenBgs"; |
||
228 | info.func = TitanPanelTitanBG_MenuClicked; |
||
229 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
230 | UIDropDownMenu_AddButton(info); |
||
231 | end |
||
232 | |||
233 | function TitanBG_Menu_DropDownInit_Display_World_Popup() |
||
234 | info = {}; |
||
235 | info.keepShownOnClick = 1; |
||
236 | |||
237 | info.text = TITANBG_MENU_POPUP_EXPIRE; |
||
238 | info.value = "D_POP_QueueExpire"; |
||
239 | info.func = TitanPanelTitanBG_MenuClicked; |
||
240 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
241 | UIDropDownMenu_AddButton(info); |
||
242 | end |
||
243 | |||
244 | function TitanBG_Menu_DropDownInit_Display_Battleground_Button() |
||
245 | info = {}; |
||
246 | info.keepShownOnClick = 1; |
||
247 | |||
248 | info.text = TITANBG_PANEL_HIDEACTIVE; |
||
249 | info.value = "B_ReplaceActive"; |
||
250 | info.func = TitanPanelTitanBG_MenuClicked; |
||
251 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
252 | UIDropDownMenu_AddButton(info); |
||
253 | |||
254 | TitanBG_Menu_AddDropDownSpacer(); |
||
255 | |||
256 | info.text = TITANBG_PANEL_P; |
||
257 | info.value = "D_B_Players"; |
||
258 | info.func = TitanPanelTitanBG_MenuClicked; |
||
259 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
260 | UIDropDownMenu_AddButton(info); |
||
261 | |||
262 | info.text = TITANBG_PANEL_S; |
||
263 | info.value = "D_B_Standing"; |
||
264 | info.func = TitanPanelTitanBG_MenuClicked; |
||
265 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
266 | UIDropDownMenu_AddButton(info); |
||
267 | |||
268 | info.text = TITANBG_PANEL_K; |
||
269 | info.value = "D_B_Kills"; |
||
270 | info.func = TitanPanelTitanBG_MenuClicked; |
||
271 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
272 | UIDropDownMenu_AddButton(info); |
||
273 | |||
274 | info.text = TITANBG_PANEL_KB; |
||
275 | info.value = "D_B_KillingBlows"; |
||
276 | info.func = TitanPanelTitanBG_MenuClicked; |
||
277 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
278 | UIDropDownMenu_AddButton(info); |
||
279 | |||
280 | info.text = TITANBG_PANEL_D; |
||
281 | info.value = "D_B_Deaths"; |
||
282 | info.func = TitanPanelTitanBG_MenuClicked; |
||
283 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
284 | UIDropDownMenu_AddButton(info); |
||
285 | |||
286 | info.text = TITANBG_PANEL_H; |
||
287 | info.value = "D_B_Honor"; |
||
288 | info.func = TitanPanelTitanBG_MenuClicked; |
||
289 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
290 | UIDropDownMenu_AddButton(info); |
||
291 | end |
||
292 | |||
293 | function TitanBG_Menu_DropDownInit_Display_Battleground_Tooltip() |
||
294 | info = {}; |
||
295 | info.keepShownOnClick = 1; |
||
296 | |||
297 | info.text = TITANBG_MENU_TT_TWOTOOLTIPS; |
||
298 | info.value = "D_BG_SeperateActiveQueue"; |
||
299 | info.func = TitanPanelTitanBG_MenuClicked; |
||
300 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
301 | UIDropDownMenu_AddButton(info); |
||
302 | |||
303 | TitanBG_Menu_AddDropDownSpacer(); |
||
304 | |||
305 | info.text = TITANBG_MENU_SHOWCAPTURE; |
||
306 | info.value = "D_TT_Capture"; |
||
307 | info.func = TitanPanelTitanBG_MenuClicked; |
||
308 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
309 | UIDropDownMenu_AddButton(info); |
||
310 | |||
311 | info.text = TITANBG_MENU_TT_AB_WINESTIMATE; |
||
312 | info.value = "D_TT_ABWinEstimates"; |
||
313 | info.func = TitanPanelTitanBG_MenuClicked; |
||
314 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
315 | UIDropDownMenu_AddButton(info); |
||
316 | |||
317 | info.text = TITANBG_MENU_TT_WSG_FLAG; |
||
318 | info.value = "D_TT_FlagTracker"; |
||
319 | info.func = TitanPanelTitanBG_MenuClicked; |
||
320 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
321 | UIDropDownMenu_AddButton(info); |
||
322 | |||
323 | TitanBG_Menu_AddDropDownSpacer(); |
||
324 | |||
325 | info.text = TITANBG_MENU_SHOWSTATS; |
||
326 | info.value = "D_TT_PlayerStats"; |
||
327 | info.func = TitanPanelTitanBG_MenuClicked; |
||
328 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
329 | UIDropDownMenu_AddButton(info); |
||
330 | |||
331 | info.text = TITANBG_MENU_SHOWLOCATIONSTATS; |
||
332 | info.value = "D_TT_LocationStats"; |
||
333 | info.func = TitanPanelTitanBG_MenuClicked; |
||
334 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
335 | UIDropDownMenu_AddButton(info); |
||
336 | |||
337 | info.text = TITANBG_MENU_SHOWFRIENDS; |
||
338 | info.value = "D_TT_Friends"; |
||
339 | info.func = TitanPanelTitanBG_MenuClicked; |
||
340 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
341 | UIDropDownMenu_AddButton(info); |
||
342 | end |
||
343 | |||
344 | function TitanBG_Menu_DropDownInit_Display_Battleground_Panel() |
||
345 | info = {}; |
||
346 | info.keepShownOnClick = 1; |
||
347 | |||
348 | info.text = TITANBG_MENU_PANEL_LOCK; |
||
349 | info.value = "D_OS_PanelLock"; |
||
350 | info.func = TitanPanelTitanBG_MenuToggleLockCaptures; |
||
351 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
352 | UIDropDownMenu_AddButton(info); |
||
353 | |||
354 | TitanBG_Menu_AddDropDownSpacer(); |
||
355 | |||
356 | info.text = TITANBG_MENU_PANEL_CAP_SHOW; |
||
357 | info.value = "D_OS_CaptureShow"; |
||
358 | info.func = TitanPanelTitanBG_MenuClicked; |
||
359 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
360 | UIDropDownMenu_AddButton(info); |
||
361 | |||
362 | info.text = TITANBG_MENU_PANEL_CAP_INVERT; |
||
363 | info.value = "D_NT_TimersInvert"; |
||
364 | info.func = TitanPanelTitanBG_MenuClicked; |
||
365 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
366 | UIDropDownMenu_AddButton(info); |
||
367 | |||
368 | TitanBG_Menu_AddDropDownSpacer(); |
||
369 | |||
370 | info.text = TITANBG_MENU_PANEL_WSG_SHOW; |
||
371 | info.value = "D_OS_WSG_Show"; |
||
372 | info.func = TitanPanelTitanBG_MenuClicked; |
||
373 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
374 | UIDropDownMenu_AddButton(info); |
||
375 | |||
376 | info.text = TITANBG_MENU_PANEL_WSG_TEXTCLASS; |
||
377 | info.value = "D_OS_WSG_TextClass"; |
||
378 | info.func = TitanPanelTitanBG_MenuClicked; |
||
379 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
380 | UIDropDownMenu_AddButton(info); |
||
381 | |||
382 | info.text = TITANBG_MENU_PANEL_WSG_COLORCLASS; |
||
383 | info.value = "D_OS_WSG_ColorClass"; |
||
384 | info.func = TitanPanelTitanBG_MenuClicked; |
||
385 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
386 | UIDropDownMenu_AddButton(info); |
||
387 | |||
388 | info.text = TITANBG_MENU_PANEL_WSG_CLICK; |
||
389 | info.value = "D_OS_WSG_Click"; |
||
390 | info.func = TitanPanelTitanBG_MenuToggleClickFlagRunner; |
||
391 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
392 | UIDropDownMenu_AddButton(info); |
||
393 | |||
394 | info.text = TITANBG_MENU_PANEL_WSG_ATTACH; |
||
395 | info.value = "D_OS_WSG_AttachScore"; |
||
396 | info.func = TitanPanelTitanBG_MenuChangeAttachFlagTracker; |
||
397 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
398 | UIDropDownMenu_AddButton(info); |
||
399 | |||
400 | info.text = TITANBG_MENU_PANEL_WSG_INVERT; |
||
401 | info.value = "D_OS_WSG_Invert"; |
||
402 | info.func = TitanPanelTitanBG_MenuInvertFlagTracker; |
||
403 | if (sv_menu[info.value]) then info.checked = 1; else info.checked = nil; end |
||
404 | UIDropDownMenu_AddButton(info); |
||
405 | end |
||
406 | |||
407 | |||
408 | -- ## TITAN MENU |
||
409 | |||
410 | -- ## Creates the titan drop down menu for the addon. |
||
411 | function TitanPanelRightClickMenu_PrepareTitanBGMenu() |
||
412 | local info = {}; |
||
413 | |||
414 | -- First Level Menu |
||
415 | if ( UIDROPDOWNMENU_MENU_LEVEL == 1 or UIDROPDOWNMENU_MENU_LEVEL == nil ) then |
||
416 | TitanPanelTitanBG_MenuAddHeader(TITANBG_MENU_HEADER); |
||
417 | TitanPanelRightClickMenu_AddSpacer(); |
||
418 | |||
419 | -- Show Icon |
||
420 | TitanPanelRightClickMenu_AddToggleIcon(TITAN_TITANBG_ID); |
||
421 | |||
422 | info = {}; |
||
423 | info.text = TITAN_PANEL_MENU_SHOW_LABEL_TEXT; |
||
424 | info.value = "ShowLabelText"; |
||
425 | info.func = TitanPanelTitanBG_MenuClicked; |
||
426 | TitanPanelTitanBG_MenuAddOption(info, nil); |
||
427 | |||
428 | if (_bgs and _bgs.queue and _bgs.queue > 0) then |
||
429 | TitanPanelRightClickMenu_AddSpacer(); |
||
430 | info = {}; |
||
431 | info.text = TITANBG_COLOR_GREEN .. TITANBG_MENU_QUEUE_OPTIONS; |
||
432 | info.value = "QueueOptions"; |
||
433 | TitanPanelTitanBG_MenuAddMenu(info); |
||
434 | end |
||
435 | |||
436 | TitanPanelRightClickMenu_AddSpacer(); |
||
437 | |||
438 | info = {}; |
||
439 | info.text = TITANBG_COLOR_BLUE .. TITANBG_MENU_SHOW_OPTIONS; |
||
440 | info.value = "ShowMainMenu"; |
||
441 | info.func = TitanBG_Menu_Toggle; |
||
442 | TitanPanelTitanBG_MenuAddOption(info, nil, false); |
||
443 | |||
444 | -- Hide |
||
445 | TitanPanelRightClickMenu_AddSpacer(); |
||
446 | TitanPanelRightClickMenu_AddCommand(TITAN_PANEL_MENU_HIDE, TITAN_TITANBG_ID, TITAN_PANEL_MENU_FUNC_HIDE); |
||
447 | |||
448 | -- Second Level Menu |
||
449 | elseif ( UIDROPDOWNMENU_MENU_LEVEL == 2 ) then |
||
450 | if ( UIDROPDOWNMENU_MENU_VALUE == "QueueOptions" ) then |
||
451 | local active_bgs = 0; |
||
452 | |||
453 | -- Loop through and check on the status of the battlegrounds. |
||
454 | for i = 1, MAX_BATTLEFIELD_QUEUES do |
||
455 | local status, name, id = GetBattlefieldStatus(i); |
||
456 | |||
457 | if (status == TITANBG_BG_STATUS_CONFIRM or status == TITANBG_BG_STATUS_QUEUED) then |
||
458 | active_bgs = active_bgs + 1; |
||
459 | |||
460 | -- If battlegrounds were listed before this one, insert a spacer. |
||
461 | if (active_bgs > 1) then |
||
462 | TitanPanelRightClickMenu_AddSpacer(UIDROPDOWNMENU_MENU_LEVEL); |
||
463 | end |
||
464 | |||
465 | TitanPanelTitanBG_MenuAddHeader(name, UIDROPDOWNMENU_MENU_LEVEL); |
||
466 | end |
||
467 | |||
468 | if (status == TITANBG_BG_STATUS_CONFIRM) then |
||
469 | info = {}; |
||
470 | info.text = ENTER_BATTLE; |
||
471 | info.func = AcceptBattlefieldPort; |
||
472 | info.arg1 = i; |
||
473 | info.arg2 = 1; |
||
474 | UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL); |
||
475 | info = {}; |
||
476 | info.text = LEAVE_QUEUE; |
||
477 | info.func = AcceptBattlefieldPort; |
||
478 | info.arg1 = i; |
||
479 | info.arg2 = nil; |
||
480 | UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL); |
||
481 | |||
482 | elseif (status == TITANBG_BG_STATUS_QUEUED) then |
||
483 | info = {}; |
||
484 | info.text = CHANGE_INSTANCE; |
||
485 | info.func = ShowBattlefieldList; |
||
486 | info.arg1 = i; |
||
487 | UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL); |
||
488 | info = {}; |
||
489 | info.text = LEAVE_QUEUE; |
||
490 | info.func = AcceptBattlefieldPort; |
||
491 | info.arg1 = i; |
||
492 | info.arg2 = nil; |
||
493 | UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL); |
||
494 | end |
||
495 | end |
||
496 | end |
||
497 | end |
||
498 | |||
499 | return; |
||
500 | end |
||
501 | |||
502 | -- ## Adds a new drop down menu to the menu. |
||
503 | function TitanPanelTitanBG_MenuAddMenu(info, level) |
||
504 | info.hasArrow = 1; |
||
505 | UIDropDownMenu_AddButton(info, level); |
||
506 | end |
||
507 | |||
508 | |||
509 | -- ## Adds a new header to the menu. |
||
510 | function TitanPanelTitanBG_MenuAddHeader(title, level) |
||
511 | info = {}; |
||
512 | info.text = title; |
||
513 | info.notClickable = 1; |
||
514 | info.isTitle = 1; |
||
515 | UIDropDownMenu_AddButton(info, level); |
||
516 | end |
||
517 | |||
518 | |||
519 | -- ## Adds a new option to the menu. |
||
520 | function TitanPanelTitanBG_MenuAddOption(info, level, show) |
||
521 | if (show == nil) then |
||
522 | info.keepShownOnClick = 1; |
||
523 | else |
||
524 | info.keepShownOnClick = show; |
||
525 | end |
||
526 | |||
527 | if (sv_menu[info.value]) then info.checked = 1; end |
||
528 | UIDropDownMenu_AddButton(info, level); |
||
529 | end |
||
530 | |||
531 | -- ## Adds a spacer to the drop down menu. |
||
532 | function TitanBG_Menu_AddDropDownSpacer() |
||
533 | local info = {}; |
||
534 | info.disabled = 1; |
||
535 | UIDropDownMenu_AddButton(info); |
||
536 | end |
||
537 | |||
538 | |||
539 | -- ## Called when a menu item is clicked and requires action. |
||
540 | function TitanPanelTitanBG_MenuClicked() |
||
541 | TitanPanelTitanBG_MenuToggleVar(this.value); |
||
542 | end |
||
543 | |||
544 | |||
545 | -- ## Toggles a specified variable in the menu, changing it from true to false and vice versa. |
||
546 | -- ## |
||
547 | -- ## Variables |
||
548 | -- ## value: The value that UIDROPDOWNMENU_MENU_VALUE is set to when the button is clicked. |
||
549 | function TitanPanelTitanBG_MenuToggleVar(value) |
||
550 | if (sv_menu[value]) then |
||
551 | sv_menu[value] = false; |
||
552 | else |
||
553 | sv_menu[value] = true; |
||
554 | end |
||
555 | end |
||
556 | |||
557 | |||
558 | -- ## Locks and unlocks the on screen capture timers. |
||
559 | function TitanPanelTitanBG_MenuToggleLockCaptures() |
||
560 | TitanPanelTitanBG_MenuToggleVar(this.value); |
||
561 | TitanPanelTitanBG_ToggleLockCaptures(); |
||
562 | end |
||
563 | |||
564 | |||
565 | -- ## Toggles showing of the mimimap bg icon. |
||
566 | function TitanPanelTitanBG_MenuToggleMinimapIcon() |
||
567 | TitanPanelTitanBG_MenuToggleVar(this.value); |
||
568 | TitanPanelTitanBG_ToggleMiniMapIcon(); |
||
569 | end |
||
570 | |||
571 | |||
572 | -- ## Toggles showing of the battleground minimap. |
||
573 | function TitanPanelTitanBG_MenuToggleBattlegroundMinimap() |
||
574 | TitanPanelTitanBG_MenuToggleVar(this.value); |
||
575 | TitanPanelTitanBG_ToggleBattlefieldMinimap(); |
||
576 | end |
||
577 | |||
578 | |||
579 | -- ## Toggles hiding of the battelground ready popup. |
||
580 | function TitanPanelTitanBG_MenuHideBattlegroundReadyPopup() |
||
581 | TitanPanelTitanBG_MenuToggleVar(this.value); |
||
582 | TitanPanelTitanBG_HideBattlegroundReadyPopup(); |
||
583 | end |
||
584 | |||
585 | |||
586 | -- ## Toggles the auto joining of the battleground. |
||
587 | function TitanPanelTitanBG_MenuToggleAutoJoin() |
||
588 | TitanPanelTitanBG_MenuToggleVar(this.value); |
||
589 | |||
590 | _autojoin_bg = ""; |
||
591 | _autojoin_time = 0; |
||
592 | _autojoin_paused = 0; |
||
593 | end |
||
594 | |||
595 | |||
596 | -- ## Toggles the auto leaving of the battleground. |
||
597 | function TitanPanelTitanBG_MenuToggleAutoLeave() |
||
598 | TitanPanelTitanBG_MenuToggleVar(this.value); |
||
599 | |||
600 | _autoleave_time = 0; |
||
601 | _autoleave_paused = 0; |
||
602 | end |
||
603 | |||
604 | |||
605 | -- ## Toggles overwriting similar settings from other addons. |
||
606 | function TitanPanelTitanBG_MenuToggleOverwriteSettings() |
||
607 | TitanPanelTitanBG_MenuToggleVar(this.value); |
||
608 | TitanPanelTitanBG_ToggleOverwriteOtherSettings(); |
||
609 | end |
||
610 | |||
611 | |||
612 | -- ## Changes what sound will be played when the battleground is ready. |
||
613 | function TitanPanelTitanBG_MenuChangeSoundOnReady() |
||
614 | sv_menu[this.arg1] = this.arg2; |
||
615 | |||
616 | if (this.arg2 > 0) then |
||
617 | if (sv_menu[this.arg1] == 1) then |
||
618 | PlaySound("PVPTHROUGHQUEUE", true); |
||
619 | else |
||
620 | PlaySoundFile(TITANBG_SOUNDS_BGWARNING[this.arg2].file); |
||
621 | end |
||
622 | end |
||
623 | end |
||
624 | |||
625 | |||
626 | -- ## Enables and disables click targetting of the flag runners. |
||
627 | function TitanPanelTitanBG_MenuToggleClickFlagRunner() |
||
628 | TitanPanelTitanBG_MenuToggleVar(this.value); |
||
629 | TitanPanelTitanBG_ToggleClickFlagRunner(); |
||
630 | end |
||
631 | |||
632 | |||
633 | -- ## Changes attach position of the flag tracker frames. |
||
634 | function TitanPanelTitanBG_MenuInvertFlagTracker() |
||
635 | TitanPanelTitanBG_MenuToggleVar(this.value); |
||
636 | TitanPanelTitanBG_InvertFlagTracker(); |
||
637 | end |
||
638 | |||
639 | |||
640 | -- ## Changes attach position of the flag tracker frames. |
||
641 | function TitanPanelTitanBG_MenuChangeAttachFlagTracker() |
||
642 | TitanPanelTitanBG_MenuToggleVar(this.value); |
||
643 | TitanPanelTitanBG_ChangeAttachFlagTracker(); |
||
644 | end |