· 4 years ago · Jul 02, 2021, 05:54 AM
1--
2-- Newb Dev Box
3-- Version: 1.0.9.0
4-- Author: Walkerbo
5-- Email: walkerbo.saurfang@gmail.com
6-- Date: Friday 11 June 2021
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"
18local versionNumber = "1.0.9.0"
19
20local ListOfDevAddons = {
21 "BugSack",
22 "REHack",
23 "ViragDevTool",
24 "WowLua",
25 "APIInterface",
26 "HandleIt"
27}
28
29local bugsackFunctions = _G["BugSack"] -- set a local reference to bugsack
30
31local SortedNewbDevBoxButtonTable = {}
32
33local stringNewbDevBox, -- default strings
34 stringToggleUI, -- debug --
35 stringKeyBindings,
36 stringReload,
37 stringLogout,
38 stringFStack,
39 stringETrace,
40 stringChatLog,
41 stringCombatLog,
42 stringClearChat,
43 stringChatSpacer,
44 stringETraceStart,
45 stringETraceStop,
46 stringExit,
47 stringBugSack,
48 stringBugSackClear,
49 stringWoWLuaButton,
50 stringREHackButton,
51 stringViragDevTool,
52 stringAPIInterface,
53 stringHandleIt,
54 stringVersion,
55 stringVersionPrint,
56 stringFrameScale,
57 stringFrameOpacity =
58 "Newb Dev Box",
59 "Toggle Newb Dev Box", -- debug --
60 "Keybindings",
61 "Reload",
62 "Logout",
63 "FStack",
64 "ETrace",
65 "Chat Log",
66 "Combat Log",
67 "Clear Chat",
68 "Chat Spacer",
69 "ETrace Start",
70 "ETrace Stop",
71 "Exit",
72 "Bug Sack",
73 "Clear Bug Sack",
74 "WoW Lua",
75 "REHack",
76 "Virag Dev Tool",
77 "API Interface",
78 "Handle It",
79 "Version",
80 "Current Version -:",
81 "% Button Box Scale",
82 "% Button Box Opacity"
83
84--local localLanguage = GetLocale() -- debug --
85
86local TextDimensionList = {
87 addonColour = "|cff00ff00", -- rgb(0, 255, 0)
88 disabledTextColour = "|cff918f8e", -- rgb(145, 143, 142)
89 colourBackdrop = {0, 0, 0, 1}, -- rgb(0, 0, 0)
90 colourBorder = {0, 1, 0, 1}, -- rgb(0, 255, 0)
91 checkBoxFont = "FocusFontSmall",
92 checkBoxTextColour = "|cffffd100", -- rgb(255, 209, 0)
93 keybindigsFont = "ErrorFont"
94}
95
96-- =========================== font objects ===========================
97local NewbDevBoxTitle = CreateFont("NewbDevBoxTitle")
98NewbDevBoxTitle:SetFont("Interface\\AddOns\\NewbDevBox\\Files\\OCRAStd.otf", 30)
99local NewbDevBoxButton = CreateFont("NewbDevBoxButton")
100NewbDevBoxButton:SetFont("Interface\\AddOns\\NewbDevBox\\Files\\OCRAStd.otf", 16)
101
102-- =========================== all the strings ===========================
103local TextStringList = {
104 addonLoaded = TextDimensionList.addonColour .. " *** " .. addonName .. " - " .. versionNumber .. " Loaded *** \n",
105 interfaceTitle = TextDimensionList.addonColour .. stringNewbDevBox,
106 btnAPIInterfaceButton = stringAPIInterface,
107 btnBugSackButton = stringBugSack,
108 btnBugSackClearButton = stringBugSackClear,
109 btnChatLog = stringChatLog,
110 btnChatSpacer = stringChatSpacer,
111 btnClearChat = stringClearChat,
112 btnCombatLog = stringCombatLog,
113 btnETrace = stringETrace,
114 btnEtraceStart = stringETraceStart,
115 btnEtraceStop = stringETraceStop,
116 btnExit = stringExit,
117 btnFStack = stringFStack,
118 btnHandleIt = stringHandleIt,
119 btnLogout = stringLogout,
120 btnNewbDevBox = stringNewbDevBox,
121 btnREHackButton = stringREHackButton,
122 btnReload = stringReload,
123 btnVersionButton = stringVersion,
124 btnViragDevToolButton = stringViragDevTool,
125 btnWoWLuaButton = stringWoWLuaButton,
126 cbAPIInterfaceButton = " " .. stringAPIInterface,
127 cbBugSackButton = " " .. stringBugSack,
128 cbBugSackClearButton = " " .. stringBugSackClear,
129 cbChatLog = " " .. stringChatLog,
130 cbChatSpacer = " " .. stringChatSpacer,
131 cbClearChat = " " .. stringClearChat,
132 cbCombatLog = " " .. stringCombatLog,
133 cbETrace = " " .. stringETrace,
134 cbEtraceStart = " " .. stringETraceStart,
135 cbEtraceStop = " " .. stringETraceStop,
136 cbExit = " " .. stringExit,
137 cbFStack = " " .. stringFStack,
138 cbHandleIt = " " .. stringHandleIt,
139 cbLogout = " " .. stringLogout,
140 cbREHackButton = " " .. stringREHackButton,
141 cbVersionButton = " " .. stringVersion,
142 cbViragDevToolButton = " " .. stringViragDevTool,
143 cbWoWLuaButton = " " .. stringWoWLuaButton,
144 printChatSpacer = TextDimensionList.addonColour .. "********************************************************",
145 printVersion = TextDimensionList.addonColour .. stringVersionPrint,
146 textBoxScale = stringFrameScale,
147 textBoxOpacity = stringFrameOpacity,
148 keyBinding = stringKeyBindings
149}
150
151local NumberList = {
152 actionButtonHeight = 30,
153 actionButtonSideFrameGap = 18,
154 actionButtonSideGap = 10,
155 actionButtonTopGap = -35,
156 actionButtonWidth = 110,
157 buttonFrameDefaultHeight = 83,
158 buttonFrameHeightExpander = 34,
159 buttonFrameTitleButtonWidth = 150,
160 buttonFrameWidth = 380,
161 checkBoxElementXGap = 165,
162 checkBoxElementYGap = -55,
163 checkBoxMainSideGap = 35,
164 checkBoxMainTopGap = -65,
165 checkBoxSize = 27,
166 edgeSize = 20,
167 insetSize = 5,
168 keybindingsButtonHeight = 34,
169 keybindingsButtonWidth = 180,
170 scaleTextBoxHeight = 25,
171 scaleTextBoxWidth = 40,
172 scaleTextBoxXGap = 415,
173 textBoxYGap = -10,
174 titleFrameGap = -10,
175 titleFrameHeight = 40,
176 titleFrameWidth = 600
177}
178
179-- ===================================================================================================
180-- ===================================================================================================
181-- =========================== functions ===========================
182-- ===================================================================================================
183-- ===================================================================================================
184
185local function initialiseLists() -- build lists if they do not already exist
186 if not NewbDevBoxDisplayButtonTable then
187 NewbDevBoxDisplayButtonTable = {
188 [1] = {LogoutButton = true},
189 [2] = {ExitButton = true},
190 [3] = {FStackButton = true},
191 [4] = {ClearChatButton = true},
192 [5] = {ChatSpacerButton = true},
193 [6] = {ETraceButton = true},
194 [7] = {ETraceStartButton = true},
195 [8] = {ETraceStopButton = true},
196 [9] = {ChatLogButton = true},
197 [10] = {CombatLogButton = true},
198 [11] = {VersionButton = true},
199 [12] = {BugSackButton = false},
200 [13] = {BugSackClearButton = false},
201 [14] = {WoWLuaButton = false},
202 [15] = {REHackButton = false},
203 [16] = {ViragDevToolButton = false},
204 [17] = {APIInterfaceButton = false},
205 [18] = {HandleItButton = false}
206 }
207 end
208 if not NewbDevBoxOptionsTable then
209 NewbDevBoxOptionsTable = {
210 ButtonFrameScale = 1,
211 ButtonFrameOpacity = 1,
212 ButtonIsVisable = true
213 }
214 end
215end
216
217local function setUpNewbDevBoxSortedTable()
218 for k in pairs(NewbDevBoxDisplayButtonTable) do -- insert the key of our button table
219 table.insert(SortedNewbDevBoxButtonTable, k)
220 end
221 table.sort(SortedNewbDevBoxButtonTable) -- sort the key values table
222end
223
224local function setCheckBoxesAndButtonFrameMetrics() -- set up the checkboxes and the frame and buttons scale
225 for index = 1, #SortedNewbDevBoxButtonTable do -- loop through the sorting table
226 tableIndex = SortedNewbDevBoxButtonTable[index] -- get the current index
227 tableAtIndex = NewbDevBoxDisplayButtonTable[tableIndex] -- get the table held in the button table index
228 for k, v in pairs(tableAtIndex) do -- loop through the table at index
229 buttonName = _G["NewbDevBoxInterfaceFramecb" .. k] -- this is our current checkbox name
230 if v then -- if true
231 buttonName:SetChecked(true) -- check checkbox
232 end
233 end
234 end
235
236 NewbDevBoxButtonFrame:SetScale(NewbDevBoxOptionsTable.ButtonFrameScale)
237 NewbDevBoxInterfaceFrame.ScaleTextBox:SetNumber(NewbDevBoxOptionsTable.ButtonFrameScale * 100)
238
239 NewbDevBoxButtonFrame:SetAlpha(NewbDevBoxOptionsTable.ButtonFrameOpacity)
240 NewbDevBoxInterfaceFrame.OpacityTextBox:SetNumber(NewbDevBoxOptionsTable.ButtonFrameOpacity * 100)
241
242 if NewbDevBoxOptionsTable.ButtonIsVisable then
243 NewbDevBoxButtonFrame:Show()
244 else
245 NewbDevBoxButtonFrame:Hide()
246 end
247end
248
249local function checkOtherAddonsEnabled()
250 for k, v in pairs(ListOfDevAddons) do
251 local name, title, _, enabled = GetAddOnInfo(v)
252 if name == "BugSack" then
253 if enabled then -- if addon is loaded enable checkboxes and remove grey text
254 NewbDevBoxInterfaceFramecbBugSackButton.text:SetText(TextStringList.cbBugSackButton)
255 NewbDevBoxInterfaceFramecbBugSackButton:Enable()
256 NewbDevBoxInterfaceFramecbBugSackClearButton.text:SetText(TextStringList.cbBugSackClearButton)
257 NewbDevBoxInterfaceFramecbBugSackClearButton:Enable()
258 else -- ensure button variables are set to false
259 NewbDevBoxDisplayButtonTable[12].BugSackButton = false
260 NewbDevBoxDisplayButtonTable[13].BugSackClearButton = false
261 end
262 elseif name == "WowLua" then
263 if enabled then
264 NewbDevBoxInterfaceFramecbWoWLuaButton.text:SetText(TextStringList.cbWoWLuaButton)
265 NewbDevBoxInterfaceFramecbWoWLuaButton:Enable()
266 else
267 NewbDevBoxDisplayButtonTable[14].WoWLuaButton = false
268 end
269 elseif name == "REHack" then
270 if enabled then
271 NewbDevBoxInterfaceFramecbREHackButton.text:SetText(TextStringList.cbREHackButton)
272 NewbDevBoxInterfaceFramecbREHackButton:Enable()
273 else
274 NewbDevBoxDisplayButtonTable[15].REHackButton = false
275 end
276 elseif name == "ViragDevTool" then
277 if enabled then
278 NewbDevBoxInterfaceFramecbViragDevToolButton.text:SetText(TextStringList.cbViragDevToolButton)
279 NewbDevBoxInterfaceFramecbViragDevToolButton:Enable()
280 else
281 NewbDevBoxDisplayButtonTable[16].ViragDevToolButton = false
282 end
283 elseif name == "APIInterface" then
284 if enabled then
285 NewbDevBoxInterfaceFramecbAPIInterfaceButton.text:SetText(TextStringList.cbAPIInterfaceButton)
286 NewbDevBoxInterfaceFramecbAPIInterfaceButton:Enable()
287 else
288 NewbDevBoxDisplayButtonTable[17].APIInterfaceButton = false
289 end
290 elseif name == "HandleIt" then
291 if enabled then
292 NewbDevBoxInterfaceFramecbHandleItButton.text:SetText(TextStringList.cbHandleIt)
293 NewbDevBoxInterfaceFramecbHandleItButton:Enable()
294 else
295 NewbDevBoxDisplayButtonTable[18].HandleItButton = false
296 end
297 end
298 end
299end
300
301local function buttonFrameButtonLayout()
302 local lastRelative, lastOnTop = NewbDevBoxButtonFrameReloadButton, NewbDevBoxButtonFrameReloadButton
303 local lastCount = 1
304 local buttonFrameHeight = NumberList.buttonFrameDefaultHeight
305
306 NewbDevBoxButtonFrameLogoutButton:Hide() -- hide all buttons to ensure no ghosting
307 NewbDevBoxButtonFrameExitButton:Hide()
308 NewbDevBoxButtonFrameFStackButton:Hide()
309 NewbDevBoxButtonFrameClearChatButton:Hide()
310 NewbDevBoxButtonFrameChatSpacerButton:Hide()
311 NewbDevBoxButtonFrameETraceButton:Hide()
312 NewbDevBoxButtonFrameETraceStartButton:Hide()
313 NewbDevBoxButtonFrameETraceStopButton:Hide()
314 NewbDevBoxButtonFrameChatLogButton:Hide()
315 NewbDevBoxButtonFrameCombatLogButton:Hide()
316 NewbDevBoxButtonFrameVersionButton:Hide()
317 NewbDevBoxButtonFrameBugSackButton:Hide()
318 NewbDevBoxButtonFrameBugSackClearButton:Hide()
319 NewbDevBoxButtonFrameWoWLuaButton:Hide()
320 NewbDevBoxButtonFrameREHackButton:Hide()
321 NewbDevBoxButtonFrameViragDevToolButton:Hide()
322 NewbDevBoxButtonFrameAPIInterfaceButton:Hide()
323 NewbDevBoxButtonFrameHandleItButton:Hide()
324 NewbDevBoxButtonFrame:SetSize(NumberList.buttonFrameWidth, buttonFrameHeight) -- reset frame size
325
326 for index = 1, #SortedNewbDevBoxButtonTable do -- loop through the sorting table
327 tableIndex = SortedNewbDevBoxButtonTable[index] -- get the current index
328 tableAtIndex = NewbDevBoxDisplayButtonTable[tableIndex] -- get the table held in the button table index
329 for k, v in pairs(tableAtIndex) do -- loop through the table at index
330 if v then
331 thisButton = _G["NewbDevBoxButtonFrame" .. k] -- set this button to the global button name
332 thisButton:ClearAllPoints()
333 thisButton:Show()
334 if mod(lastCount, 3) == 0 then -- when the button count reaches 3
335 thisButton:SetPoint("TOP", lastOnTop, "BOTTOM", 0, -5) -- set the button point to the last top button
336 lastOnTop = thisButton -- set the current button as the lastOnTop button
337 buttonFrameHeight = buttonFrameHeight + NumberList.buttonFrameHeightExpander -- expand the frame to allow another row of buttons
338 NewbDevBoxButtonFrame:SetSize(NumberList.buttonFrameWidth, buttonFrameHeight) -- set the frame size
339 else
340 thisButton:SetPoint("LEFT", lastRelative, "RIGHT", NumberList.actionButtonSideGap, 0) -- set the button point to the last button
341 end
342 lastCount = lastCount + 1 -- increase the lastCount
343 lastRelative = thisButton -- set this button to the lastRelative
344 end
345 end
346 end
347end
348
349local function updateButtonFrameScale(updateScaleNumber)
350 if updateScaleNumber >= 301 then -- if the entered number is too high
351 updateScaleNumber = 300
352 elseif updateScaleNumber <= 49 then -- if the entered number is too low
353 updateScaleNumber = 50
354 end
355 NewbDevBoxOptionsTable.ButtonFrameScale = updateScaleNumber / 100
356 NewbDevBoxButtonFrame:SetScale(NewbDevBoxOptionsTable.ButtonFrameScale)
357 NewbDevBoxInterfaceFrame.ScaleTextBox:SetNumber(updateScaleNumber)
358end
359
360local function updateButtonFrameOpacity(updateOpacityNumber)
361 if updateOpacityNumber >= 101 then -- if the entered number is too high
362 updateOpacityNumber = 100
363 elseif updateOpacityNumber <= 24 then -- if the entered number is too low
364 updateOpacityNumber = 25
365 end
366 NewbDevBoxOptionsTable.ButtonFrameOpacity = updateOpacityNumber / 100
367 NewbDevBoxButtonFrame:SetAlpha(NewbDevBoxOptionsTable.ButtonFrameOpacity)
368 NewbDevBoxInterfaceFrame.OpacityTextBox:SetNumber(updateOpacityNumber)
369end
370
371-- ===================================================================================================
372-- ===================================================================================================
373-- =========================== global functions for keybinds ===========================
374-- ===================================================================================================
375-- ===================================================================================================
376
377-- =========================== toggle newb dev box frame ===========================
378function NEWBDEVBOXTOGGLENEWBDEVBOXINTERFACEFRAME()
379 if InterfaceOptionsFrame:IsShown() then
380 InterfaceOptionsFrame:Hide()
381 else
382 InterfaceOptionsFrame_OpenToCategory(NewbDevBoxInterfaceFrame)
383 InterfaceOptionsFrame_OpenToCategory(NewbDevBoxInterfaceFrame)
384 end
385end
386
387-- ===================================================================================================
388-- ===================================================================================================
389-- =========================== slash commands ===========================
390-- ===================================================================================================
391-- ===================================================================================================
392
393-- =========================== toggle newb dev box frame ===========================
394SLASH_NEWBDEVBOX1 = "/NDB"
395function SlashCmdList.NEWBDEVBOX(msg, editbox)
396 NEWBDEVBOXTOGGLENEWBDEVBOXINTERFACEFRAME()
397end
398
399-- ===================================================================================================
400-- ===================================================================================================
401-- =========================== Frames ===========================
402-- ===================================================================================================
403-- ===================================================================================================
404
405local NewbDevBoxInterfaceFrame = CreateFrame("Frame", "NewbDevBoxInterfaceFrame", UIParent, "BackdropTemplate")
406NewbDevBoxInterfaceFrame.name = "Noob Dev Box"
407NewbDevBoxInterfaceFrame:SetBackdrop(
408 {
409 bgFile = "Interface\\Buttons\\WHITE8X8",
410 insets = {
411 left = NumberList.insetSize,
412 right = NumberList.insetSize,
413 top = NumberList.insetSize,
414 bottom = NumberList.insetSize
415 },
416 tileSize = nil,
417 tile = false,
418 edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
419 edgeSize = NumberList.edgeSize
420 }
421)
422NewbDevBoxInterfaceFrame:SetBackdropColor(unpack(TextDimensionList.colourBackdrop))
423NewbDevBoxInterfaceFrame:SetBackdropBorderColor(unpack(TextDimensionList.colourBorder))
424NewbDevBoxInterfaceFrame:SetScript(
425 "OnEvent",
426 function(self, event, ...)
427 if event == "PLAYER_LOGIN" then -- fires when a player logs in or reloads
428 print(TextStringList.addonLoaded) -- Load Message
429 initialiseLists()
430 setUpNewbDevBoxSortedTable()
431 checkOtherAddonsEnabled()
432 setCheckBoxesAndButtonFrameMetrics()
433 buttonFrameButtonLayout()
434 end
435 end
436)
437NewbDevBoxInterfaceFrame:RegisterEvent("PLAYER_LOGIN") -- fires when a player logs in or reloads
438NewbDevBoxInterfaceFrame:RegisterEvent("ADDON_LOADED") -- fires when an addon is loaded
439InterfaceOptions_AddCategory(NewbDevBoxInterfaceFrame)
440
441NewbDevBoxInterfaceFrame.TitleBox =
442 CreateFrame("Frame", "NewbDevBoxInterfaceFrameTitleBox", NewbDevBoxInterfaceFrame, "BackdropTemplate") -- debug --
443
444NewbDevBoxInterfaceFrame.TitleBox:SetBackdrop( -- debug --
445 {
446 bgFile = nil,
447 insets = {
448 left = NumberList.insetSize,
449 right = NumberList.insetSize,
450 top = NumberList.insetSize,
451 bottom = NumberList.insetSize
452 },
453 tileSize = nil,
454 tile = false,
455 edgeFile = nil, -- "Interface\\Tooltips\\UI-Tooltip-Border", -- debug --
456 edgeSize = NumberList.edgeSize
457 }
458)
459
460NewbDevBoxInterfaceFrame.TitleBox:SetSize(NumberList.titleFrameWidth, NumberList.titleFrameHeight)
461NewbDevBoxInterfaceFrame.TitleBox:SetPoint("TOP", NewbDevBoxInterfaceFrame, 0, NumberList.titleFrameGap)
462NewbDevBoxInterfaceFrame.TitleBox.Text =
463 NewbDevBoxInterfaceFrame.TitleBox:CreateFontString("NewbDevBoxInterfaceFrameTitleBoxText")
464NewbDevBoxInterfaceFrame.TitleBox.Text:SetAllPoints(NewbDevBoxInterfaceFrameTitleBox)
465NewbDevBoxInterfaceFrame.TitleBox.Text:SetFontObject(NewbDevBoxTitle)
466NewbDevBoxInterfaceFrame.TitleBox.Text:SetText(TextStringList.interfaceTitle)
467
468NewbDevBoxInterfaceFrame.KeybindsButton =
469 CreateFrame(
470 "Button",
471 "NewbDevBoxInterfaceFrameKeybindsButton",
472 NewbDevBoxInterfaceFrame,
473 "BackdropTemplate",
474 "UIMenuButtonStretchTemplate"
475)
476NewbDevBoxInterfaceFrame.KeybindsButton:SetSize(NumberList.keybindingsButtonWidth, NumberList.keybindingsButtonHeight)
477NewbDevBoxInterfaceFrame.KeybindsButton:SetPoint(
478 "TOPLEFT",
479 NewbDevBoxInterfaceFrame,
480 "TOPLEFT",
481 NumberList.scaleTextBoxXGap,
482 NumberList.checkBoxMainTopGap
483)
484NewbDevBoxInterfaceFrame.KeybindsButton:SetBackdrop(
485 {
486 bgFile = nil,
487 insets = nil,
488 tileSize = nil,
489 tile = nil,
490 edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
491 edgeSize = NumberList.edgeSize
492 }
493)
494NewbDevBoxInterfaceFrame.KeybindsButton:SetBackdropBorderColor(unpack(TextDimensionList.colourBorder))
495NewbDevBoxInterfaceFrame.KeybindsButton:SetNormalFontObject(TextDimensionList.keybindigsFont)
496NewbDevBoxInterfaceFrame.KeybindsButton:SetHighlightFontObject(TextDimensionList.keybindigsFont)
497NewbDevBoxInterfaceFrame.KeybindsButton:SetText(TextStringList.keyBinding)
498NewbDevBoxInterfaceFrame.KeybindsButton:SetScript(
499 "OnClick",
500 function()
501 GameMenuButtonKeybindings:Click("RightButton")
502 KeyBindingFrame:Show()
503 for _, v in pairs(KeyBindingFrame.categoryList.buttons) do
504 if v:GetText() == "Walkerbo's Addons" or v:GetText() == "WALKERBO'S ADDONS" then
505 v:Click()
506 end
507 end
508 end
509)
510
511NewbDevBoxInterfaceFrame.ScaleTextBox =
512 CreateFrame("EditBox", "NewbDevBoxInterfaceFrameScaleTextBox", NewbDevBoxInterfaceFrame, "OptionsBoxTemplate")
513NewbDevBoxInterfaceFrame.ScaleTextBox:SetPoint(
514 "TOPLEFT",
515 NewbDevBoxInterfaceFrameKeybindsButton,
516 "BOTTOMLEFT",
517 0,
518 NumberList.textBoxYGap
519)
520NewbDevBoxInterfaceFrame.ScaleTextBox:SetFontObject(TextDimensionList.checkBoxFont)
521NewbDevBoxInterfaceFrame.ScaleTextBox:SetNumeric(true)
522NewbDevBoxInterfaceFrame.ScaleTextBox:SetSize(NumberList.scaleTextBoxWidth, NumberList.scaleTextBoxHeight)
523NewbDevBoxInterfaceFrame.ScaleTextBox:SetMaxLetters(3)
524NewbDevBoxInterfaceFrame.ScaleTextBox:SetAutoFocus()
525NewbDevBoxInterfaceFrame.ScaleTextBox:SetJustifyH("CENTER")
526NewbDevBoxInterfaceFrame.ScaleTextBox:SetScript(
527 "OnEnterPressed",
528 function(self)
529 scaleNumber = tonumber(NewbDevBoxInterfaceFrame.ScaleTextBox:GetText())
530 self:ClearFocus()
531 updateButtonFrameScale(scaleNumber)
532 end
533)
534NewbDevBoxInterfaceFrame.ScaleTextBox.Text =
535 NewbDevBoxInterfaceFrame:CreateFontString("NewbDevBoxInterfaceFrameScaleTextBoxText")
536NewbDevBoxInterfaceFrame.ScaleTextBox.Text:SetPoint("LEFT", NewbDevBoxInterfaceFrameScaleTextBox, "RIGHT")
537NewbDevBoxInterfaceFrame.ScaleTextBox.Text:SetFontObject(TextDimensionList.checkBoxFont)
538NewbDevBoxInterfaceFrame.ScaleTextBox.Text:SetText(TextStringList.textBoxScale)
539
540NewbDevBoxInterfaceFrame.OpacityTextBox =
541 CreateFrame("EditBox", "NewbDevBoxInterfaceFrameOpacityTextBox", NewbDevBoxInterfaceFrame, "OptionsBoxTemplate")
542NewbDevBoxInterfaceFrame.OpacityTextBox:SetPoint(
543 "TOP",
544 NewbDevBoxInterfaceFrameScaleTextBox,
545 "BOTTOM",
546 0,
547 NumberList.textBoxYGap
548)
549NewbDevBoxInterfaceFrame.OpacityTextBox:SetFontObject(TextDimensionList.checkBoxFont)
550NewbDevBoxInterfaceFrame.OpacityTextBox:SetNumeric(true)
551NewbDevBoxInterfaceFrame.OpacityTextBox:SetSize(NumberList.scaleTextBoxWidth, NumberList.scaleTextBoxHeight)
552NewbDevBoxInterfaceFrame.OpacityTextBox:SetMaxLetters(3)
553NewbDevBoxInterfaceFrame.OpacityTextBox:SetAutoFocus()
554NewbDevBoxInterfaceFrame.OpacityTextBox:SetJustifyH("CENTER")
555NewbDevBoxInterfaceFrame.OpacityTextBox:SetScript(
556 "OnEnterPressed",
557 function(self)
558 opacityNumber = tonumber(NewbDevBoxInterfaceFrame.OpacityTextBox:GetText())
559 self:ClearFocus()
560 updateButtonFrameOpacity(opacityNumber)
561 end
562)
563NewbDevBoxInterfaceFrame.OpacityTextBox.Text =
564 NewbDevBoxInterfaceFrame:CreateFontString("NewbDevBoxInterfaceFrameOpacityTextBoxText")
565NewbDevBoxInterfaceFrame.OpacityTextBox.Text:SetPoint("LEFT", NewbDevBoxInterfaceFrameOpacityTextBox, "RIGHT")
566NewbDevBoxInterfaceFrame.OpacityTextBox.Text:SetFontObject(TextDimensionList.checkBoxFont)
567NewbDevBoxInterfaceFrame.OpacityTextBox.Text:SetText(TextStringList.textBoxOpacity)
568
569-- =========================== newb dev box checkboxes ===========================
570local NewbDevBoxInterfaceFramecbLogoutButton =
571 CreateFrame(
572 "CheckButton",
573 "NewbDevBoxInterfaceFramecbLogoutButton",
574 NewbDevBoxInterfaceFrame,
575 "UICheckButtonTemplate"
576)
577NewbDevBoxInterfaceFramecbLogoutButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
578NewbDevBoxInterfaceFramecbLogoutButton:SetPoint(
579 "TOPLEFT",
580 NewbDevBoxInterfaceFrame,
581 "TOPLEFT",
582 NumberList.checkBoxMainSideGap,
583 NumberList.checkBoxMainTopGap
584)
585NewbDevBoxInterfaceFramecbLogoutButton.text:SetFontObject(TextDimensionList.checkBoxFont)
586NewbDevBoxInterfaceFramecbLogoutButton.text:SetText(TextStringList.cbLogout)
587NewbDevBoxInterfaceFramecbLogoutButton:SetScript(
588 "OnClick",
589 function()
590 if NewbDevBoxDisplayButtonTable[1].LogoutButton then
591 NewbDevBoxDisplayButtonTable[1].LogoutButton = false
592 else
593 NewbDevBoxDisplayButtonTable[1].LogoutButton = true
594 end
595 buttonFrameButtonLayout()
596 end
597)
598
599local NewbDevBoxInterfaceFramecbExitButton =
600 CreateFrame(
601 "CheckButton",
602 "NewbDevBoxInterfaceFramecbExitButton",
603 NewbDevBoxInterfaceFrame,
604 "UICheckButtonTemplate"
605)
606NewbDevBoxInterfaceFramecbExitButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
607NewbDevBoxInterfaceFramecbExitButton:SetPoint(
608 "BOTTOMLEFT",
609 NewbDevBoxInterfaceFramecbLogoutButton,
610 "TOPLEFT",
611 0,
612 NumberList.checkBoxElementYGap
613)
614NewbDevBoxInterfaceFramecbExitButton.text:SetFontObject(TextDimensionList.checkBoxFont)
615NewbDevBoxInterfaceFramecbExitButton.text:SetText(TextStringList.cbExit)
616NewbDevBoxInterfaceFramecbExitButton:SetScript(
617 "OnClick",
618 function()
619 if NewbDevBoxDisplayButtonTable[2].ExitButton then
620 NewbDevBoxDisplayButtonTable[2].ExitButton = false
621 else
622 NewbDevBoxDisplayButtonTable[2].ExitButton = true
623 end
624 buttonFrameButtonLayout()
625 end
626)
627
628local NewbDevBoxInterfaceFramecbFStackButton =
629 CreateFrame(
630 "CheckButton",
631 "NewbDevBoxInterfaceFramecbFStackButton",
632 NewbDevBoxInterfaceFrame,
633 "UICheckButtonTemplate"
634)
635NewbDevBoxInterfaceFramecbFStackButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
636NewbDevBoxInterfaceFramecbFStackButton:SetPoint(
637 "BOTTOMLEFT",
638 NewbDevBoxInterfaceFramecbExitButton,
639 "TOPLEFT",
640 0,
641 NumberList.checkBoxElementYGap
642)
643NewbDevBoxInterfaceFramecbFStackButton.text:SetFontObject(TextDimensionList.checkBoxFont)
644NewbDevBoxInterfaceFramecbFStackButton.text:SetText(TextStringList.cbFStack)
645NewbDevBoxInterfaceFramecbFStackButton:SetScript(
646 "OnClick",
647 function()
648 if NewbDevBoxDisplayButtonTable[3].FStackButton then
649 NewbDevBoxDisplayButtonTable[3].FStackButton = false
650 else
651 NewbDevBoxDisplayButtonTable[3].FStackButton = true
652 end
653 buttonFrameButtonLayout()
654 end
655)
656
657local NewbDevBoxInterfaceFramecbClearChatButton =
658 CreateFrame(
659 "CheckButton",
660 "NewbDevBoxInterfaceFramecbClearChatButton",
661 NewbDevBoxInterfaceFrame,
662 "UICheckButtonTemplate"
663)
664NewbDevBoxInterfaceFramecbClearChatButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
665NewbDevBoxInterfaceFramecbClearChatButton:SetPoint(
666 "BOTTOMLEFT",
667 NewbDevBoxInterfaceFramecbFStackButton,
668 "TOPLEFT",
669 0,
670 NumberList.checkBoxElementYGap
671)
672NewbDevBoxInterfaceFramecbClearChatButton.text:SetFontObject(TextDimensionList.checkBoxFont)
673NewbDevBoxInterfaceFramecbClearChatButton.text:SetText(TextStringList.cbClearChat)
674NewbDevBoxInterfaceFramecbClearChatButton:SetScript(
675 "OnClick",
676 function()
677 if NewbDevBoxDisplayButtonTable[4].ClearChatButton then
678 NewbDevBoxDisplayButtonTable[4].ClearChatButton = false
679 else
680 NewbDevBoxDisplayButtonTable[4].ClearChatButton = true
681 end
682 buttonFrameButtonLayout()
683 end
684)
685
686local NewbDevBoxInterfaceFramecbChatSpacerButton =
687 CreateFrame(
688 "CheckButton",
689 "NewbDevBoxInterfaceFramecbChatSpacerButton",
690 NewbDevBoxInterfaceFrame,
691 "UICheckButtonTemplate"
692)
693NewbDevBoxInterfaceFramecbChatSpacerButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
694NewbDevBoxInterfaceFramecbChatSpacerButton:SetPoint(
695 "BOTTOMLEFT",
696 NewbDevBoxInterfaceFramecbClearChatButton,
697 "TOPLEFT",
698 0,
699 NumberList.checkBoxElementYGap
700)
701NewbDevBoxInterfaceFramecbChatSpacerButton.text:SetFontObject(TextDimensionList.checkBoxFont)
702NewbDevBoxInterfaceFramecbChatSpacerButton.text:SetText(TextStringList.cbChatSpacer)
703NewbDevBoxInterfaceFramecbChatSpacerButton:SetScript(
704 "OnClick",
705 function()
706 if NewbDevBoxDisplayButtonTable[5].ChatSpacerButton then
707 NewbDevBoxDisplayButtonTable[5].ChatSpacerButton = false
708 else
709 NewbDevBoxDisplayButtonTable[5].ChatSpacerButton = true
710 end
711 buttonFrameButtonLayout()
712 end
713)
714
715local NewbDevBoxInterfaceFramecbETraceButton =
716 CreateFrame(
717 "CheckButton",
718 "NewbDevBoxInterfaceFramecbETraceButton",
719 NewbDevBoxInterfaceFrame,
720 "UICheckButtonTemplate"
721)
722NewbDevBoxInterfaceFramecbETraceButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
723NewbDevBoxInterfaceFramecbETraceButton:SetPoint(
724 "BOTTOMLEFT",
725 NewbDevBoxInterfaceFramecbChatSpacerButton,
726 "TOPLEFT",
727 0,
728 NumberList.checkBoxElementYGap
729)
730NewbDevBoxInterfaceFramecbETraceButton.text:SetFontObject(TextDimensionList.checkBoxFont)
731NewbDevBoxInterfaceFramecbETraceButton.text:SetText(TextStringList.cbETrace)
732NewbDevBoxInterfaceFramecbETraceButton:SetScript(
733 "OnClick",
734 function()
735 if NewbDevBoxDisplayButtonTable[6].ETraceButton then
736 NewbDevBoxDisplayButtonTable[6].ETraceButton = false
737 else
738 NewbDevBoxDisplayButtonTable[6].ETraceButton = true
739 end
740 buttonFrameButtonLayout()
741 end
742)
743
744local NewbDevBoxInterfaceFramecbETraceStartButton =
745 CreateFrame(
746 "CheckButton",
747 "NewbDevBoxInterfaceFramecbETraceStartButton",
748 NewbDevBoxInterfaceFrame,
749 "UICheckButtonTemplate"
750)
751NewbDevBoxInterfaceFramecbETraceStartButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
752NewbDevBoxInterfaceFramecbETraceStartButton:SetPoint(
753 "BOTTOMLEFT",
754 NewbDevBoxInterfaceFramecbETraceButton,
755 "TOPLEFT",
756 0,
757 NumberList.checkBoxElementYGap
758)
759NewbDevBoxInterfaceFramecbETraceStartButton.text:SetFontObject(TextDimensionList.checkBoxFont)
760NewbDevBoxInterfaceFramecbETraceStartButton.text:SetText(TextStringList.cbEtraceStart)
761NewbDevBoxInterfaceFramecbETraceStartButton:SetScript(
762 "OnClick",
763 function()
764 if NewbDevBoxDisplayButtonTable[7].ETraceStartButton then
765 NewbDevBoxDisplayButtonTable[7].ETraceStartButton = false
766 else
767 NewbDevBoxDisplayButtonTable[7].ETraceStartButton = true
768 end
769 buttonFrameButtonLayout()
770 end
771)
772
773local NewbDevBoxInterfaceFramecbETraceStopButton =
774 CreateFrame(
775 "CheckButton",
776 "NewbDevBoxInterfaceFramecbETraceStopButton",
777 NewbDevBoxInterfaceFrame,
778 "UICheckButtonTemplate"
779)
780NewbDevBoxInterfaceFramecbETraceStopButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
781NewbDevBoxInterfaceFramecbETraceStopButton:SetPoint(
782 "BOTTOMLEFT",
783 NewbDevBoxInterfaceFramecbETraceStartButton,
784 "TOPLEFT",
785 0,
786 NumberList.checkBoxElementYGap
787)
788NewbDevBoxInterfaceFramecbETraceStopButton.text:SetFontObject(TextDimensionList.checkBoxFont)
789NewbDevBoxInterfaceFramecbETraceStopButton.text:SetText(TextStringList.cbEtraceStop)
790NewbDevBoxInterfaceFramecbETraceStopButton:SetScript(
791 "OnClick",
792 function()
793 if NewbDevBoxDisplayButtonTable[8].ETraceStopButton then
794 NewbDevBoxDisplayButtonTable[8].ETraceStopButton = false
795 else
796 NewbDevBoxDisplayButtonTable[8].ETraceStopButton = true
797 end
798 buttonFrameButtonLayout()
799 end
800)
801
802local NewbDevBoxInterfaceFramecbChatLogButton =
803 CreateFrame(
804 "CheckButton",
805 "NewbDevBoxInterfaceFramecbChatLogButton",
806 NewbDevBoxInterfaceFrame,
807 "UICheckButtonTemplate"
808)
809NewbDevBoxInterfaceFramecbChatLogButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
810NewbDevBoxInterfaceFramecbChatLogButton:SetPoint(
811 "BOTTOMLEFT",
812 NewbDevBoxInterfaceFramecbETraceStopButton,
813 "TOPLEFT",
814 0,
815 NumberList.checkBoxElementYGap
816)
817NewbDevBoxInterfaceFramecbChatLogButton.text:SetFontObject(TextDimensionList.checkBoxFont)
818NewbDevBoxInterfaceFramecbChatLogButton.text:SetText(TextStringList.cbChatLog)
819NewbDevBoxInterfaceFramecbChatLogButton:SetScript(
820 "OnClick",
821 function()
822 if NewbDevBoxDisplayButtonTable[9].ChatLogButton then
823 NewbDevBoxDisplayButtonTable[9].ChatLogButton = false
824 else
825 NewbDevBoxDisplayButtonTable[9].ChatLogButton = true
826 end
827 buttonFrameButtonLayout()
828 end
829)
830
831local NewbDevBoxInterfaceFramecbCombatLogButton =
832 CreateFrame(
833 "CheckButton",
834 "NewbDevBoxInterfaceFramecbCombatLogButton",
835 NewbDevBoxInterfaceFrame,
836 "UICheckButtonTemplate"
837)
838NewbDevBoxInterfaceFramecbCombatLogButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
839NewbDevBoxInterfaceFramecbCombatLogButton:SetPoint(
840 "BOTTOMLEFT",
841 NewbDevBoxInterfaceFramecbChatLogButton,
842 "TOPLEFT",
843 0,
844 NumberList.checkBoxElementYGap
845)
846NewbDevBoxInterfaceFramecbCombatLogButton.text:SetFontObject(TextDimensionList.checkBoxFont)
847NewbDevBoxInterfaceFramecbCombatLogButton.text:SetText(TextStringList.cbCombatLog)
848NewbDevBoxInterfaceFramecbCombatLogButton:SetScript(
849 "OnClick",
850 function()
851 if NewbDevBoxDisplayButtonTable[10].CombatLogButton then
852 NewbDevBoxDisplayButtonTable[10].CombatLogButton = false
853 else
854 NewbDevBoxDisplayButtonTable[10].CombatLogButton = true
855 end
856 buttonFrameButtonLayout()
857 end
858)
859
860local NewbDevBoxInterfaceFramecbVersionButton =
861 CreateFrame(
862 "CheckButton",
863 "NewbDevBoxInterfaceFramecbVersionButton",
864 NewbDevBoxInterfaceFrame,
865 "UICheckButtonTemplate"
866)
867NewbDevBoxInterfaceFramecbVersionButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
868NewbDevBoxInterfaceFramecbVersionButton:SetPoint(
869 "BOTTOMLEFT",
870 NewbDevBoxInterfaceFramecbCombatLogButton,
871 "TOPLEFT",
872 0,
873 NumberList.checkBoxElementYGap
874)
875NewbDevBoxInterfaceFramecbVersionButton.text:SetFontObject(TextDimensionList.checkBoxFont)
876NewbDevBoxInterfaceFramecbVersionButton.text:SetText(TextStringList.cbVersionButton)
877NewbDevBoxInterfaceFramecbVersionButton:SetScript(
878 "OnClick",
879 function()
880 if NewbDevBoxDisplayButtonTable[11].VersionButton then
881 NewbDevBoxDisplayButtonTable[11].VersionButton = false
882 else
883 NewbDevBoxDisplayButtonTable[11].VersionButton = true
884 end
885 buttonFrameButtonLayout()
886 end
887)
888
889-- =========================== other addon checkboxes ===========================
890local NewbDevBoxInterfaceFramecbBugSackButton =
891 CreateFrame(
892 "CheckButton",
893 "NewbDevBoxInterfaceFramecbBugSackButton",
894 NewbDevBoxInterfaceFrame,
895 "UICheckButtonTemplate"
896)
897NewbDevBoxInterfaceFramecbBugSackButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
898NewbDevBoxInterfaceFramecbBugSackButton:SetPoint(
899 "LEFT",
900 NewbDevBoxInterfaceFramecbLogoutButton,
901 "RIGHT",
902 NumberList.checkBoxElementXGap,
903 0
904)
905NewbDevBoxInterfaceFramecbBugSackButton.text:SetFontObject(TextDimensionList.checkBoxFont)
906NewbDevBoxInterfaceFramecbBugSackButton.text:SetText(
907 TextDimensionList.disabledTextColour .. TextStringList.cbBugSackButton
908) -- default grey checkbox text
909NewbDevBoxInterfaceFramecbBugSackButton:Disable() -- default disable checkbox
910NewbDevBoxInterfaceFramecbBugSackButton:SetScript(
911 "OnClick",
912 function()
913 if NewbDevBoxDisplayButtonTable[12].BugSackButton then
914 NewbDevBoxDisplayButtonTable[12].BugSackButton = false
915 else
916 NewbDevBoxDisplayButtonTable[12].BugSackButton = true
917 end
918 buttonFrameButtonLayout()
919 end
920)
921
922local NewbDevBoxInterfaceFramecbBugSackClearButton =
923 CreateFrame(
924 "CheckButton",
925 "NewbDevBoxInterfaceFramecbBugSackClearButton",
926 NewbDevBoxInterfaceFrame,
927 "UICheckButtonTemplate"
928)
929NewbDevBoxInterfaceFramecbBugSackClearButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
930NewbDevBoxInterfaceFramecbBugSackClearButton:SetPoint(
931 "BOTTOMLEFT",
932 NewbDevBoxInterfaceFramecbBugSackButton,
933 "TOPLEFT",
934 0,
935 NumberList.checkBoxElementYGap
936)
937NewbDevBoxInterfaceFramecbBugSackClearButton.text:SetFontObject(TextDimensionList.checkBoxFont)
938NewbDevBoxInterfaceFramecbBugSackClearButton.text:SetText(
939 TextDimensionList.disabledTextColour .. TextStringList.cbBugSackClearButton
940) -- default grey checkbox text
941NewbDevBoxInterfaceFramecbBugSackClearButton:Disable() -- default disable checkbox
942NewbDevBoxInterfaceFramecbBugSackClearButton:SetScript(
943 "OnClick",
944 function()
945 if NewbDevBoxDisplayButtonTable[13].BugSackClearButton then
946 NewbDevBoxDisplayButtonTable[13].BugSackClearButton = false
947 else
948 NewbDevBoxDisplayButtonTable[13].BugSackClearButton = true
949 end
950 buttonFrameButtonLayout()
951 end
952)
953
954local NewbDevBoxInterfaceFramecbWoWLuaButton =
955 CreateFrame(
956 "CheckButton",
957 "NewbDevBoxInterfaceFramecbWoWLuaButton",
958 NewbDevBoxInterfaceFrame,
959 "UICheckButtonTemplate"
960)
961NewbDevBoxInterfaceFramecbWoWLuaButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
962NewbDevBoxInterfaceFramecbWoWLuaButton:SetPoint(
963 "BOTTOMLEFT",
964 NewbDevBoxInterfaceFramecbBugSackClearButton,
965 "TOPLEFT",
966 0,
967 NumberList.checkBoxElementYGap
968)
969NewbDevBoxInterfaceFramecbWoWLuaButton.text:SetFontObject(TextDimensionList.checkBoxFont)
970NewbDevBoxInterfaceFramecbWoWLuaButton.text:SetText(
971 TextDimensionList.disabledTextColour .. TextStringList.cbWoWLuaButton
972) -- default grey checkbox text
973NewbDevBoxInterfaceFramecbWoWLuaButton:Disable() -- default disable checkbox
974NewbDevBoxInterfaceFramecbWoWLuaButton:SetScript(
975 "OnClick",
976 function()
977 if NewbDevBoxDisplayButtonTable[14].WoWLuaButton then
978 NewbDevBoxDisplayButtonTable[14].WoWLuaButton = false
979 else
980 NewbDevBoxDisplayButtonTable[14].WoWLuaButton = true
981 end
982 buttonFrameButtonLayout()
983 end
984)
985
986local NewbDevBoxInterfaceFramecbREHackButton =
987 CreateFrame(
988 "CheckButton",
989 "NewbDevBoxInterfaceFramecbREHackButton",
990 NewbDevBoxInterfaceFrame,
991 "UICheckButtonTemplate"
992)
993NewbDevBoxInterfaceFramecbREHackButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
994NewbDevBoxInterfaceFramecbREHackButton:SetPoint(
995 "BOTTOMLEFT",
996 NewbDevBoxInterfaceFramecbWoWLuaButton,
997 "TOPLEFT",
998 0,
999 NumberList.checkBoxElementYGap
1000)
1001NewbDevBoxInterfaceFramecbREHackButton.text:SetFontObject(TextDimensionList.checkBoxFont)
1002NewbDevBoxInterfaceFramecbREHackButton.text:SetText(
1003 TextDimensionList.disabledTextColour .. TextStringList.cbREHackButton
1004) -- default grey checkbox text
1005NewbDevBoxInterfaceFramecbREHackButton:Disable() -- default disable checkbox
1006NewbDevBoxInterfaceFramecbREHackButton:SetScript(
1007 "OnClick",
1008 function()
1009 if NewbDevBoxDisplayButtonTable[15].REHackButton then
1010 NewbDevBoxDisplayButtonTable[15].REHackButton = false
1011 else
1012 NewbDevBoxDisplayButtonTable[15].REHackButton = true
1013 end
1014 buttonFrameButtonLayout()
1015 end
1016)
1017
1018local NewbDevBoxInterfaceFramecbViragDevToolButton =
1019 CreateFrame(
1020 "CheckButton",
1021 "NewbDevBoxInterfaceFramecbViragDevToolButton",
1022 NewbDevBoxInterfaceFrame,
1023 "UICheckButtonTemplate"
1024)
1025NewbDevBoxInterfaceFramecbViragDevToolButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
1026NewbDevBoxInterfaceFramecbViragDevToolButton:SetPoint(
1027 "BOTTOMLEFT",
1028 NewbDevBoxInterfaceFramecbREHackButton,
1029 "TOPLEFT",
1030 0,
1031 NumberList.checkBoxElementYGap
1032)
1033NewbDevBoxInterfaceFramecbViragDevToolButton.text:SetFontObject(TextDimensionList.checkBoxFont)
1034NewbDevBoxInterfaceFramecbViragDevToolButton.text:SetText(
1035 TextDimensionList.disabledTextColour .. TextStringList.cbViragDevToolButton
1036) -- default grey checkbox text
1037NewbDevBoxInterfaceFramecbViragDevToolButton:Disable() -- default disable checkbox
1038NewbDevBoxInterfaceFramecbViragDevToolButton:SetScript(
1039 "OnClick",
1040 function()
1041 if NewbDevBoxDisplayButtonTable[16].ViragDevToolButton then
1042 NewbDevBoxDisplayButtonTable[16].ViragDevToolButton = false
1043 else
1044 NewbDevBoxDisplayButtonTable[16].ViragDevToolButton = true
1045 end
1046 buttonFrameButtonLayout()
1047 end
1048)
1049
1050local NewbDevBoxInterfaceFramecbAPIInterfaceButton =
1051 CreateFrame(
1052 "CheckButton",
1053 "NewbDevBoxInterfaceFramecbAPIInterfaceButton",
1054 NewbDevBoxInterfaceFrame,
1055 "UICheckButtonTemplate"
1056)
1057NewbDevBoxInterfaceFramecbAPIInterfaceButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
1058NewbDevBoxInterfaceFramecbAPIInterfaceButton:SetPoint(
1059 "BOTTOMLEFT",
1060 NewbDevBoxInterfaceFramecbViragDevToolButton,
1061 "TOPLEFT",
1062 0,
1063 NumberList.checkBoxElementYGap
1064)
1065NewbDevBoxInterfaceFramecbAPIInterfaceButton.text:SetFontObject(TextDimensionList.checkBoxFont)
1066NewbDevBoxInterfaceFramecbAPIInterfaceButton.text:SetText(
1067 TextDimensionList.disabledTextColour .. TextStringList.cbAPIInterfaceButton
1068) -- default grey checkbox text
1069NewbDevBoxInterfaceFramecbAPIInterfaceButton:Disable() -- default disable checkbox
1070NewbDevBoxInterfaceFramecbAPIInterfaceButton:SetScript(
1071 "OnClick",
1072 function()
1073 if NewbDevBoxDisplayButtonTable[17].APIInterfaceButton then
1074 NewbDevBoxDisplayButtonTable[17].APIInterfaceButton = false
1075 else
1076 NewbDevBoxDisplayButtonTable[17].APIInterfaceButton = true
1077 end
1078 buttonFrameButtonLayout()
1079 end
1080)
1081
1082local NewbDevBoxInterfaceFramecbHandleItButton =
1083 CreateFrame(
1084 "CheckButton",
1085 "NewbDevBoxInterfaceFramecbHandleItButton",
1086 NewbDevBoxInterfaceFrame,
1087 "UICheckButtonTemplate"
1088)
1089NewbDevBoxInterfaceFramecbHandleItButton:SetSize(NumberList.checkBoxSize, NumberList.checkBoxSize)
1090NewbDevBoxInterfaceFramecbHandleItButton:SetPoint(
1091 "BOTTOMLEFT",
1092 NewbDevBoxInterfaceFramecbAPIInterfaceButton,
1093 "TOPLEFT",
1094 0,
1095 NumberList.checkBoxElementYGap
1096)
1097NewbDevBoxInterfaceFramecbHandleItButton.text:SetFontObject(TextDimensionList.checkBoxFont)
1098NewbDevBoxInterfaceFramecbHandleItButton.text:SetText(TextDimensionList.disabledTextColour .. TextStringList.cbHandleIt) -- default grey checkbox text
1099NewbDevBoxInterfaceFramecbHandleItButton:Disable() -- default disable checkbox
1100NewbDevBoxInterfaceFramecbHandleItButton:SetScript(
1101 "OnClick",
1102 function()
1103 if NewbDevBoxDisplayButtonTable[18].HandleItButton then
1104 NewbDevBoxDisplayButtonTable[18].HandleItButton = false
1105 else
1106 NewbDevBoxDisplayButtonTable[18].HandleItButton = true
1107 end
1108 buttonFrameButtonLayout()
1109 end
1110)
1111
1112-- ===================================================================================================
1113-- ===================================================================================================
1114-- =========================== button frame ===========================
1115-- ===================================================================================================
1116-- ===================================================================================================
1117
1118local NewbDevBoxButtonFrame = CreateFrame("Frame", "NewbDevBoxButtonFrame", UIParent, "UIPanelDialogTemplate")
1119NewbDevBoxButtonFrame:SetSize(NumberList.buttonFrameWidth, NumberList.buttonFrameDefaultHeight)
1120NewbDevBoxButtonFrame:ClearAllPoints()
1121NewbDevBoxButtonFrame:SetPoint("CENTER")
1122NewbDevBoxButtonFrame:EnableMouse(true)
1123NewbDevBoxButtonFrame:SetMovable(true)
1124NewbDevBoxButtonFrame:SetClampedToScreen(true)
1125NewbDevBoxButtonFrame:RegisterForDrag("RightButton", "LeftButton")
1126NewbDevBoxButtonFrame:SetScript("OnDragStart", NewbDevBoxButtonFrame.StartMoving)
1127NewbDevBoxButtonFrame:SetScript("OnDragStop", NewbDevBoxButtonFrame.StopMovingOrSizing)
1128NewbDevBoxButtonFrame:SetToplevel(true)
1129
1130NewbDevBoxButtonFrame.TitleButton = CreateFrame("Button", "NewbDevBoxButtonFrameTitleButton", NewbDevBoxButtonFrame)
1131NewbDevBoxButtonFrame.TitleButton:SetSize(NumberList.buttonFrameTitleButtonWidth, NumberList.actionButtonHeight)
1132NewbDevBoxButtonFrame.TitleButton:SetPoint("TOP", NewbDevBoxButtonFrame, "TOP", 0, -1)
1133NewbDevBoxButtonFrame.TitleButton:SetText(TextDimensionList.addonColour .. TextStringList.btnNewbDevBox)
1134NewbDevBoxButtonFrame.TitleButton:SetNormalFontObject(NewbDevBoxButton)
1135NewbDevBoxButtonFrame.TitleButton:SetHighlightFontObject(NewbDevBoxButton)
1136NewbDevBoxButtonFrame.TitleButton:SetScript(
1137 "OnClick",
1138 function()
1139 NEWBDEVBOXTOGGLENEWBDEVBOXINTERFACEFRAME()
1140 end
1141)
1142
1143NewbDevBoxButtonFrame.ReloadButton =
1144 CreateFrame("Button", "NewbDevBoxButtonFrameReloadButton", NewbDevBoxButtonFrame, "GameMenuButtonTemplate")
1145NewbDevBoxButtonFrame.ReloadButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1146NewbDevBoxButtonFrame.ReloadButton:SetPoint(
1147 "TOPLEFT",
1148 NewbDevBoxButtonFrame,
1149 "TOPLEFT",
1150 NumberList.actionButtonSideFrameGap,
1151 NumberList.actionButtonTopGap
1152)
1153NewbDevBoxButtonFrame.ReloadButton:SetText(TextStringList.btnReload)
1154NewbDevBoxButtonFrame.ReloadButton:SetScript(
1155 "OnClick",
1156 function()
1157 ReloadUI()
1158 end
1159)
1160
1161local NewbDevBoxButtonFrameLogoutButton =
1162 CreateFrame(
1163 "Button",
1164 "NewbDevBoxButtonFrameLogoutButton",
1165 NewbDevBoxButtonFrame,
1166 "SecureActionButtonTemplate, GameMenuButtonTemplate"
1167)
1168NewbDevBoxButtonFrameLogoutButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1169NewbDevBoxButtonFrameLogoutButton:SetText(TextStringList.btnLogout)
1170NewbDevBoxButtonFrameLogoutButton:SetAttribute("type", "macro")
1171NewbDevBoxButtonFrameLogoutButton:SetAttribute("macrotext", "/logout")
1172
1173local NewbDevBoxButtonFrameExitButton =
1174 CreateFrame(
1175 "Button",
1176 "NewbDevBoxButtonFrameExitButton",
1177 NewbDevBoxButtonFrame,
1178 "SecureActionButtonTemplate, GameMenuButtonTemplate"
1179)
1180NewbDevBoxButtonFrameExitButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1181NewbDevBoxButtonFrameExitButton:SetText(TextStringList.btnExit)
1182NewbDevBoxButtonFrameExitButton:SetAttribute("type", "macro")
1183NewbDevBoxButtonFrameExitButton:SetAttribute("macrotext", "/exit")
1184
1185local NewbDevBoxButtonFrameFStackButton =
1186 CreateFrame("Button", "NewbDevBoxButtonFrameFStackButton", NewbDevBoxButtonFrame, "GameMenuButtonTemplate")
1187NewbDevBoxButtonFrameFStackButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1188NewbDevBoxButtonFrameFStackButton:SetText(TextStringList.btnFStack)
1189NewbDevBoxButtonFrameFStackButton:SetScript(
1190 "OnClick",
1191 function(self)
1192 if not FrameStackTooltip_Toggle then
1193 LoadAddOn("Blizzard_DebugTools")
1194 end
1195 FrameStackTooltip_Toggle()
1196 end
1197)
1198
1199local NewbDevBoxButtonFrameClearChatButton =
1200 CreateFrame("Button", "NewbDevBoxButtonFrameClearChatButton", NewbDevBoxButtonFrame, "GameMenuButtonTemplate")
1201NewbDevBoxButtonFrameClearChatButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1202NewbDevBoxButtonFrameClearChatButton:SetText(TextStringList.btnClearChat)
1203NewbDevBoxButtonFrameClearChatButton:SetScript(
1204 "OnClick",
1205 function()
1206 SELECTED_CHAT_FRAME:Clear()
1207 end
1208)
1209
1210local NewbDevBoxButtonFrameChatSpacerButton =
1211 CreateFrame("Button", "NewbDevBoxButtonFrameChatSpacerButton", NewbDevBoxButtonFrame, "GameMenuButtonTemplate")
1212NewbDevBoxButtonFrameChatSpacerButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1213NewbDevBoxButtonFrameChatSpacerButton:SetText(TextStringList.btnChatSpacer)
1214NewbDevBoxButtonFrameChatSpacerButton:SetScript(
1215 "OnClick",
1216 function()
1217 print(TextStringList.printChatSpacer)
1218 print(TextStringList.printChatSpacer)
1219 end
1220)
1221
1222local NewbDevBoxButtonFrameETraceButton =
1223 CreateFrame(
1224 "Button",
1225 "NewbDevBoxButtonFrameETraceButton",
1226 NewbDevBoxButtonFrame,
1227 "SecureActionButtonTemplate, GameMenuButtonTemplate"
1228)
1229NewbDevBoxButtonFrameETraceButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1230NewbDevBoxButtonFrameETraceButton:SetText(TextStringList.btnETrace)
1231NewbDevBoxButtonFrameETraceButton:SetAttribute("type", "macro")
1232NewbDevBoxButtonFrameETraceButton:SetAttribute("macrotext", "/eventtrace")
1233
1234local NewbDevBoxButtonFrameETraceStartButton =
1235 CreateFrame(
1236 "Button",
1237 "NewbDevBoxButtonFrameETraceStartButton",
1238 NewbDevBoxButtonFrame,
1239 "SecureActionButtonTemplate, GameMenuButtonTemplate"
1240)
1241NewbDevBoxButtonFrameETraceStartButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1242NewbDevBoxButtonFrameETraceStartButton:SetText(TextStringList.btnEtraceStart)
1243NewbDevBoxButtonFrameETraceStartButton:SetAttribute("type", "macro")
1244NewbDevBoxButtonFrameETraceStartButton:SetAttribute("macrotext", "/eventtrace start")
1245
1246local NewbDevBoxButtonFrameETraceStopButton =
1247 CreateFrame("Button", "NewbDevBoxButtonFrameETraceStopButton", NewbDevBoxButtonFrame, "GameMenuButtonTemplate")
1248NewbDevBoxButtonFrameETraceStopButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1249NewbDevBoxButtonFrameETraceStopButton:SetText(TextStringList.btnEtraceStop)
1250NewbDevBoxButtonFrameETraceStopButton:SetScript(
1251 "OnClick",
1252 function()
1253 if not FrameStackTooltip_Toggle then
1254 LoadAddOn("Blizzard_DebugTools")
1255 end
1256 EventTraceFrame_StopEventCapture()
1257 end
1258)
1259
1260local NewbDevBoxButtonFrameChatLogButton =
1261 CreateFrame(
1262 "Button",
1263 "NewbDevBoxButtonFrameChatLogButton",
1264 NewbDevBoxButtonFrame,
1265 "SecureActionButtonTemplate, GameMenuButtonTemplate"
1266)
1267NewbDevBoxButtonFrameChatLogButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1268NewbDevBoxButtonFrameChatLogButton:SetText(TextStringList.btnChatLog)
1269NewbDevBoxButtonFrameChatLogButton:SetAttribute("type", "macro")
1270NewbDevBoxButtonFrameChatLogButton:SetAttribute("macrotext", "/chatlog")
1271
1272local NewbDevBoxButtonFrameCombatLogButton =
1273 CreateFrame(
1274 "Button",
1275 "NewbDevBoxButtonFrameCombatLogButton",
1276 NewbDevBoxButtonFrame,
1277 "SecureActionButtonTemplate, GameMenuButtonTemplate"
1278)
1279NewbDevBoxButtonFrameCombatLogButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1280NewbDevBoxButtonFrameCombatLogButton:SetText(TextStringList.btnCombatLog)
1281NewbDevBoxButtonFrameCombatLogButton:SetAttribute("type", "macro")
1282NewbDevBoxButtonFrameCombatLogButton:SetAttribute("macrotext", "/combatlog")
1283
1284local NewbDevBoxButtonFrameVersionButton =
1285 CreateFrame("Button", "NewbDevBoxButtonFrameVersionButton", NewbDevBoxButtonFrame, "GameMenuButtonTemplate")
1286NewbDevBoxButtonFrameVersionButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1287NewbDevBoxButtonFrameVersionButton:SetText(TextStringList.btnVersionButton)
1288NewbDevBoxButtonFrameVersionButton:SetScript(
1289 "OnClick",
1290 function()
1291 print(TextStringList.printChatSpacer)
1292 print(TextStringList.printVersion, select(4, GetBuildInfo()))
1293 print(TextStringList.printChatSpacer)
1294 end
1295)
1296
1297-- =========================== other addon buttons ===========================
1298local NewbDevBoxButtonFrameBugSackButton =
1299 CreateFrame("Button", "NewbDevBoxButtonFrameBugSackButton", NewbDevBoxButtonFrame, "GameMenuButtonTemplate")
1300NewbDevBoxButtonFrameBugSackButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1301NewbDevBoxButtonFrameBugSackButton:SetText(TextStringList.btnBugSackButton)
1302NewbDevBoxButtonFrameBugSackButton:SetScript(
1303 "OnClick",
1304 function()
1305 if BugSackFrame and BugSackFrame:IsShown() then
1306 bugsackFunctions:CloseSack()
1307 else
1308 bugsackFunctions:OpenSack()
1309 end
1310 end
1311)
1312
1313local NewbDevBoxButtonFrameBugSackClearButton =
1314 CreateFrame("Button", "NewbDevBoxButtonFrameBugSackClearButton", NewbDevBoxButtonFrame, "GameMenuButtonTemplate")
1315NewbDevBoxButtonFrameBugSackClearButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1316NewbDevBoxButtonFrameBugSackClearButton:SetText(TextStringList.btnBugSackClearButton)
1317NewbDevBoxButtonFrameBugSackClearButton:SetScript(
1318 "OnClick",
1319 function()
1320 bugsackFunctions:Reset()
1321 end
1322)
1323
1324local NewbDevBoxButtonFrameWoWLuaButton =
1325 CreateFrame("Button", "NewbDevBoxButtonFrameWoWLuaButton", NewbDevBoxButtonFrame, "GameMenuButtonTemplate")
1326NewbDevBoxButtonFrameWoWLuaButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1327NewbDevBoxButtonFrameWoWLuaButton:SetText(TextStringList.btnWoWLuaButton)
1328NewbDevBoxButtonFrameWoWLuaButton:SetScript(
1329 "OnClick",
1330 function()
1331 if WowLuaFrame:IsShown() then
1332 WowLuaFrame:Hide()
1333 else
1334 WowLuaFrame:Show()
1335 end
1336 end
1337)
1338
1339local NewbDevBoxButtonFrameREHackButton =
1340 CreateFrame(
1341 "Button",
1342 "NewbDevBoxButtonFrameREHackButton",
1343 NewbDevBoxButtonFrame,
1344 "SecureActionButtonTemplate, GameMenuButtonTemplate"
1345)
1346NewbDevBoxButtonFrameREHackButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1347NewbDevBoxButtonFrameREHackButton:SetText(TextStringList.btnREHackButton)
1348NewbDevBoxButtonFrameREHackButton:SetAttribute("type", "macro")
1349NewbDevBoxButtonFrameREHackButton:SetAttribute("macrotext", "/hack")
1350
1351local NewbDevBoxButtonFrameViragDevToolButton =
1352 CreateFrame("Button", "NewbDevBoxButtonFrameViragDevToolButton", NewbDevBoxButtonFrame, "GameMenuButtonTemplate")
1353NewbDevBoxButtonFrameViragDevToolButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1354NewbDevBoxButtonFrameViragDevToolButton:SetText(TextStringList.btnViragDevToolButton)
1355NewbDevBoxButtonFrameViragDevToolButton:SetScript(
1356 "OnClick",
1357 function()
1358 ViragDevTool:ToggleUI()
1359 end
1360)
1361
1362local NewbDevBoxButtonFrameAPIInterfaceButton =
1363 CreateFrame("Button", "NewbDevBoxButtonFrameAPIInterfaceButton", NewbDevBoxButtonFrame, "GameMenuButtonTemplate")
1364NewbDevBoxButtonFrameAPIInterfaceButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1365NewbDevBoxButtonFrameAPIInterfaceButton:SetText(TextStringList.btnAPIInterfaceButton)
1366NewbDevBoxButtonFrameAPIInterfaceButton:SetScript(
1367 "OnClick",
1368 function()
1369 if APII_Core:IsShown() then
1370 APII_Core:Hide()
1371 else
1372 APII_Core:Show()
1373 end
1374 end
1375)
1376
1377local NewbDevBoxButtonFrameHandleItButton =
1378 CreateFrame("Button", "NewbDevBoxButtonFrameHandleItButton", NewbDevBoxButtonFrame, "GameMenuButtonTemplate")
1379NewbDevBoxButtonFrameHandleItButton:SetSize(NumberList.actionButtonWidth, NumberList.actionButtonHeight)
1380NewbDevBoxButtonFrameHandleItButton:SetText(TextStringList.btnHandleIt)
1381
1382NewbDevBoxButtonFrameHandleItButton:SetScript(
1383 "OnClick",
1384 function()
1385 if InterfaceOptionsFrame:IsShown() then
1386 InterfaceOptionsFrame:Hide()
1387 else
1388 InterfaceOptionsFrame:Show()
1389 InterfaceOptionsFrameTab2:Click() -- click the addons tab
1390 for k, v in pairs(INTERFACEOPTIONS_ADDONCATEGORIES) do -- loop through all categories
1391 for a, b in pairs(v) do -- loop through the current category
1392 if b == "HandleIt" then -- if the current name value
1393 thisButton = _G["InterfaceOptionsFrameAddOnsButton" .. k] -- set the button name with the key value
1394 thisButton:Click()
1395 end
1396 end
1397 end
1398 end
1399 end
1400)
1401