Skip to content

Commit

Permalink
db debug flag for dev tools
Browse files Browse the repository at this point in the history
  • Loading branch information
Nnoggie committed Aug 8, 2024
1 parent 7c3b4d2 commit 66485a3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion WagoUI/frames/mainFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function addon:CreateMainFrame()
forceErrorButton:SetClickFunction(addon.TestErrorHandling);
forceErrorButton:Hide()

if addon.debug then
if addon.db.debug then
autoStartCheckbox:Show()
resetButton:Show()
forceErrorButton:Show()
Expand Down
3 changes: 1 addition & 2 deletions WagoUI/utils/constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
local addon = select(2, ...)
local L = addon.L

addon.debug = true

addon.color = "FFC1272D";
addon.colorRGB = {
193 / 255,
Expand All @@ -18,6 +16,7 @@ addon.slashPrefixes = {
addon.ADDON_WIDTH = 800
addon.ADDON_HEIGHT = 600
addon.dbDefaults = {
debug = false,
anchorTo = "CENTER",
anchorFrom = "CENTER",
xoffset = 0,
Expand Down
14 changes: 14 additions & 0 deletions WagoUI_Creator/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ local currentProfileDropdowns = {}
local LAP = LibStub:GetLibrary("LibAddonProfiles")

local dbDefaults = {
debug = false,
anchorTo = "CENTER",
anchorFrom = "CENTER",
xoffset = 0,
Expand Down Expand Up @@ -413,25 +414,38 @@ function addon:CreateFrames()
WagoUICreatorDB.autoStart = value
end,
WagoUICreatorDB.autoStart)
autoStartCheckbox:Hide()
autoStartCheckbox:SetPoint("TOPLEFT", frame, "TOPRIGHT", 5, 0)

local autoStartLabel = DF:CreateLabel(frame, "Startup", 16, "white")
autoStartLabel:SetPoint("LEFT", autoStartCheckbox, "RIGHT", 0, 0)
autoStartLabel:Hide()

local resetButton = LWF:CreateButton(frame, 60, 40, "RESET", 16)
resetButton:SetPoint("TOPLEFT", frame, "TOPRIGHT", 0, -60)
resetButton:SetClickFunction(function() addon:ResetOptions() end)
resetButton:Hide()

local forceErrorButton = LWF:CreateButton(frame, 120, 40, "Force Error", 16)
forceErrorButton:Hide()
forceErrorButton:SetPoint("TOPLEFT", frame, "TOPRIGHT", 0, -110)
forceErrorButton:SetClickFunction(addon.TestErrorHandling)

local testButton = LWF:CreateButton(frame, 120, 40, "Test Stuff", 16)
testButton:Hide()
testButton:SetPoint("TOPLEFT", frame, "TOPRIGHT", 0, -160)
testButton:SetClickFunction(function()
addon.frames.mainFrame.frameContent.contentScrollbox:Refresh()
end)

if addon.db.debug then
autoStartCheckbox:Show()
autoStartLabel:Show()
resetButton:Show()
forceErrorButton:Show()
testButton:Show()
end

local frameContent = CreateFrame("Frame", nil, frame)
frameContent:SetPoint("TOPLEFT", frame.TitleBar, "BOTTOMLEFT", 0, -5)
frameContent:SetPoint("TOPRIGHT", frame.TitleBar, "BOTTOMRIGHT", 0, -5)
Expand Down

0 comments on commit 66485a3

Please sign in to comment.