From 66485a3cd8d49cfa987f01a37f8a2389d40c34fe Mon Sep 17 00:00:00 2001 From: Nnoggie <27819512+Nnoggie@users.noreply.github.com> Date: Thu, 8 Aug 2024 23:59:55 +0200 Subject: [PATCH] db debug flag for dev tools --- WagoUI/frames/mainFrame.lua | 2 +- WagoUI/utils/constants.lua | 3 +-- WagoUI_Creator/main.lua | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/WagoUI/frames/mainFrame.lua b/WagoUI/frames/mainFrame.lua index a24d6ca..3bf97b8 100644 --- a/WagoUI/frames/mainFrame.lua +++ b/WagoUI/frames/mainFrame.lua @@ -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() diff --git a/WagoUI/utils/constants.lua b/WagoUI/utils/constants.lua index 5d951aa..2bcfb2b 100644 --- a/WagoUI/utils/constants.lua +++ b/WagoUI/utils/constants.lua @@ -2,8 +2,6 @@ local addon = select(2, ...) local L = addon.L -addon.debug = true - addon.color = "FFC1272D"; addon.colorRGB = { 193 / 255, @@ -18,6 +16,7 @@ addon.slashPrefixes = { addon.ADDON_WIDTH = 800 addon.ADDON_HEIGHT = 600 addon.dbDefaults = { + debug = false, anchorTo = "CENTER", anchorFrom = "CENTER", xoffset = 0, diff --git a/WagoUI_Creator/main.lua b/WagoUI_Creator/main.lua index 9f2f69f..9f3307f 100644 --- a/WagoUI_Creator/main.lua +++ b/WagoUI_Creator/main.lua @@ -15,6 +15,7 @@ local currentProfileDropdowns = {} local LAP = LibStub:GetLibrary("LibAddonProfiles") local dbDefaults = { + debug = false, anchorTo = "CENTER", anchorFrom = "CENTER", xoffset = 0, @@ -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)