· 2 years ago · Jan 23, 2023, 04:30 AM
1--
2-- Newb Dev Box 4 Wrath
3-- Version: NDB4Wrath 2.1.3.4
4-- Author: Walkerbo
5-- Email: walkerbo.saurfang@gmail.com
6-- Date: Friday 2 September 2022
7--
8
9-- I have tried to name variables, functions, frames, and buttons to be descriptive
10
11-- ===================================================================================================
12-- ===================================================================================================
13-- =========================== Metrics, Lists & Variables ===========================
14-- ===================================================================================================
15-- ===================================================================================================
16
17local addonName = "Newb Dev Box 4 Wrath"
18local versionNumber = "NDB4Wrath 2.1.3.4"
19
20local ListOfDevAddons = {
21 "BugSack",
22 "REHack",
23 "ViragDevTool",
24 "WowLua",
25 "APIInterface",
26 "HandleIt",
27 "WhatsOnTheMap",
28 "Cube",
29 "AddonUsage"
30}
31
32local bugsackFunctions = _G["BugSack"] -- set a local reference to bugsack
33
34local SortedNewbDevBoxButtonTable = {}
35
36local stringNewbDevBox, -- default strings
37 stringKeyBindings,
38 stringToggleFrame,
39 stringReload,
40 stringLogout,
41 stringFStack,
42 stringETrace,
43 stringChatLog,
44 stringCombatLog,
45 stringClearChat,
46 stringChatSpacer,
47 stringETraceStart,
48 stringETraceStop,
49 stringExit,
50 stringBugSack,
51 stringBugSackClear,
52 stringWoWLuaButton,
53 stringREHackButton,
54 stringViragDevTool,
55 stringAPIInterface,
56 stringHandleIt,
57 stringVersion,
58 stringVersionPrint,
59 stringFrameScale,
60 stringFrameOpacity,
61 stringWhatsOnTheMapButton,
62 stringCubeCodeButton,
63 stringCubeBrowserButton,
64 stringAddonUsageButton =
65 "Newb Dev Box",
66 "Keybindings",
67 "Toggle Frame",
68 "Reload",
69 "Logout",
70 "FStack",
71 "ETrace",
72 "Chat Log",
73 "Combat Log",
74 "Clear Chat",
75 "Chat Spacer",
76 "ETrace Start",
77 "ETrace Stop",
78 "Exit",
79 "Bug Sack",
80 "Clear Bug Sack",
81 "WoW Lua",
82 "REHack",
83 "Virag Dev Tool",
84 "API Interface",
85 "Handle It",
86 "Version",
87 "Current Version -:",
88 "% Button Box Scale",
89 "% Button Box Opacity",
90 "Whats On The Map",
91 "Cube Code",
92 "Cube Browser",
93 "Addon Usage"
94
95local TextDimensionList = {
96 addonColour = "|cff00ff00", -- rgb(0, 255, 0)
97 disabledTextColour = "|cff918f8e", -- rgb(145, 143, 142)
98 colourBackdrop = {0, 0, 0, 1}, -- rgb(0, 0, 0)
99 colourBorder = {0, 1, 0, 1}, -- rgb(0, 255, 0)
100 checkBoxTextColour = "|cffffd100", -- rgb(255, 209, 0)
101 checkBoxFont = FocusFontSmall,
102 keybindButtonFont = ErrorFont,
103 buttonFont = Game13FontShadow, -- debug -- NumberFontNormal -- NumberFontNormalLarge
104 buttonTemplate = "GameMenuButtonTemplate", -- debug -- BigRedThreeSliceButtonTemplate
105 secureButtonTemplate = "SecureActionButtonTemplate, GameMenuButtonTemplate"
106}
107
108-- =========================== font objects ===========================
109local NewbDevBoxTitle = CreateFont("NewbDevBoxTitle")
110NewbDevBoxTitle:SetFont("Interface\\AddOns\\NewbDevBox\\Files\\OCRAStd.otf", 32, "")
111local NewbDevBoxButton = CreateFont("NewbDevBoxButton")
112NewbDevBoxButton:SetFont("Interface\\AddOns\\NewbDevBox\\Files\\OCRAStd.otf", 16, "")
113
114-- =========================== all the strings ===========================
115local TextStringList = {
116 addonLoaded = TextDimensionList.addonColour .. " *** " .. addonName .. " - " .. versionNumber .. " Loaded *** \n",
117 interfaceTitle = TextDimensionList.addonColour .. stringNewbDevBox,
118 btnAPIInterfaceButton = stringAPIInterface,
119 btnBugSackButton = stringBugSack,
120 btnBugSackClearButton = stringBugSackClear,
121 btnChatLog = stringChatLog,
122 btnChatSpacer = stringChatSpacer,
123 btnClearChat = stringClearChat,
124 btnCombatLog = stringCombatLog,
125 btnETrace = stringETrace,
126 btnEtraceStart = stringETraceStart,
127 btnEtraceStop = stringETraceStop,
128 btnExit = stringExit,
129 btnFStack = stringFStack,
130 btnCubeButton = stringCubeCodeButton,
131 btnCubeBrowserButton = stringCubeBrowserButton,
132 btnHandleIt = stringHandleIt,
133 btnLogout = stringLogout,
134 btnNewbDevBox = stringNewbDevBox,
135 btnREHackButton = stringREHackButton,
136 btnReload = stringReload,
137 btnVersionButton = stringVersion,
138 btnViragDevToolButton = stringViragDevTool,
139 btnWhatsOnTheMapButton = stringWhatsOnTheMapButton,
140 btnWoWLuaButton = stringWoWLuaButton,
141 btnAddonUsageButton = stringAddonUsageButton,
142 cbAddonUsageButton = " " .. stringAddonUsageButton,
143 cbAPIInterfaceButton = " " .. stringAPIInterface,
144 cbBugSackButton = " " .. stringBugSack,
145 cbBugSackClearButton = " " .. stringBugSackClear,
146 cbChatLog = " " .. stringChatLog,
147 cbChatSpacer = " " .. stringChatSpacer,
148 cbClearChat = " " .. stringClearChat,
149 cbCombatLog = " " .. stringCombatLog,
150 cbETrace = " " .. stringETrace,
151 cbEtraceStart = " " .. stringETraceStart,
152 cbEtraceStop = " " .. stringETraceStop,
153 cbExit = " " .. stringExit,
154 cbFStack = " " .. stringFStack,
155 cbCubeCodeButton = " " .. stringCubeCodeButton,
156 cbCubeBrowserButton = " " .. stringCubeBrowserButton,
157 cbHandleIt = " " .. stringHandleIt,
158 cbLogout = " " .. stringLogout,
159 cbREHackButton = " " .. stringREHackButton,
160 cbVersionButton = " " .. stringVersion,
161 cbViragDevToolButton = " " .. stringViragDevTool,
162 cbWhatsOnTheMapButton = " " .. stringWhatsOnTheMapButton,
163 cbWoWLuaButton = " " .. stringWoWLuaButton,
164 printChatSpacer = TextDimensionList.addonColour .. "********************************************************",
165 printVersion = TextDimensionList.addonColour .. stringVersionPrint,
166 textBoxScale = stringFrameScale,
167 textBoxOpacity = stringFrameOpacity,
168 keyBinding = stringKeyBindings,
169 toggleFrame = stringToggleFrame
170}
171
172local NumberList = {
173 actionButtonHeight = 30,
174 actionButtonSideFrameGap = 14,
175 actionButtonSideGap = 6,
176 actionButtonTopGap = -32,
177 actionButtonWidth = 135,
178 buttonFrameDefaultHeight = 83,
179 buttonFrameHeightExpander = 34,
180 buttonFrameTitleButtonWidth = 150,
181 buttonFrameWidth = 440.5,
182 checkBoxElementXGap = 165,
183 checkBoxElementYGap = -55,
184 checkBoxMainSideGap = 35,
185 checkBoxMainTopGap = -70,
186 checkBoxSize = 27,
187 edgeSize = 20,
188 insetSize = 5,
189 keybindingsButtonHeight = 34,
190 keybindingsButtonWidth = 180,
191 scaleTextBoxHeight = 25,
192 scaleTextBoxWidth = 40,
193 scaleTextBoxXGap = 415,
194 textBoxYGap = -10,
195 titleFrameGap = -14,
196 titleFrameHeight = 40,
197 titleFrameWidth = 600
198}
199
200-- =========================== global keybinding Names ===========================
201BINDING_HEADER_NEWBDEVBOXKEYBINDINGTITLE = "- Newb Dev Box -"
202BINDING_NAME_NEWBDEVBOXTOGGLENEWBDEVBOXINTERFACEFRAME = "Toggle NDB Interface Frame"
203BINDING_NAME_NEWBDEVBOXTOGGLENEWBDEVBOXBUTTONFRAME = "Toggle NDB Button Frame"
204
205-- ===================================================================================================
206-- ===================================================================================================
207-- =========================== functions ===========================
208-- ===================================================================================================
209-- ===================================================================================================
210
211local function initialiseLists() -- build lists if they do not already exist
212 if not NewbDevBoxDisplayButtonsList then
213 NewbDevBoxDisplayButtonsList = {
214 [1] = {LogoutButton = true},
215 [2] = {ExitButton = true},
216 [3] = {FStackButton = true},
217 [4] = {ClearChatButton = true},
218 [5] = {ChatSpacerButton = true},
219 [6] = {ETraceButton = true},
220 [7] = {ETraceStartButton = true},
221 [8] = {ETraceStopButton = true},
222 [9] = {ChatLogButton = true},
223 [10] = {CombatLogButton = true},
224 [11] = {VersionButton = true},
225 [12] = {BugSackButton = false},
226 [13] = {BugSackClearButton = false},
227 [14] = {WoWLuaButton = false},
228 [15] = {REHackButton = false},
229 [16] = {ViragDevToolButton = false},
230 [17] = {APIInterfaceButton = false},
231 [18] = {HandleItButton = false},
232 [19] = {WhatsOnTheMapButton = false},
233 [20] = {CubeCodeButton = false},
234 [21] = {CubeBrowserButton = false},
235 [22] = {AddonUsageButton = false}
236 }
237 end
238 if not NewbDevBoxOptionsTable then
239 NewbDevBoxOptionsTable = {
240 ButtonFrameScale = 1,
241 ButtonFrameOpacity = 1,
242 ButtonIsVisable = true
243 }
244 end
245end
246
247local function setUpNewbDevBoxSortedTable()
248 for k in pairs(NewbDevBoxDisplayButtonsList) do -- insert the key of our button table
249 table.insert(SortedNewbDevBoxButtonTable, k)
250 end
251 table.sort(SortedNewbDevBoxButtonTable) -- sort the key values table
252end
253
254local function setCheckBoxesAndButtonFrameMetrics() -- set up the checkboxes and the frame and buttons scale
255 for index = 1, #SortedNewbDevBoxButtonTable do -- loop through the sorting table
256 tableIndex = SortedNewbDevBoxButtonTable[index] -- get the current index
257 tableAtIndex = NewbDevBoxDisplayButtonsList[tableIndex] -- get the table held in the button table index
258 for k, v in pairs(tableAtIndex) do -- loop through the table at index
259 buttonName = _G["NewbDevBoxInterfaceFramecb" .. k] -- this is our current checkbox name
260 if v then -- if true
261 buttonName:SetChecked(true) -- check checkbox
262 end
263 end
264 end
265 NewbDevBoxButtonFrame:SetScale(NewbDevBoxOptionsTable.ButtonFrameScale) -- set the frame scale
266 NewbDevBoxInterfaceFrame.ScaleTextBox:SetNumber(NewbDevBoxOptionsTable.ButtonFrameScale * 100) -- get the scale size and display it
267 NewbDevBoxInterfaceFrame.ScaleTextBox:SetCursorPosition(0)
268 NewbDevBoxButtonFrame:SetAlpha(NewbDevBoxOptionsTable.ButtonFrameOpacity) -- set the frame opacity
269 NewbDevBoxInterfaceFrame.OpacityTextBox:SetNumber(NewbDevBoxOptionsTable.ButtonFrameOpacity * 100) -- get the opacity value and display it
270 NewbDevBoxInterfaceFrame.OpacityTextBox:SetCursorPosition(0)
271 if NewbDevBoxOptionsTable.ButtonIsVisable then -- if the button was visable last time
272 NewbDevBoxButtonFrame:Show()
273 else
274 NewbDevBoxButtonFrame:Hide()
275 end
276end
277
278local function checkOtherAddonsEnabled()
279 for k, v in pairs(ListOfDevAddons) do
280 local name, title, _, enabled = GetAddOnInfo(v)
281 if name == "BugSack" then
282 if enabled then -- if addon is loaded enable checkboxes and remove grey text
283 NewbDevBoxInterfaceFramecbBugSackButton.text:SetText(TextStringList.cbBugSackButton)
284 NewbDevBoxInterfaceFramecbBugSackButton:Enable()
285 NewbDevBoxInterfaceFramecbBugSackClearButton.text:SetText(TextStringList.cbBugSackClearButton)
286 NewbDevBoxInterfaceFramecbBugSackClearButton:Enable()
287 else -- ensure button variables are set to false
288 NewbDevBoxDisplayButtonsList[12].BugSackButton = false
289 NewbDevBoxDisplayButtonsList[13].BugSackClearButton = false
290 end
291 elseif name == "WowLua" then
292 if enabled then
293 NewbDevBoxInterfaceFramecbWoWLuaButton.text:SetText(TextStringList.cbWoWLuaButton)
294 NewbDevBoxInterfaceFramecbWoWLuaButton:Enable()
295 else
296 NewbDevBoxDisplayButtonsList[14].WoWLuaButton = false
297 end
298 elseif name == "REHack" then
299 if enabled then
300 NewbDevBoxInterfaceFramecbREHackButton.text:SetText(TextStringList.cbREHackButton)
301 NewbDevBoxInterfaceFramecbREHackButton:Enable()
302 else
303 NewbDevBoxDisplayButtonsList[15].REHackButton = false
304 end
305 elseif name == "ViragDevTool" then
306 if enabled then
307 NewbDevBoxInterfaceFramecbViragDevToolButton.text:SetText(TextStringList.cbViragDevToolButton)
308 NewbDevBoxInterfaceFramecbViragDevToolButton:Enable()
309 else
310 NewbDevBoxDisplayButtonsList[16].ViragDevToolButton = false
311 end
312 elseif name == "APIInterface" then
313 if enabled then
314 NewbDevBoxInterfaceFramecbAPIInterfaceButton.text:SetText(TextStringList.cbAPIInterfaceButton)
315 NewbDevBoxInterfaceFramecbAPIInterfaceButton:Enable()
316 else
317 NewbDevBoxDisplayButtonsList[17].APIInterfaceButton = false
318 end
319 elseif name == "HandleIt" then
320 if enabled then
321 NewbDevBoxInterfaceFramecbHandleItButton.text:SetText(TextStringList.cbHandleIt)
322 NewbDevBoxInterfaceFramecbHandleItButton:Enable()
323 else
324 NewbDevBoxDisplayButtonsList[18].HandleItButton = false
325 end
326 elseif name == "WhatsOnTheMap" then
327 if enabled then
328 NewbDevBoxInterfaceFramecbWhatsOnTheMapButton.text:SetText(TextStringList.cbWhatsOnTheMapButton)
329 NewbDevBoxInterfaceFramecbWhatsOnTheMapButton:Enable()
330 WhatsOnTheMapDB.empty = true
331 C_Timer.After(
332 .3,
333 function()
334 WhatsOnTheMapFrame:Hide()
335 end
336 )
337 else
338 NewbDevBoxDisplayButtonsList[19].WhatsOnTheMapButton = false
339 end
340 elseif name == "Cube" then
341 if enabled then
342 NewbDevBoxInterfaceFramecbCubeCodeButton.text:SetText(TextStringList.cbCubeCodeButton)
343 NewbDevBoxInterfaceFramecbCubeCodeButton:Enable()
344 NewbDevBoxInterfaceFramecbCubeBrowserButton.text:SetText(TextStringList.cbCubeBrowserButton)
345 NewbDevBoxInterfaceFramecbCubeBrowserButton:Enable()
346 else
347 NewbDevBoxDisplayButtonsList[20].CubeCodeButton = false
348 NewbDevBoxDisplayButtonsList[21].CubeBrowserButton = false
349 end
350 elseif name == "AddonUsage" then
351 if enabled then
352 NewbDevBoxInterfaceFramecbAddonUsageButton.text:SetText(TextStringList.cbAddonUsageButton)
353 NewbDevBoxInterfaceFramecbAddonUsageButton:Enable()
354 else
355 NewbDevBoxDisplayButtonsList[22].AddonUsageButton = false
356 end
357 end
358 end
359end
360
361local function buttonFrameButtonLayout()
362 local lastRelative, lastOnTop = NewbDevBoxButtonFrameReloadButton, NewbDevBoxButtonFrameReloadButton
363 local lastCount = 1
364 local buttonFrameHeight = NumberList.buttonFrameDefaultHeight
365 NewbDevBoxButtonFrameLogoutButton:Hide() -- hide all buttons to ensure no ghosting
366 NewbDevBoxButtonFrameExitButton:Hide()
367 NewbDevBoxButtonFrameFStackButton:Hide()
368 NewbDevBoxButtonFrameClearChatButton:Hide()
369 NewbDevBoxButtonFrameChatSpacerButton:Hide()
370 NewbDevBoxButtonFrameETraceButton:Hide()
371 NewbDevBoxButtonFrameETraceStartButton:Hide()
372 NewbDevBoxButtonFrameETraceStopButton:Hide()
373 NewbDevBoxButtonFrameChatLogButton:Hide()
374 NewbDevBoxButtonFrameCombatLogButton:Hide()
375 NewbDevBoxButtonFrameVersionButton:Hide()
376 NewbDevBoxButtonFrameBugSackButton:Hide()
377 NewbDevBoxButtonFrameBugSackClearButton:Hide()
378 NewbDevBoxButtonFrameWoWLuaButton:Hide()
379 NewbDevBoxButtonFrameREHackButton:Hide()
380 NewbDevBoxButtonFrameViragDevToolButton:Hide()
381 NewbDevBoxButtonFrameAPIInterfaceButton:Hide()
382 NewbDevBoxButtonFrameHandleItButton:Hide()
383 NewbDevBoxButtonFrameWhatsOnTheMapButton:Hide()
384 NewbDevBoxButtonFrameCubeCodeButton:Hide()
385 NewbDevBoxButtonFrameCubeBrowserButton:Hide()
386 NewbDevBoxButtonFrameAddonUsageButton:Hide()
387 NewbDevBoxButtonFrame:SetSize(NumberList.buttonFrameWidth, buttonFrameHeight) -- reset frame size
388 for index = 1, #SortedNewbDevBoxButtonTable do -- loop through the sorting table
389 tableIndex = SortedNewbDevBoxButtonTable[index] -- get the current index
390 tableAtIndex = NewbDevBoxDisplayButtonsList[tableIndex] -- get the table held in the button table index
391 for k, v in pairs(tableAtIndex) do -- loop through the table at index
392 if v then
393 thisButton = _G["NewbDevBoxButtonFrame" .. k] -- set this button to the global button name
394 thisButton:ClearAllPoints()
395 thisButton:Show()
396 if mod(lastCount, 3) == 0 then -- when the button count reaches 3
397 thisButton:SetPoint("TOP", lastOnTop, "BOTTOM", 0, -5) -- set the button point to the last top button
398 lastOnTop = thisButton -- set the current button as the lastOnTop button
399 buttonFrameHeight = buttonFrameHeight + NumberList.buttonFrameHeightExpander -- expand the frame to allow another row of buttons
400 NewbDevBoxButtonFrame:SetSize(NumberList.buttonFrameWidth, buttonFrameHeight) -- set the frame size
401 else
402 thisButton:SetPoint("LEFT", lastRelative, "RIGHT", NumberList.actionButtonSideGap, 0) -- set the button point to the last button
403 end
404 lastCount = lastCount + 1 -- increase the lastCount
405 lastRelative = thisButton -- set this button to the lastRelative
406 end
407 end
408 end
409end
410
411local function updateButtonFrameScale(updateScaleNumber)
412 if updateScaleNumber >= 301 then -- if the entered number is too high
413 updateScaleNumber = 300
414 elseif updateScaleNumber <= 49 then -- if the entered number is too low
415 updateScaleNumber = 50
416 end
417 NewbDevBoxOptionsTable.ButtonFrameScale = updateScaleNumber / 100
418 NewbDevBoxButtonFrame:SetScale(NewbDevBoxOptionsTable.ButtonFrameScale)
419 NewbDevBoxInterfaceFrame.ScaleTextBox:SetNumber(updateScaleNumber)
420end
421
422local function updateButtonFrameOpacity(updateOpacityNumber)
423 if updateOpacityNumber >= 101 then -- if the entered number is too high
424 updateOpacityNumber = 100
425 elseif updateOpacityNumber <= 24 then -- if the entered number is too low
426 updateOpacityNumber = 25
427 end
428 NewbDevBoxOptionsTable.ButtonFrameOpacity = updateOpacityNumber / 100
429 NewbDevBoxButtonFrame:SetAlpha(NewbDevBoxOptionsTable.ButtonFrameOpacity)
430 NewbDevBoxInterfaceFrame.OpacityTextBox:SetNumber(updateOpacityNumber)
431end
432
433-- ===================================================================================================
434-- ===================================================================================================
435-- =========================== global functions for keybinds ===========================
436-- ===================================================================================================
437-- ===================================================================================================
438
439-- =========================== toggle newb dev box interface frame ===========================
440function NEWBDEVBOXTOGGLENEWBDEVBOXINTERFACEFRAME()
441 if InterfaceOptionsFrame:IsShown() then
442 InterfaceOptionsFrame:Hide()
443 else
444 InterfaceOptionsFrame_OpenToCategory(NewbDevBoxInterfaceFrame) -- have to do this twice because reasons
445 InterfaceOptionsFrame_OpenToCategory(NewbDevBoxInterfaceFrame)
446 end
447end
448
449-- =========================== toggle new dev box button frame ===========================
450function NEWBDEVBOXTOGGLENEWBDEVBOXBUTTONFRAME()
451 if NewbDevBoxButtonFrame:IsShown() then
452 NewbDevBoxButtonFrame:Hide()
453 else
454 NewbDevBoxButtonFrame:Show()
455 end
456end
457
458-- ===================================================================================================
459-- ===================================================================================================
460-- =========================== slash commands ===========================
461-- ===================================================================================================
462-- ===================================================================================================
463
464-- =========================== toggle newb dev box interface frame ===========================
465SLASH_NEWBDEVBOXI1 = "/NDBI"
466function SlashCmdList.NEWBDEVBOXI(msg, editbox)
467 NEWBDEVBOXTOGGLENEWBDEVBOXINTERFACEFRAME()
468end
469
470-- =========================== toggle new dev box button frame ===========================
471SLASH_NEWBDEVBOXF1 = "/NDBF"
472function SlashCmdList.NEWBDEVBOXF(msg, editbox)
473 NEWBDEVBOXTOGGLENEWBDEVBOXBUTTONFRAME()
474end
475
476-- ===================================================================================================
477-- ===================================================================================================
478-- =========================== Frames ===========================
479-- ===================================================================================================
480-- ===================================================================================================
481
482local NewbDevBoxInterfaceFrame = CreateFrame("Frame", "NewbDevBoxInterfaceFrame", UIParent, "BackdropTemplate")
483NewbDevBoxInterfaceFrame.name = "Newb Dev Box"
484NewbDevBoxInterfaceFrame:SetBackdrop(
485 {
486 bgFile = "Interface\\Buttons\\WHITE8X8",
487 insets = {
488 left = NumberList.insetSize,
489 right = NumberList.insetSize,
490 top = NumberList.insetSize,
491 bottom = NumberList.insetSize
492 },
493 tileSize = nil,
494 tile = false,
495 edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
496 edgeSize = NumberList.edgeSize
497 }
498)
499NewbDevBoxInterfaceFrame:SetBackdropColor(unpack(TextDimensionList.colourBackdrop))
500NewbDevBoxInterfaceFrame:SetBackdropBorderColor(unpack(TextDimensionList.colourBorder))
501NewbDevBoxInterfaceFrame:SetScript(
502 "OnEvent",
503 function(self, event, ...)
504 if event == "PLAYER_LOGIN" then -- fires when a player logs in or reloads
505 print(TextStringList.addonLoaded) -- Load Message
506 initialiseLists()
507 setUpNewbDevBoxSortedTable()
508 checkOtherAddonsEnabled()
509 setCheckBoxesAndButtonFrameMetrics()
510 buttonFrameButtonLayout()
511 end
512 end
513)
514NewbDevBoxInterfaceFrame:RegisterEvent("PLAYER_LOGIN") -- fires when a player logs in or reloads
515NewbDevBoxInterfaceFrame:RegisterEvent("ADDON_LOADED") -- fires when an addon is loaded
516InterfaceOptions_AddCategory(NewbDevBoxInterfaceFrame)
517
518NewbDevBoxInterfaceFrame.TitleBox = CreateFrame("Frame", "NewbDevBoxInterfaceFrameTitleBox", NewbDevBoxInterfaceFrame)
519NewbDevBoxInterfaceFrame.TitleBox:SetSize(NumberList.titleFrameWidth, NumberList.titleFrameHeight)
520NewbDevBoxInterfaceFrame.TitleBox:SetPoint("TOP", NewbDevBoxInterfaceFrame, 0, NumberList.titleFrameGap)
521NewbDevBoxInterfaceFrame.TitleBox.Text =
522 NewbDevBoxInterfaceFrame.TitleBox:CreateFontString("NewbDevBoxInterfaceFrameTitleBoxText")
523NewbDevBoxInterfaceFrame.TitleBox.Text:SetAllPoints(NewbDevBoxInterfaceFrameTitleBox)
524NewbDevBoxInterfaceFrame.TitleBox.Text:SetFontObject(NewbDevBoxTitle)
525NewbDevBoxInterfaceFrame.TitleBox.Text:SetText(TextStringList.interfaceTitle)
526
527NewbDevBoxInterfaceFrame.KeybindsButton =
528 CreateFrame(
529 "Button",
530 "NewbDevBoxInterfaceFrameKeybindsButton",
531 NewbDevBoxInterfaceFrame,
532 "BackdropTemplate",
533 "UIMenuButtonStretchTemplate"
534)
535NewbDevBoxInterfaceFrame.KeybindsButton:SetSize(NumberList.keybindingsButtonWidth, NumberList.keybindingsButtonHeight)
536NewbDevBoxInterfaceFrame.KeybindsButton:SetPoint(
537 "TOPLEFT",
538 NewbDevBoxInterfaceFrame,
539 "TOPLEFT",
540 NumberList.scaleTextBoxXGap,
541 NumberList.checkBoxMainTopGap
542)
543NewbDevBoxInterfaceFrame.KeybindsButton:SetBackdrop(
544 {
545 bgFile = nil,
546 insets = nil,
547 tileSize = nil,
548 tile = nil,
549 edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
550 edgeSize = NumberList.edgeSize
551 }
552)
553NewbDevBoxInterfaceFrame.KeybindsButton:SetBackdropBorderColor(unpack(TextDimensionList.colourBorder))
554NewbDevBoxInterfaceFrame.KeybindsButton:SetNormalFontObject(TextDimensionList.keybindButtonFont)
555NewbDevBoxInterfaceFrame.KeybindsButton:SetHighlightFontObject(TextDimensionList.keybindButtonFont)
556NewbDevBoxInterfaceFrame.KeybindsButton:SetText(TextStringList.keyBinding)
557NewbDevBoxInterfaceFrame.KeybindsButton:SetScript(
558 "OnClick",
559 function()
560 GameMenuButtonKeybindings:Click("RightButton")
561 KeyBindingFrame:Show()
562 for _, v in pairs(KeyBindingFrame.categoryList.buttons) do
563 if v:GetText() == "Walkerbo's Addons" or v:GetText() == "WALKERBO'S ADDONS" then
564 v:Click()
565 end
566 end
567 end
568)
569
570NewbDevBoxInterfaceFrame.ToggleFrameButton =
571 CreateFrame(
572 "Button",
573 "NewbDevBoxInterfaceFrameToggleFrameButton",
574 NewbDevBoxInterfaceFrame,
575 "BackdropTemplate",
576 "UIMenuButtonStretchTemplate"
577)
578NewbDevBoxInterfaceFrame.ToggleFrameButton:SetSize(
579 NumberList.keybindingsButtonWidth,
580 NumberList.keybindingsButtonHeight
581)
582NewbDevBoxInterfaceFrame.ToggleFrameButton:SetPoint(
583 "TOPLEFT",
584 NewbDevBoxInterfaceFrameKeybindsButton,
585 "BOTTOMLEFT",
586 0,
587 NumberList.textBoxYGap
588)
589NewbDevBoxInterfaceFrame.ToggleFrameButton:SetBackdrop(
590 {
591 bgFile = nil,
592 insets = nil,
593 tileSize = nil,
594 tile = nil,
595 edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
596 edgeSize = NumberList.edgeSize
597 }
598)
599NewbDevBoxInterfaceFrame.ToggleFrameButton:SetBackdropBorderColor(unpack(TextDimensionList.colourBorder))
600NewbDevBoxInterfaceFrame.ToggleFrameButton:SetNormalFontObject(TextDimensionList.keybindButtonFont)
601NewbDevBoxInterfaceFrame.ToggleFrameButton:SetHighlightFontObject(TextDimensionList.keybindButtonFont)
602NewbDevBoxInterfaceFrame.ToggleFrameButton:SetText(TextStringList.toggleFrame)
603NewbDevBoxInterfaceFrame.ToggleFrameButton:SetScript(
604 "OnClick",
605 function()
606 if NewbDevBoxButtonFrame:IsShown() then
607 NewbDevBoxButtonFrame:Hide()
608 else
609 NewbDevBoxButtonFrame:Show()
610 end
611 end
612)
613
614NewbDevBoxInterfaceFrame.ScaleTextBox =
615 CreateFrame("EditBox", "NewbDevBoxInterfaceFrameScaleTextBox", NewbDevBoxInterfaceFrame, "OptionsBoxTemplate")
616NewbDevBoxInterfaceFrame.ScaleTextBox:SetPoint(
617 "TOPLEFT",
618 NewbDevBoxInterfaceFrameToggleFrameButton,
619 "BOTTOMLEFT",
620 0,
621 NumberList.textBoxYGap
622)
623NewbDevBoxInterfaceFrame.ScaleTextBox:SetFontObject(TextDimensionList.checkBoxFont)
624NewbDevBoxInterfaceFrame.ScaleTextBox:SetNumeric(true)
625NewbDevBoxInterfaceFrame.ScaleTextBox:SetSize(NumberList.scaleTextBoxWidth, NumberList.scaleTextBoxHeight)
626NewbDevBoxInterfaceFrame.ScaleTextBox:SetMaxLetters(3)
627NewbDevBoxInterfaceFrame.ScaleTextBox:SetAutoFocus()
628NewbDevBoxInterfaceFrame.ScaleTextBox:SetJustifyH("CENTER")
629NewbDevBoxInterfaceFrame.ScaleTextBox:SetScript(
630 "OnEnterPressed",
631 function(self)
632 scaleNumber = tonumber(NewbDevBoxInterfaceFrame.ScaleTextBox:GetText())
633 self:ClearFocus()
634 updateButtonFrameScale(scaleNumber)
635 end
636)
637NewbDevBoxInterfaceFrame.ScaleTextBox.Text =
638 NewbDevBoxInterfaceFrame:CreateFontString("NewbDevBoxInterfaceFrameScaleTextBoxText")
639NewbDevBoxInterfaceFrame.ScaleTextBox.Text:SetPoint("LEFT", NewbDevBoxInterfaceFrameScaleTextBox, "RIGHT")
640NewbDevBoxInterfaceFrame.ScaleTextBox.Text:SetFontObject(TextDimensionList.checkBoxFont)
641NewbDevBoxInterfaceFrame.ScaleTextBox.Text:SetText(TextStringList.textBoxScale)
642
643NewbDevBoxInterfaceFrame.OpacityTextBox =
644 CreateFrame("EditBox", "NewbDevBoxInterfaceFrameOpacityTextBox", NewbDevBoxInterfaceFrame, "OptionsBoxTemplate")
645NewbDevBoxInterfaceFrame.OpacityTextBox:SetPoint(
646 "TOP",
647 NewbDevBoxInterfaceFrameScaleTextBox,
648 "BOTTOM",
649 0,
650 NumberList.textBoxYGap
651)
652NewbDevBoxInterfaceFrame.OpacityTextBox:SetFontObject(TextDimensionList.checkBoxFont)
653NewbDevBoxInterfaceFrame.OpacityTextBox:SetNumeric(true)
654NewbDevBoxInterfaceFrame.OpacityTextBox:SetSize(NumberList.scaleTextBoxWidth, NumberList.scaleTextBoxHeight)
655NewbDevBoxInterfaceFrame.OpacityTextBox:SetMaxLetters(3)
656NewbDevBoxInterfaceFrame.OpacityTextBox:SetAutoFocus()
657NewbDevBoxInterfaceFrame.OpacityTextBox:SetJustifyH("CENTER")
658NewbDevBoxInterfaceFrame.OpacityTextBox:SetScript(
659 "OnEnterPressed",
660 function(self)
661 opacityNumber = tonumber(NewbDevBoxInterfaceFrame.OpacityTextBox:GetText())
662 self:ClearFocus()
663 updateButtonFrameOpacity(opacityNumber)
664 end
665)
666NewbDevBoxInterfaceFrame.OpacityTextBox.Text =
667 NewbDevBoxInterfaceFrame:CreateFontString("NewbDevBoxInterfaceFrameOpacityTextBoxText")
668NewbDevBoxInterfaceFrame.OpacityTextBox.Text:SetPoint("LEFT", NewbDevBoxInterfaceFrameOpacityTextBox, "RIGHT")
669NewbDevBoxInterfaceFrame.OpacityTextBox.Text:SetFontObject(TextDimensionList.checkBoxFont)
670NewbDevBoxInterfaceFrame.OpacityTextBox.Text:SetText(TextStringList.textBoxOpacity)
671
672-- =========================== newb dev box checkboxes ===========================
673local NewbDevBoxInterfaceFramecbLogoutButton =
674 CreateFrame(
675 "CheckButton",
676 "NewbDevBoxInterfaceFramecbLogoutButton",
677 NewbDevBoxInterfaceFrame,
678 "UICheckButtonTemplate"
679)
680NewbDevBoxInterfaceFramecbLogoutButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
681NewbDevBoxInterfaceFramecbLogoutButton:SetPoint(
682 "TOPLEFT",
683 NewbDevBoxInterfaceFrame,
684 "TOPLEFT",
685 NumberList.checkBoxMainSideGap,
686 NumberList.checkBoxMainTopGap
687)
688NewbDevBoxInterfaceFramecbLogoutButton.text:SetFontObject(TextDimensionList.checkBoxFont)
689NewbDevBoxInterfaceFramecbLogoutButton.text:SetText(TextStringList.cbLogout)
690NewbDevBoxInterfaceFramecbLogoutButton:SetScript(
691 "OnClick",
692 function()
693 if NewbDevBoxDisplayButtonsList[1].LogoutButton then
694 NewbDevBoxDisplayButtonsList[1].LogoutButton = false
695 else
696 NewbDevBoxDisplayButtonsList[1].LogoutButton = true
697 end
698 buttonFrameButtonLayout()
699 end
700)
701
702local NewbDevBoxInterfaceFramecbExitButton =
703 CreateFrame(
704 "CheckButton",
705 "NewbDevBoxInterfaceFramecbExitButton",
706 NewbDevBoxInterfaceFrame,
707 "UICheckButtonTemplate"
708)
709NewbDevBoxInterfaceFramecbExitButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
710NewbDevBoxInterfaceFramecbExitButton:SetPoint(
711 "BOTTOMLEFT",
712 NewbDevBoxInterfaceFramecbLogoutButton,
713 "TOPLEFT",
714 0,
715 NumberList.checkBoxElementYGap
716)
717NewbDevBoxInterfaceFramecbExitButton.text:SetFontObject(TextDimensionList.checkBoxFont)
718NewbDevBoxInterfaceFramecbExitButton.text:SetText(TextStringList.cbExit)
719NewbDevBoxInterfaceFramecbExitButton:SetScript(
720 "OnClick",
721 function()
722 if NewbDevBoxDisplayButtonsList[2].ExitButton then
723 NewbDevBoxDisplayButtonsList[2].ExitButton = false
724 else
725 NewbDevBoxDisplayButtonsList[2].ExitButton = true
726 end
727 buttonFrameButtonLayout()
728 end
729)
730
731local NewbDevBoxInterfaceFramecbFStackButton =
732 CreateFrame(
733 "CheckButton",
734 "NewbDevBoxInterfaceFramecbFStackButton",
735 NewbDevBoxInterfaceFrame,
736 "UICheckButtonTemplate"
737)
738NewbDevBoxInterfaceFramecbFStackButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
739NewbDevBoxInterfaceFramecbFStackButton:SetPoint(
740 "BOTTOMLEFT",
741 NewbDevBoxInterfaceFramecbExitButton,
742 "TOPLEFT",
743 0,
744 NumberList.checkBoxElementYGap
745)
746NewbDevBoxInterfaceFramecbFStackButton.text:SetFontObject(TextDimensionList.checkBoxFont)
747NewbDevBoxInterfaceFramecbFStackButton.text:SetText(TextStringList.cbFStack)
748NewbDevBoxInterfaceFramecbFStackButton:SetScript(
749 "OnClick",
750 function()
751 if NewbDevBoxDisplayButtonsList[3].FStackButton then
752 NewbDevBoxDisplayButtonsList[3].FStackButton = false
753 else
754 NewbDevBoxDisplayButtonsList[3].FStackButton = true
755 end
756 buttonFrameButtonLayout()
757 end
758)
759
760local NewbDevBoxInterfaceFramecbClearChatButton =
761 CreateFrame(
762 "CheckButton",
763 "NewbDevBoxInterfaceFramecbClearChatButton",
764 NewbDevBoxInterfaceFrame,
765 "UICheckButtonTemplate"
766)
767NewbDevBoxInterfaceFramecbClearChatButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
768NewbDevBoxInterfaceFramecbClearChatButton:SetPoint(
769 "BOTTOMLEFT",
770 NewbDevBoxInterfaceFramecbFStackButton,
771 "TOPLEFT",
772 0,
773 NumberList.checkBoxElementYGap
774)
775NewbDevBoxInterfaceFramecbClearChatButton.text:SetFontObject(TextDimensionList.checkBoxFont)
776NewbDevBoxInterfaceFramecbClearChatButton.text:SetText(TextStringList.cbClearChat)
777NewbDevBoxInterfaceFramecbClearChatButton:SetScript(
778 "OnClick",
779 function()
780 if NewbDevBoxDisplayButtonsList[4].ClearChatButton then
781 NewbDevBoxDisplayButtonsList[4].ClearChatButton = false
782 else
783 NewbDevBoxDisplayButtonsList[4].ClearChatButton = true
784 end
785 buttonFrameButtonLayout()
786 end
787)
788
789local NewbDevBoxInterfaceFramecbChatSpacerButton =
790 CreateFrame(
791 "CheckButton",
792 "NewbDevBoxInterfaceFramecbChatSpacerButton",
793 NewbDevBoxInterfaceFrame,
794 "UICheckButtonTemplate"
795)
796NewbDevBoxInterfaceFramecbChatSpacerButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
797NewbDevBoxInterfaceFramecbChatSpacerButton:SetPoint(
798 "BOTTOMLEFT",
799 NewbDevBoxInterfaceFramecbClearChatButton,
800 "TOPLEFT",
801 0,
802 NumberList.checkBoxElementYGap
803)
804NewbDevBoxInterfaceFramecbChatSpacerButton.text:SetFontObject(TextDimensionList.checkBoxFont)
805NewbDevBoxInterfaceFramecbChatSpacerButton.text:SetText(TextStringList.cbChatSpacer)
806NewbDevBoxInterfaceFramecbChatSpacerButton:SetScript(
807 "OnClick",
808 function()
809 if NewbDevBoxDisplayButtonsList[5].ChatSpacerButton then
810 NewbDevBoxDisplayButtonsList[5].ChatSpacerButton = false
811 else
812 NewbDevBoxDisplayButtonsList[5].ChatSpacerButton = true
813 end
814 buttonFrameButtonLayout()
815 end
816)
817
818local NewbDevBoxInterfaceFramecbETraceButton =
819 CreateFrame(
820 "CheckButton",
821 "NewbDevBoxInterfaceFramecbETraceButton",
822 NewbDevBoxInterfaceFrame,
823 "UICheckButtonTemplate"
824)
825NewbDevBoxInterfaceFramecbETraceButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
826NewbDevBoxInterfaceFramecbETraceButton:SetPoint(
827 "BOTTOMLEFT",
828 NewbDevBoxInterfaceFramecbChatSpacerButton,
829 "TOPLEFT",
830 0,
831 NumberList.checkBoxElementYGap
832)
833NewbDevBoxInterfaceFramecbETraceButton.text:SetFontObject(TextDimensionList.checkBoxFont)
834NewbDevBoxInterfaceFramecbETraceButton.text:SetText(TextStringList.cbETrace)
835NewbDevBoxInterfaceFramecbETraceButton:SetScript(
836 "OnClick",
837 function()
838 if NewbDevBoxDisplayButtonsList[6].ETraceButton then
839 NewbDevBoxDisplayButtonsList[6].ETraceButton = false
840 else
841 NewbDevBoxDisplayButtonsList[6].ETraceButton = true
842 end
843 buttonFrameButtonLayout()
844 end
845)
846
847local NewbDevBoxInterfaceFramecbETraceStartButton =
848 CreateFrame(
849 "CheckButton",
850 "NewbDevBoxInterfaceFramecbETraceStartButton",
851 NewbDevBoxInterfaceFrame,
852 "UICheckButtonTemplate"
853)
854NewbDevBoxInterfaceFramecbETraceStartButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
855NewbDevBoxInterfaceFramecbETraceStartButton:SetPoint(
856 "BOTTOMLEFT",
857 NewbDevBoxInterfaceFramecbETraceButton,
858 "TOPLEFT",
859 0,
860 NumberList.checkBoxElementYGap
861)
862NewbDevBoxInterfaceFramecbETraceStartButton.text:SetFontObject(TextDimensionList.checkBoxFont)
863NewbDevBoxInterfaceFramecbETraceStartButton.text:SetText(TextStringList.cbEtraceStart)
864NewbDevBoxInterfaceFramecbETraceStartButton:SetScript(
865 "OnClick",
866 function()
867 if NewbDevBoxDisplayButtonsList[7].ETraceStartButton then
868 NewbDevBoxDisplayButtonsList[7].ETraceStartButton = false
869 else
870 NewbDevBoxDisplayButtonsList[7].ETraceStartButton = true
871 end
872 buttonFrameButtonLayout()
873 end
874)
875
876local NewbDevBoxInterfaceFramecbETraceStopButton =
877 CreateFrame(
878 "CheckButton",
879 "NewbDevBoxInterfaceFramecbETraceStopButton",
880 NewbDevBoxInterfaceFrame,
881 "UICheckButtonTemplate"
882)
883NewbDevBoxInterfaceFramecbETraceStopButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
884NewbDevBoxInterfaceFramecbETraceStopButton:SetPoint(
885 "BOTTOMLEFT",
886 NewbDevBoxInterfaceFramecbETraceStartButton,
887 "TOPLEFT",
888 0,
889 NumberList.checkBoxElementYGap
890)
891NewbDevBoxInterfaceFramecbETraceStopButton.text:SetFontObject(TextDimensionList.checkBoxFont)
892NewbDevBoxInterfaceFramecbETraceStopButton.text:SetText(TextStringList.cbEtraceStop)
893NewbDevBoxInterfaceFramecbETraceStopButton:SetScript(
894 "OnClick",
895 function()
896 if NewbDevBoxDisplayButtonsList[8].ETraceStopButton then
897 NewbDevBoxDisplayButtonsList[8].ETraceStopButton = false
898 else
899 NewbDevBoxDisplayButtonsList[8].ETraceStopButton = true
900 end
901 buttonFrameButtonLayout()
902 end
903)
904
905local NewbDevBoxInterfaceFramecbChatLogButton =
906 CreateFrame(
907 "CheckButton",
908 "NewbDevBoxInterfaceFramecbChatLogButton",
909 NewbDevBoxInterfaceFrame,
910 "UICheckButtonTemplate"
911)
912NewbDevBoxInterfaceFramecbChatLogButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
913NewbDevBoxInterfaceFramecbChatLogButton:SetPoint(
914 "BOTTOMLEFT",
915 NewbDevBoxInterfaceFramecbETraceStopButton,
916 "TOPLEFT",
917 0,
918 NumberList.checkBoxElementYGap
919)
920NewbDevBoxInterfaceFramecbChatLogButton.text:SetFontObject(TextDimensionList.checkBoxFont)
921NewbDevBoxInterfaceFramecbChatLogButton.text:SetText(TextStringList.cbChatLog)
922NewbDevBoxInterfaceFramecbChatLogButton:SetScript(
923 "OnClick",
924 function()
925 if NewbDevBoxDisplayButtonsList[9].ChatLogButton then
926 NewbDevBoxDisplayButtonsList[9].ChatLogButton = false
927 else
928 NewbDevBoxDisplayButtonsList[9].ChatLogButton = true
929 end
930 buttonFrameButtonLayout()
931 end
932)
933
934local NewbDevBoxInterfaceFramecbCombatLogButton =
935 CreateFrame(
936 "CheckButton",
937 "NewbDevBoxInterfaceFramecbCombatLogButton",
938 NewbDevBoxInterfaceFrame,
939 "UICheckButtonTemplate"
940)
941NewbDevBoxInterfaceFramecbCombatLogButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
942NewbDevBoxInterfaceFramecbCombatLogButton:SetPoint(
943 "BOTTOMLEFT",
944 NewbDevBoxInterfaceFramecbChatLogButton,
945 "TOPLEFT",
946 0,
947 NumberList.checkBoxElementYGap
948)
949NewbDevBoxInterfaceFramecbCombatLogButton.text:SetFontObject(TextDimensionList.checkBoxFont)
950NewbDevBoxInterfaceFramecbCombatLogButton.text:SetText(TextStringList.cbCombatLog)
951NewbDevBoxInterfaceFramecbCombatLogButton:SetScript(
952 "OnClick",
953 function()
954 if NewbDevBoxDisplayButtonsList[10].CombatLogButton then
955 NewbDevBoxDisplayButtonsList[10].CombatLogButton = false
956 else
957 NewbDevBoxDisplayButtonsList[10].CombatLogButton = true
958 end
959 buttonFrameButtonLayout()
960 end
961)
962
963local NewbDevBoxInterfaceFramecbVersionButton =
964 CreateFrame(
965 "CheckButton",
966 "NewbDevBoxInterfaceFramecbVersionButton",
967 NewbDevBoxInterfaceFrame,
968 "UICheckButtonTemplate"
969)
970NewbDevBoxInterfaceFramecbVersionButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
971NewbDevBoxInterfaceFramecbVersionButton:SetPoint(
972 "BOTTOMLEFT",
973 NewbDevBoxInterfaceFramecbCombatLogButton,
974 "TOPLEFT",
975 0,
976 NumberList.checkBoxElementYGap
977)
978NewbDevBoxInterfaceFramecbVersionButton.text:SetFontObject(TextDimensionList.checkBoxFont)
979NewbDevBoxInterfaceFramecbVersionButton.text:SetText(TextStringList.cbVersionButton)
980NewbDevBoxInterfaceFramecbVersionButton:SetScript(
981 "OnClick",
982 function()
983 if NewbDevBoxDisplayButtonsList[11].VersionButton then
984 NewbDevBoxDisplayButtonsList[11].VersionButton = false
985 else
986 NewbDevBoxDisplayButtonsList[11].VersionButton = true
987 end
988 buttonFrameButtonLayout()
989 end
990)
991
992-- =========================== other addon checkboxes ===========================
993local NewbDevBoxInterfaceFramecbBugSackButton =
994 CreateFrame(
995 "CheckButton",
996 "NewbDevBoxInterfaceFramecbBugSackButton",
997 NewbDevBoxInterfaceFrame,
998 "UICheckButtonTemplate"
999)
1000NewbDevBoxInterfaceFramecbBugSackButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
1001NewbDevBoxInterfaceFramecbBugSackButton:SetPoint(
1002 "LEFT",
1003 NewbDevBoxInterfaceFramecbLogoutButton,
1004 "RIGHT",
1005 NumberList.checkBoxElementXGap,
1006 0
1007)
1008NewbDevBoxInterfaceFramecbBugSackButton.text:SetFontObject(TextDimensionList.checkBoxFont)
1009NewbDevBoxInterfaceFramecbBugSackButton.text:SetText(
1010 TextDimensionList.disabledTextColour .. TextStringList.cbBugSackButton
1011) -- default grey checkbox text
1012NewbDevBoxInterfaceFramecbBugSackButton:Disable() -- default disable checkbox
1013NewbDevBoxInterfaceFramecbBugSackButton:SetScript(
1014 "OnClick",
1015 function()
1016 if NewbDevBoxDisplayButtonsList[12].BugSackButton then
1017 NewbDevBoxDisplayButtonsList[12].BugSackButton = false
1018 else
1019 NewbDevBoxDisplayButtonsList[12].BugSackButton = true
1020 end
1021 buttonFrameButtonLayout()
1022 end
1023)
1024
1025local NewbDevBoxInterfaceFramecbBugSackClearButton =
1026 CreateFrame(
1027 "CheckButton",
1028 "NewbDevBoxInterfaceFramecbBugSackClearButton",
1029 NewbDevBoxInterfaceFrame,
1030 "UICheckButtonTemplate"
1031)
1032NewbDevBoxInterfaceFramecbBugSackClearButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
1033NewbDevBoxInterfaceFramecbBugSackClearButton:SetPoint(
1034 "BOTTOMLEFT",
1035 NewbDevBoxInterfaceFramecbBugSackButton,
1036 "TOPLEFT",
1037 0,
1038 NumberList.checkBoxElementYGap
1039)
1040NewbDevBoxInterfaceFramecbBugSackClearButton.text:SetFontObject(TextDimensionList.checkBoxFont)
1041NewbDevBoxInterfaceFramecbBugSackClearButton.text:SetText(
1042 TextDimensionList.disabledTextColour .. TextStringList.cbBugSackClearButton
1043) -- default grey checkbox text
1044NewbDevBoxInterfaceFramecbBugSackClearButton:Disable() -- default disable checkbox
1045NewbDevBoxInterfaceFramecbBugSackClearButton:SetScript(
1046 "OnClick",
1047 function()
1048 if NewbDevBoxDisplayButtonsList[13].BugSackClearButton then
1049 NewbDevBoxDisplayButtonsList[13].BugSackClearButton = false
1050 else
1051 NewbDevBoxDisplayButtonsList[13].BugSackClearButton = true
1052 end
1053 buttonFrameButtonLayout()
1054 end
1055)
1056
1057local NewbDevBoxInterfaceFramecbWoWLuaButton =
1058 CreateFrame(
1059 "CheckButton",
1060 "NewbDevBoxInterfaceFramecbWoWLuaButton",
1061 NewbDevBoxInterfaceFrame,
1062 "UICheckButtonTemplate"
1063)
1064NewbDevBoxInterfaceFramecbWoWLuaButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
1065NewbDevBoxInterfaceFramecbWoWLuaButton:SetPoint(
1066 "BOTTOMLEFT",
1067 NewbDevBoxInterfaceFramecbBugSackClearButton,
1068 "TOPLEFT",
1069 0,
1070 NumberList.checkBoxElementYGap
1071)
1072NewbDevBoxInterfaceFramecbWoWLuaButton.text:SetFontObject(TextDimensionList.checkBoxFont)
1073NewbDevBoxInterfaceFramecbWoWLuaButton.text:SetText(
1074 TextDimensionList.disabledTextColour .. TextStringList.cbWoWLuaButton
1075) -- default grey checkbox text
1076NewbDevBoxInterfaceFramecbWoWLuaButton:Disable() -- default disable checkbox
1077NewbDevBoxInterfaceFramecbWoWLuaButton:SetScript(
1078 "OnClick",
1079 function()
1080 if NewbDevBoxDisplayButtonsList[14].WoWLuaButton then
1081 NewbDevBoxDisplayButtonsList[14].WoWLuaButton = false
1082 else
1083 NewbDevBoxDisplayButtonsList[14].WoWLuaButton = true
1084 end
1085 buttonFrameButtonLayout()
1086 end
1087)
1088
1089local NewbDevBoxInterfaceFramecbREHackButton =
1090 CreateFrame(
1091 "CheckButton",
1092 "NewbDevBoxInterfaceFramecbREHackButton",
1093 NewbDevBoxInterfaceFrame,
1094 "UICheckButtonTemplate"
1095)
1096NewbDevBoxInterfaceFramecbREHackButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
1097NewbDevBoxInterfaceFramecbREHackButton:SetPoint(
1098 "BOTTOMLEFT",
1099 NewbDevBoxInterfaceFramecbWoWLuaButton,
1100 "TOPLEFT",
1101 0,
1102 NumberList.checkBoxElementYGap
1103)
1104NewbDevBoxInterfaceFramecbREHackButton.text:SetFontObject(TextDimensionList.checkBoxFont)
1105NewbDevBoxInterfaceFramecbREHackButton.text:SetText(
1106 TextDimensionList.disabledTextColour .. TextStringList.cbREHackButton
1107) -- default grey checkbox text
1108NewbDevBoxInterfaceFramecbREHackButton:Disable() -- default disable checkbox
1109NewbDevBoxInterfaceFramecbREHackButton:SetScript(
1110 "OnClick",
1111 function()
1112 if NewbDevBoxDisplayButtonsList[15].REHackButton then
1113 NewbDevBoxDisplayButtonsList[15].REHackButton = false
1114 else
1115 NewbDevBoxDisplayButtonsList[15].REHackButton = true
1116 end
1117 buttonFrameButtonLayout()
1118 end
1119)
1120
1121local NewbDevBoxInterfaceFramecbViragDevToolButton =
1122 CreateFrame(
1123 "CheckButton",
1124 "NewbDevBoxInterfaceFramecbViragDevToolButton",
1125 NewbDevBoxInterfaceFrame,
1126 "UICheckButtonTemplate"
1127)
1128NewbDevBoxInterfaceFramecbViragDevToolButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
1129NewbDevBoxInterfaceFramecbViragDevToolButton:SetPoint(
1130 "BOTTOMLEFT",
1131 NewbDevBoxInterfaceFramecbREHackButton,
1132 "TOPLEFT",
1133 0,
1134 NumberList.checkBoxElementYGap
1135)
1136NewbDevBoxInterfaceFramecbViragDevToolButton.text:SetFontObject(TextDimensionList.checkBoxFont)
1137NewbDevBoxInterfaceFramecbViragDevToolButton.text:SetText(
1138 TextDimensionList.disabledTextColour .. TextStringList.cbViragDevToolButton
1139) -- default grey checkbox text
1140NewbDevBoxInterfaceFramecbViragDevToolButton:Disable() -- default disable checkbox
1141NewbDevBoxInterfaceFramecbViragDevToolButton:SetScript(
1142 "OnClick",
1143 function()
1144 if NewbDevBoxDisplayButtonsList[16].ViragDevToolButton then
1145 NewbDevBoxDisplayButtonsList[16].ViragDevToolButton = false
1146 else
1147 NewbDevBoxDisplayButtonsList[16].ViragDevToolButton = true
1148 end
1149 buttonFrameButtonLayout()
1150 end
1151)
1152
1153local NewbDevBoxInterfaceFramecbAPIInterfaceButton =
1154 CreateFrame(
1155 "CheckButton",
1156 "NewbDevBoxInterfaceFramecbAPIInterfaceButton",
1157 NewbDevBoxInterfaceFrame,
1158 "UICheckButtonTemplate"
1159)
1160NewbDevBoxInterfaceFramecbAPIInterfaceButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
1161NewbDevBoxInterfaceFramecbAPIInterfaceButton:SetPoint(
1162 "BOTTOMLEFT",
1163 NewbDevBoxInterfaceFramecbViragDevToolButton,
1164 "TOPLEFT",
1165 0,
1166 NumberList.checkBoxElementYGap
1167)
1168NewbDevBoxInterfaceFramecbAPIInterfaceButton.text:SetFontObject(TextDimensionList.checkBoxFont)
1169NewbDevBoxInterfaceFramecbAPIInterfaceButton.text:SetText(
1170 TextDimensionList.disabledTextColour .. TextStringList.cbAPIInterfaceButton
1171) -- default grey checkbox text
1172NewbDevBoxInterfaceFramecbAPIInterfaceButton:Disable() -- default disable checkbox
1173NewbDevBoxInterfaceFramecbAPIInterfaceButton:SetScript(
1174 "OnClick",
1175 function()
1176 if NewbDevBoxDisplayButtonsList[17].APIInterfaceButton then
1177 NewbDevBoxDisplayButtonsList[17].APIInterfaceButton = false
1178 else
1179 NewbDevBoxDisplayButtonsList[17].APIInterfaceButton = true
1180 end
1181 buttonFrameButtonLayout()
1182 end
1183)
1184
1185local NewbDevBoxInterfaceFramecbHandleItButton =
1186 CreateFrame(
1187 "CheckButton",
1188 "NewbDevBoxInterfaceFramecbHandleItButton",
1189 NewbDevBoxInterfaceFrame,
1190 "UICheckButtonTemplate"
1191)
1192NewbDevBoxInterfaceFramecbHandleItButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
1193NewbDevBoxInterfaceFramecbHandleItButton:SetPoint(
1194 "BOTTOMLEFT",
1195 NewbDevBoxInterfaceFramecbAPIInterfaceButton,
1196 "TOPLEFT",
1197 0,
1198 NumberList.checkBoxElementYGap
1199)
1200NewbDevBoxInterfaceFramecbHandleItButton.text:SetFontObject(TextDimensionList.checkBoxFont)
1201NewbDevBoxInterfaceFramecbHandleItButton.text:SetText(TextDimensionList.disabledTextColour .. TextStringList.cbHandleIt) -- default grey checkbox text
1202NewbDevBoxInterfaceFramecbHandleItButton:Disable() -- default disable checkbox
1203NewbDevBoxInterfaceFramecbHandleItButton:SetScript(
1204 "OnClick",
1205 function()
1206 if NewbDevBoxDisplayButtonsList[18].HandleItButton then
1207 NewbDevBoxDisplayButtonsList[18].HandleItButton = false
1208 else
1209 NewbDevBoxDisplayButtonsList[18].HandleItButton = true
1210 end
1211 buttonFrameButtonLayout()
1212 end
1213)
1214
1215local NewbDevBoxInterfaceFramecbWhatsOnTheMapButton =
1216 CreateFrame(
1217 "CheckButton",
1218 "NewbDevBoxInterfaceFramecbWhatsOnTheMapButton",
1219 NewbDevBoxInterfaceFrame,
1220 "UICheckButtonTemplate"
1221)
1222NewbDevBoxInterfaceFramecbWhatsOnTheMapButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
1223NewbDevBoxInterfaceFramecbWhatsOnTheMapButton:SetPoint(
1224 "BOTTOMLEFT",
1225 NewbDevBoxInterfaceFramecbHandleItButton,
1226 "TOPLEFT",
1227 0,
1228 NumberList.checkBoxElementYGap
1229)
1230NewbDevBoxInterfaceFramecbWhatsOnTheMapButton.text:SetFontObject(TextDimensionList.checkBoxFont)
1231NewbDevBoxInterfaceFramecbWhatsOnTheMapButton.text:SetText(
1232 TextDimensionList.disabledTextColour .. TextStringList.cbWhatsOnTheMapButton
1233) -- default grey checkbox text
1234NewbDevBoxInterfaceFramecbWhatsOnTheMapButton:Disable() -- default disable checkbox
1235NewbDevBoxInterfaceFramecbWhatsOnTheMapButton:SetScript(
1236 "OnClick",
1237 function()
1238 if NewbDevBoxDisplayButtonsList[19].WhatsOnTheMapButton then
1239 NewbDevBoxDisplayButtonsList[19].WhatsOnTheMapButton = false
1240 else
1241 NewbDevBoxDisplayButtonsList[19].WhatsOnTheMapButton = true
1242 end
1243 buttonFrameButtonLayout()
1244 end
1245)
1246
1247local NewbDevBoxInterfaceFramecbCubeCodeButton =
1248 CreateFrame(
1249 "CheckButton",
1250 "NewbDevBoxInterfaceFramecbCubeCodeButton",
1251 NewbDevBoxInterfaceFrame,
1252 "UICheckButtonTemplate"
1253)
1254NewbDevBoxInterfaceFramecbCubeCodeButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
1255NewbDevBoxInterfaceFramecbCubeCodeButton:SetPoint(
1256 "BOTTOMLEFT",
1257 NewbDevBoxInterfaceFramecbWhatsOnTheMapButton,
1258 "TOPLEFT",
1259 0,
1260 NumberList.checkBoxElementYGap
1261)
1262NewbDevBoxInterfaceFramecbCubeCodeButton.text:SetFontObject(TextDimensionList.checkBoxFont)
1263NewbDevBoxInterfaceFramecbCubeCodeButton.text:SetText(
1264 TextDimensionList.disabledTextColour .. TextStringList.cbCubeCodeButton
1265) -- default grey checkbox text
1266NewbDevBoxInterfaceFramecbCubeCodeButton:Disable() -- default disable checkbox
1267NewbDevBoxInterfaceFramecbCubeCodeButton:SetScript(
1268 "OnClick",
1269 function()
1270 if NewbDevBoxDisplayButtonsList[20].CubeCodeButton then
1271 NewbDevBoxDisplayButtonsList[20].CubeCodeButton = false
1272 else
1273 NewbDevBoxDisplayButtonsList[20].CubeCodeButton = true
1274 end
1275 buttonFrameButtonLayout()
1276 end
1277)
1278
1279local NewbDevBoxInterfaceFramecbCubeBrowserButton =
1280 CreateFrame(
1281 "CheckButton",
1282 "NewbDevBoxInterfaceFramecbCubeBrowserButton",
1283 NewbDevBoxInterfaceFrame,
1284 "UICheckButtonTemplate"
1285)
1286NewbDevBoxInterfaceFramecbCubeBrowserButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
1287NewbDevBoxInterfaceFramecbCubeBrowserButton:SetPoint(
1288 "BOTTOMLEFT",
1289 NewbDevBoxInterfaceFramecbCubeCodeButton,
1290 "TOPLEFT",
1291 0,
1292 NumberList.checkBoxElementYGap
1293)
1294NewbDevBoxInterfaceFramecbCubeBrowserButton.text:SetFontObject(TextDimensionList.checkBoxFont)
1295NewbDevBoxInterfaceFramecbCubeBrowserButton.text:SetText(
1296 TextDimensionList.disabledTextColour .. TextStringList.cbCubeBrowserButton
1297) -- default grey checkbox text
1298NewbDevBoxInterfaceFramecbCubeBrowserButton:Disable() -- default disable checkbox
1299NewbDevBoxInterfaceFramecbCubeBrowserButton:SetScript(
1300 "OnClick",
1301 function()
1302 if NewbDevBoxDisplayButtonsList[21].CubeBrowserButton then
1303 NewbDevBoxDisplayButtonsList[21].CubeBrowserButton = false
1304 else
1305 NewbDevBoxDisplayButtonsList[21].CubeBrowserButton = true
1306 end
1307 buttonFrameButtonLayout()
1308 end
1309)
1310
1311local NewbDevBoxInterfaceFramecbAddonUsageButton =
1312 CreateFrame(
1313 "CheckButton",
1314 "NewbDevBoxInterfaceFramecbAddonUsageButton",
1315 NewbDevBoxInterfaceFrame,
1316 "UICheckButtonTemplate"
1317)
1318NewbDevBoxInterfaceFramecbAddonUsageButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
1319NewbDevBoxInterfaceFramecbAddonUsageButton:SetPoint(
1320 "BOTTOMLEFT",
1321 NewbDevBoxInterfaceFramecbCubeBrowserButton,
1322 "TOPLEFT",
1323 0,
1324 NumberList.checkBoxElementYGap
1325)
1326NewbDevBoxInterfaceFramecbAddonUsageButton.text:SetFontObject(TextDimensionList.checkBoxFont)
1327NewbDevBoxInterfaceFramecbAddonUsageButton.text:SetText(
1328 TextDimensionList.disabledTextColour .. TextStringList.cbAddonUsageButton
1329) -- default grey checkbox text
1330NewbDevBoxInterfaceFramecbAddonUsageButton:Disable() -- default disable checkbox
1331NewbDevBoxInterfaceFramecbAddonUsageButton:SetScript(
1332 "OnClick",
1333 function()
1334 if NewbDevBoxDisplayButtonsList[22].AddonUsageButton then
1335 NewbDevBoxDisplayButtonsList[22].AddonUsageButton = false
1336 else
1337 NewbDevBoxDisplayButtonsList[22].AddonUsageButton = true
1338 end
1339 buttonFrameButtonLayout()
1340 end
1341)
1342
1343-- ===================================================================================================
1344-- ===================================================================================================
1345-- =========================== button frame ===========================
1346-- ===================================================================================================
1347-- ===================================================================================================
1348
1349local NewbDevBoxButtonFrame = CreateFrame("Frame", "NewbDevBoxButtonFrame", UIParent, "UIPanelDialogTemplate")
1350NewbDevBoxButtonFrame:SetSize(NumberList.buttonFrameWidth, NumberList.buttonFrameDefaultHeight)
1351NewbDevBoxButtonFrame:ClearAllPoints()
1352NewbDevBoxButtonFrame:SetPoint("CENTER")
1353NewbDevBoxButtonFrame:EnableMouse(true)
1354NewbDevBoxButtonFrame:SetMovable(true)
1355NewbDevBoxButtonFrame:SetClampedToScreen(true)
1356NewbDevBoxButtonFrame:RegisterForDrag("RightButton", "LeftButton")
1357NewbDevBoxButtonFrame:SetScript("OnDragStart", NewbDevBoxButtonFrame.StartMoving)
1358NewbDevBoxButtonFrame:SetScript("OnDragStop", NewbDevBoxButtonFrame.StopMovingOrSizing)
1359NewbDevBoxButtonFrame:SetToplevel(true)
1360NewbDevBoxButtonFrame:SetScript(
1361 "OnEnter",
1362 function()
1363 NewbDevBoxButtonFrame:SetAlpha(1)
1364 end
1365)
1366NewbDevBoxButtonFrame:SetScript(
1367 "OnLeave",
1368 function()
1369 NewbDevBoxButtonFrame:SetAlpha(NewbDevBoxOptionsTable.ButtonFrameOpacity)
1370 end
1371)
1372
1373NewbDevBoxButtonFrame.TitleButton = CreateFrame("Button", "NewbDevBoxButtonFrameTitleButton", NewbDevBoxButtonFrame)
1374NewbDevBoxButtonFrame.TitleButton:SetSize(NumberList.buttonFrameTitleButtonWidth, NumberList.actionButtonHeight)
1375NewbDevBoxButtonFrame.TitleButton:SetPoint("TOP", NewbDevBoxButtonFrame, "TOP", 0, -1)
1376NewbDevBoxButtonFrame.TitleButton:SetText(TextDimensionList.addonColour .. TextStringList.btnNewbDevBox)
1377NewbDevBoxButtonFrame.TitleButton:SetNormalFontObject(NewbDevBoxButton)
1378NewbDevBoxButtonFrame.TitleButton:SetHighlightFontObject(NewbDevBoxButton)
1379NewbDevBoxButtonFrame.TitleButton:SetScript(
1380 "OnClick",
1381 function()
1382 NEWBDEVBOXTOGGLENEWBDEVBOXINTERFACEFRAME()
1383 end
1384)
1385
1386NewbDevBoxButtonFrame.ReloadButton =
1387 CreateFrame("Button", "NewbDevBoxButtonFrameReloadButton", NewbDevBoxButtonFrame, TextDimensionList.buttonTemplate)
1388NewbDevBoxButtonFrame.ReloadButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1389NewbDevBoxButtonFrame.ReloadButton:SetPoint(
1390 "TOPLEFT",
1391 NewbDevBoxButtonFrame,
1392 "TOPLEFT",
1393 NumberList.actionButtonSideFrameGap,
1394 NumberList.actionButtonTopGap
1395)
1396
1397NewbDevBoxButtonFrame.ReloadButton:SetText(TextStringList.btnReload)
1398NewbDevBoxButtonFrame.ReloadButton:SetNormalFontObject(TextDimensionList.buttonFont)
1399NewbDevBoxButtonFrame.ReloadButton:SetHighlightFontObject(TextDimensionList.buttonFont)
1400NewbDevBoxButtonFrame.ReloadButton:SetScript(
1401 "OnClick",
1402 function()
1403 ReloadUI()
1404 end
1405)
1406
1407local NewbDevBoxButtonFrameLogoutButton =
1408 CreateFrame(
1409 "Button",
1410 "NewbDevBoxButtonFrameLogoutButton",
1411 NewbDevBoxButtonFrame,
1412 TextDimensionList.secureButtonTemplate
1413)
1414NewbDevBoxButtonFrameLogoutButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1415NewbDevBoxButtonFrameLogoutButton:SetText(TextStringList.btnLogout)
1416NewbDevBoxButtonFrameLogoutButton:SetNormalFontObject(TextDimensionList.buttonFont)
1417NewbDevBoxButtonFrameLogoutButton:SetHighlightFontObject(TextDimensionList.buttonFont)
1418NewbDevBoxButtonFrameLogoutButton:SetAttribute("type", "macro")
1419NewbDevBoxButtonFrameLogoutButton:SetAttribute("macrotext", "/logout")
1420
1421local NewbDevBoxButtonFrameExitButton =
1422 CreateFrame(
1423 "Button",
1424 "NewbDevBoxButtonFrameExitButton",
1425 NewbDevBoxButtonFrame,
1426 TextDimensionList.secureButtonTemplate
1427)
1428NewbDevBoxButtonFrameExitButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1429NewbDevBoxButtonFrameExitButton:SetText(TextStringList.btnExit)
1430NewbDevBoxButtonFrameExitButton:SetNormalFontObject(TextDimensionList.buttonFont)
1431NewbDevBoxButtonFrameExitButton:SetHighlightFontObject(TextDimensionList.buttonFont)
1432NewbDevBoxButtonFrameExitButton:SetAttribute("type", "macro")
1433NewbDevBoxButtonFrameExitButton:SetAttribute("macrotext", "/exit")
1434
1435local NewbDevBoxButtonFrameFStackButton =
1436 CreateFrame("Button", "NewbDevBoxButtonFrameFStackButton", NewbDevBoxButtonFrame, TextDimensionList.buttonTemplate)
1437NewbDevBoxButtonFrameFStackButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1438NewbDevBoxButtonFrameFStackButton:SetText(TextStringList.btnFStack)
1439NewbDevBoxButtonFrameFStackButton:SetNormalFontObject(TextDimensionList.buttonFont)
1440NewbDevBoxButtonFrameFStackButton:SetHighlightFontObject(TextDimensionList.buttonFont)
1441NewbDevBoxButtonFrameFStackButton:SetScript(
1442 "OnClick",
1443 function(self)
1444 if not FrameStackTooltip_Toggle then
1445 LoadAddOn("Blizzard_DebugTools")
1446 end
1447 FrameStackTooltip_Toggle()
1448 end
1449)
1450
1451local NewbDevBoxButtonFrameClearChatButton =
1452 CreateFrame(
1453 "Button",
1454 "NewbDevBoxButtonFrameClearChatButton",
1455 NewbDevBoxButtonFrame,
1456 TextDimensionList.buttonTemplate
1457)
1458NewbDevBoxButtonFrameClearChatButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1459NewbDevBoxButtonFrameClearChatButton:SetText(TextStringList.btnClearChat)
1460NewbDevBoxButtonFrameClearChatButton:SetNormalFontObject(TextDimensionList.buttonFont)
1461NewbDevBoxButtonFrameClearChatButton:SetHighlightFontObject(TextDimensionList.buttonFont)
1462NewbDevBoxButtonFrameClearChatButton:SetScript(
1463 "OnClick",
1464 function()
1465 SELECTED_CHAT_FRAME:Clear()
1466 end
1467)
1468
1469local NewbDevBoxButtonFrameChatSpacerButton =
1470 CreateFrame(
1471 "Button",
1472 "NewbDevBoxButtonFrameChatSpacerButton",
1473 NewbDevBoxButtonFrame,
1474 TextDimensionList.buttonTemplate
1475)
1476NewbDevBoxButtonFrameChatSpacerButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1477NewbDevBoxButtonFrameChatSpacerButton:SetText(TextStringList.btnChatSpacer)
1478NewbDevBoxButtonFrameChatSpacerButton:SetNormalFontObject(TextDimensionList.buttonFont)
1479NewbDevBoxButtonFrameChatSpacerButton:SetHighlightFontObject(TextDimensionList.buttonFont)
1480NewbDevBoxButtonFrameChatSpacerButton:SetScript(
1481 "OnClick",
1482 function()
1483 print(TextStringList.printChatSpacer)
1484 print(TextStringList.printChatSpacer)
1485 end
1486)
1487
1488local NewbDevBoxButtonFrameETraceButton =
1489 CreateFrame(
1490 "Button",
1491 "NewbDevBoxButtonFrameETraceButton",
1492 NewbDevBoxButtonFrame,
1493 TextDimensionList.secureButtonTemplate
1494)
1495NewbDevBoxButtonFrameETraceButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1496NewbDevBoxButtonFrameETraceButton:SetText(TextStringList.btnETrace)
1497NewbDevBoxButtonFrameETraceButton:SetNormalFontObject(TextDimensionList.buttonFont)
1498NewbDevBoxButtonFrameETraceButton:SetHighlightFontObject(TextDimensionList.buttonFont)
1499NewbDevBoxButtonFrameETraceButton:SetAttribute("type", "macro")
1500NewbDevBoxButtonFrameETraceButton:SetAttribute("macrotext", "/eventtrace")
1501
1502local NewbDevBoxButtonFrameETraceStartButton =
1503 CreateFrame(
1504 "Button",
1505 "NewbDevBoxButtonFrameETraceStartButton",
1506 NewbDevBoxButtonFrame,
1507 TextDimensionList.secureButtonTemplate
1508)
1509NewbDevBoxButtonFrameETraceStartButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1510NewbDevBoxButtonFrameETraceStartButton:SetText(TextStringList.btnEtraceStart)
1511NewbDevBoxButtonFrameETraceStartButton:SetNormalFontObject(TextDimensionList.buttonFont)
1512NewbDevBoxButtonFrameETraceStartButton:SetHighlightFontObject(TextDimensionList.buttonFont)
1513NewbDevBoxButtonFrameETraceStartButton:SetAttribute("type", "macro")
1514NewbDevBoxButtonFrameETraceStartButton:SetAttribute("macrotext", "/eventtrace start")
1515
1516local NewbDevBoxButtonFrameETraceStopButton =
1517 CreateFrame(
1518 "Button",
1519 "NewbDevBoxButtonFrameETraceStopButton",
1520 NewbDevBoxButtonFrame,
1521 TextDimensionList.buttonTemplate
1522)
1523NewbDevBoxButtonFrameETraceStopButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1524NewbDevBoxButtonFrameETraceStopButton:SetText(TextStringList.btnEtraceStop)
1525NewbDevBoxButtonFrameETraceStopButton:SetNormalFontObject(TextDimensionList.buttonFont)
1526NewbDevBoxButtonFrameETraceStopButton:SetHighlightFontObject(TextDimensionList.buttonFont)
1527NewbDevBoxButtonFrameETraceStopButton:SetScript(
1528 "OnClick",
1529 function()
1530 if not FrameStackTooltip_Toggle then
1531 LoadAddOn("Blizzard_DebugTools")
1532 end
1533 EventTraceFrame_StopEventCapture()
1534 end
1535)
1536
1537local NewbDevBoxButtonFrameChatLogButton =
1538 CreateFrame(
1539 "Button",
1540 "NewbDevBoxButtonFrameChatLogButton",
1541 NewbDevBoxButtonFrame,
1542 TextDimensionList.secureButtonTemplate
1543)
1544NewbDevBoxButtonFrameChatLogButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1545NewbDevBoxButtonFrameChatLogButton:SetText(TextStringList.btnChatLog)
1546NewbDevBoxButtonFrameChatLogButton:SetNormalFontObject(TextDimensionList.buttonFont)
1547NewbDevBoxButtonFrameChatLogButton:SetHighlightFontObject(TextDimensionList.buttonFont)
1548NewbDevBoxButtonFrameChatLogButton:SetAttribute("type", "macro")
1549NewbDevBoxButtonFrameChatLogButton:SetAttribute("macrotext", "/chatlog")
1550
1551local NewbDevBoxButtonFrameCombatLogButton =
1552 CreateFrame(
1553 "Button",
1554 "NewbDevBoxButtonFrameCombatLogButton",
1555 NewbDevBoxButtonFrame,
1556 TextDimensionList.secureButtonTemplate
1557)
1558NewbDevBoxButtonFrameCombatLogButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1559NewbDevBoxButtonFrameCombatLogButton:SetText(TextStringList.btnCombatLog)
1560NewbDevBoxButtonFrameCombatLogButton:SetNormalFontObject(TextDimensionList.buttonFont)
1561NewbDevBoxButtonFrameCombatLogButton:SetHighlightFontObject(TextDimensionList.buttonFont)
1562NewbDevBoxButtonFrameCombatLogButton:SetAttribute("type", "macro")
1563NewbDevBoxButtonFrameCombatLogButton:SetAttribute("macrotext", "/combatlog")
1564
1565local NewbDevBoxButtonFrameVersionButton =
1566 CreateFrame("Button", "NewbDevBoxButtonFrameVersionButton", NewbDevBoxButtonFrame, TextDimensionList.buttonTemplate)
1567NewbDevBoxButtonFrameVersionButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1568NewbDevBoxButtonFrameVersionButton:SetText(TextStringList.btnVersionButton)
1569NewbDevBoxButtonFrameVersionButton:SetNormalFontObject(TextDimensionList.buttonFont)
1570NewbDevBoxButtonFrameVersionButton:SetHighlightFontObject(TextDimensionList.buttonFont)
1571NewbDevBoxButtonFrameVersionButton:SetScript(
1572 "OnClick",
1573 function()
1574 print(TextStringList.printChatSpacer)
1575 print(TextStringList.printVersion, select(4, GetBuildInfo()))
1576 print(TextStringList.printChatSpacer)
1577 end
1578)
1579
1580-- =========================== other addon buttons ===========================
1581local NewbDevBoxButtonFrameBugSackButton =
1582 CreateFrame("Button", "NewbDevBoxButtonFrameBugSackButton", NewbDevBoxButtonFrame, TextDimensionList.buttonTemplate)
1583NewbDevBoxButtonFrameBugSackButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1584NewbDevBoxButtonFrameBugSackButton:SetText(TextStringList.btnBugSackButton)
1585NewbDevBoxButtonFrameBugSackButton:SetNormalFontObject(TextDimensionList.buttonFont)
1586NewbDevBoxButtonFrameBugSackButton:SetHighlightFontObject(TextDimensionList.buttonFont)
1587NewbDevBoxButtonFrameBugSackButton:SetScript(
1588 "OnClick",
1589 function()
1590 if BugSackFrame and BugSackFrame:IsShown() then
1591 bugsackFunctions:CloseSack()
1592 else
1593 bugsackFunctions:OpenSack()
1594 end
1595 end
1596)
1597
1598local NewbDevBoxButtonFrameBugSackClearButton =
1599 CreateFrame(
1600 "Button",
1601 "NewbDevBoxButtonFrameBugSackClearButton",
1602 NewbDevBoxButtonFrame,
1603 TextDimensionList.buttonTemplate
1604)
1605NewbDevBoxButtonFrameBugSackClearButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1606NewbDevBoxButtonFrameBugSackClearButton:SetText(TextStringList.btnBugSackClearButton)
1607NewbDevBoxButtonFrameBugSackClearButton:SetNormalFontObject(TextDimensionList.buttonFont)
1608NewbDevBoxButtonFrameBugSackClearButton:SetHighlightFontObject(TextDimensionList.buttonFont)
1609NewbDevBoxButtonFrameBugSackClearButton:SetScript(
1610 "OnClick",
1611 function()
1612 bugsackFunctions:Reset()
1613 end
1614)
1615
1616local NewbDevBoxButtonFrameWoWLuaButton =
1617 CreateFrame("Button", "NewbDevBoxButtonFrameWoWLuaButton", NewbDevBoxButtonFrame, TextDimensionList.buttonTemplate)
1618NewbDevBoxButtonFrameWoWLuaButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1619NewbDevBoxButtonFrameWoWLuaButton:SetText(TextStringList.btnWoWLuaButton)
1620NewbDevBoxButtonFrameWoWLuaButton:SetNormalFontObject(TextDimensionList.buttonFont)
1621NewbDevBoxButtonFrameWoWLuaButton:SetHighlightFontObject(TextDimensionList.buttonFont)
1622NewbDevBoxButtonFrameWoWLuaButton:SetScript(
1623 "OnClick",
1624 function()
1625 if WowLuaFrame:IsShown() then
1626 WowLuaFrame:Hide()
1627 else
1628 WowLuaFrame:Show()
1629 end
1630 end
1631)
1632
1633local NewbDevBoxButtonFrameREHackButton =
1634 CreateFrame(
1635 "Button",
1636 "NewbDevBoxButtonFrameREHackButton",
1637 NewbDevBoxButtonFrame,
1638 TextDimensionList.secureButtonTemplate
1639)
1640NewbDevBoxButtonFrameREHackButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1641NewbDevBoxButtonFrameREHackButton:SetText(TextStringList.btnREHackButton)
1642NewbDevBoxButtonFrameREHackButton:SetNormalFontObject(TextDimensionList.buttonFont)
1643NewbDevBoxButtonFrameREHackButton:SetHighlightFontObject(TextDimensionList.buttonFont)
1644NewbDevBoxButtonFrameREHackButton:SetAttribute("type", "macro")
1645NewbDevBoxButtonFrameREHackButton:SetAttribute("macrotext", "/hack")
1646
1647local NewbDevBoxButtonFrameViragDevToolButton =
1648 CreateFrame(
1649 "Button",
1650 "NewbDevBoxButtonFrameViragDevToolButton",
1651 NewbDevBoxButtonFrame,
1652 TextDimensionList.buttonTemplate
1653)
1654NewbDevBoxButtonFrameViragDevToolButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1655NewbDevBoxButtonFrameViragDevToolButton:SetText(TextStringList.btnViragDevToolButton)
1656NewbDevBoxButtonFrameViragDevToolButton:SetNormalFontObject(TextDimensionList.buttonFont)
1657NewbDevBoxButtonFrameViragDevToolButton:SetHighlightFontObject(TextDimensionList.buttonFont)
1658NewbDevBoxButtonFrameViragDevToolButton:SetScript(
1659 "OnClick",
1660 function()
1661 ViragDevTool:ToggleUI()
1662 end
1663)
1664
1665local NewbDevBoxButtonFrameAPIInterfaceButton =
1666 CreateFrame(
1667 "Button",
1668 "NewbDevBoxButtonFrameAPIInterfaceButton",
1669 NewbDevBoxButtonFrame,
1670 TextDimensionList.buttonTemplate
1671)
1672NewbDevBoxButtonFrameAPIInterfaceButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1673NewbDevBoxButtonFrameAPIInterfaceButton:SetText(TextStringList.btnAPIInterfaceButton)
1674NewbDevBoxButtonFrameAPIInterfaceButton:SetNormalFontObject(TextDimensionList.buttonFont)
1675NewbDevBoxButtonFrameAPIInterfaceButton:SetHighlightFontObject(TextDimensionList.buttonFont)
1676NewbDevBoxButtonFrameAPIInterfaceButton:SetScript(
1677 "OnClick",
1678 function()
1679 if APII_Core:IsShown() then
1680 APII_Core:Hide()
1681 else
1682 APII_Core:Show()
1683 end
1684 end
1685)
1686
1687local NewbDevBoxButtonFrameHandleItButton =
1688 CreateFrame(
1689 "Button",
1690 "NewbDevBoxButtonFrameHandleItButton",
1691 NewbDevBoxButtonFrame,
1692 TextDimensionList.buttonTemplate
1693)
1694NewbDevBoxButtonFrameHandleItButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1695NewbDevBoxButtonFrameHandleItButton:SetText(TextStringList.btnHandleIt)
1696NewbDevBoxButtonFrameHandleItButton:SetNormalFontObject(TextDimensionList.buttonFont)
1697NewbDevBoxButtonFrameHandleItButton:SetHighlightFontObject(TextDimensionList.buttonFont)
1698NewbDevBoxButtonFrameHandleItButton:SetScript(
1699 "OnClick",
1700 function()
1701 if InterfaceOptionsFrame:IsShown() then
1702 InterfaceOptionsFrame:Hide()
1703 else
1704 InterfaceOptionsFrame:Show()
1705 InterfaceOptionsFrameTab2:Click() -- click the addons tab
1706 for k, v in pairs(INTERFACEOPTIONS_ADDONCATEGORIES) do -- loop through all categories
1707 for a, b in pairs(v) do -- loop through the current category
1708 if b == "HandleIt" then -- if the current name value
1709 thisButton = _G["InterfaceOptionsFrameAddOnsButton" .. k] -- set the button name with the key value
1710 thisButton:Click()
1711 end
1712 end
1713 end
1714 end
1715 end
1716)
1717
1718local NewbDevBoxButtonFrameWhatsOnTheMapButton =
1719 CreateFrame(
1720 "Button",
1721 "NewbDevBoxButtonFrameWhatsOnTheMapButton",
1722 NewbDevBoxButtonFrame,
1723 TextDimensionList.buttonTemplate
1724)
1725NewbDevBoxButtonFrameWhatsOnTheMapButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1726NewbDevBoxButtonFrameWhatsOnTheMapButton:SetText(TextStringList.btnWhatsOnTheMapButton)
1727NewbDevBoxButtonFrameWhatsOnTheMapButton:SetNormalFontObject(TextDimensionList.buttonFont)
1728NewbDevBoxButtonFrameWhatsOnTheMapButton:SetHighlightFontObject(TextDimensionList.buttonFont)
1729NewbDevBoxButtonFrameWhatsOnTheMapButton:SetScript(
1730 "OnClick",
1731 function()
1732 if WhatsOnTheMapFrame:IsShown() then
1733 WhatsOnTheMapFrame:Hide()
1734 else
1735 WhatsOnTheMapFrame:Show()
1736 end
1737 end
1738)
1739
1740local NewbDevBoxButtonFrameCubeCodeButton =
1741 CreateFrame(
1742 "Button",
1743 "NewbDevBoxButtonFrameCubeCodeButton",
1744 NewbDevBoxButtonFrame,
1745 TextDimensionList.secureButtonTemplate
1746)
1747NewbDevBoxButtonFrameCubeCodeButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1748NewbDevBoxButtonFrameCubeCodeButton:SetText(TextStringList.btnCubeButton)
1749NewbDevBoxButtonFrameCubeCodeButton:SetNormalFontObject(TextDimensionList.buttonFont)
1750NewbDevBoxButtonFrameCubeCodeButton:SetHighlightFontObject(TextDimensionList.buttonFont)
1751NewbDevBoxButtonFrameCubeCodeButton:SetAttribute("type", "macro")
1752NewbDevBoxButtonFrameCubeCodeButton:SetAttribute("macrotext", "/cube code")
1753
1754local NewbDevBoxButtonFrameCubeBrowserButton =
1755 CreateFrame(
1756 "Button",
1757 "NewbDevBoxButtonFrameCubeBrowserButton",
1758 NewbDevBoxButtonFrame,
1759 TextDimensionList.secureButtonTemplate
1760)
1761NewbDevBoxButtonFrameCubeBrowserButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1762NewbDevBoxButtonFrameCubeBrowserButton:SetText(TextStringList.btnCubeBrowserButton)
1763NewbDevBoxButtonFrameCubeBrowserButton:SetNormalFontObject(TextDimensionList.buttonFont)
1764NewbDevBoxButtonFrameCubeBrowserButton:SetHighlightFontObject(TextDimensionList.buttonFont)
1765NewbDevBoxButtonFrameCubeBrowserButton:SetAttribute("type", "macro")
1766NewbDevBoxButtonFrameCubeBrowserButton:SetAttribute("macrotext", "/cube debug")
1767
1768local NewbDevBoxButtonFrameAddonUsageButton =
1769 CreateFrame(
1770 "Button",
1771 "NewbDevBoxButtonFrameAddonUsageButton",
1772 NewbDevBoxButtonFrame,
1773 TextDimensionList.secureButtonTemplate
1774)
1775NewbDevBoxButtonFrameAddonUsageButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1776NewbDevBoxButtonFrameAddonUsageButton:SetText(TextStringList.cbAddonUsageButton)
1777NewbDevBoxButtonFrameAddonUsageButton:SetNormalFontObject(TextDimensionList.buttonFont)
1778NewbDevBoxButtonFrameAddonUsageButton:SetHighlightFontObject(TextDimensionList.buttonFont)
1779NewbDevBoxButtonFrameAddonUsageButton:SetAttribute("type", "macro")
1780NewbDevBoxButtonFrameAddonUsageButton:SetAttribute("macrotext", "/addonusage")
1781