diff --git a/BuildSkillsUI.lua b/BuildSkillsUI.lua index 73bced0..c102705 100755 --- a/BuildSkillsUI.lua +++ b/BuildSkillsUI.lua @@ -95,6 +95,43 @@ function AltSystem.CreateFlatDropdown(name, parent, width) return btn end +-- ─── Helper: Create a flat dark button matching the blocky design ──────────── +-- Shared globally so other files (UI.lua) can reuse it. + +function AltSystem.CreateFlatButton(name, parent, width, height, text) + local btn = CreateFrame("Button", name, parent, "BackdropTemplate") + btn:SetSize(width, height) + btn:SetBackdrop({ + bgFile = "Interface\\ChatFrame\\ChatFrameBackground", + edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", + edgeSize = 1, + }) + btn:SetBackdropColor(0.4, 0.08, 0.08, 0.9) + btn:SetBackdropBorderColor(0.25, 0.25, 0.25, 1) + + local label = btn:CreateFontString(nil, "OVERLAY", "GameFontNormal") + label:SetPoint("CENTER") + label:SetText(text or "") + btn.label = label + + btn:SetScript("OnEnter", function(self) + self:SetBackdropColor(0.55, 0.12, 0.12, 0.9) + end) + btn:SetScript("OnLeave", function(self) + self:SetBackdropColor(0.4, 0.08, 0.08, 0.9) + end) + + function btn:SetText(newText) + self.label:SetText(newText) + end + + function btn:GetText() + return self.label:GetText() + end + + return btn +end + -- ─── Create a single skill row frame ──────────────────────────────────────── local function CreateSkillRowFrame(index) @@ -326,15 +363,8 @@ function AltSystem:CreateBuildSkillsContent(parentFrame) yPos = yPos - 20 -- Save button (pinned to bottom, outside scroll frame) - local saveButton = CreateFrame("Button", "AltSystemSaveSkillsButton", parentFrame, "UIPanelButtonTemplate") - saveButton:SetSize(180, 30) + local saveButton = AltSystem.CreateFlatButton("AltSystemSaveSkillsButton", parentFrame, 180, 30, "Save Skills to TRP") saveButton:SetPoint("BOTTOM", parentFrame, "BOTTOM", 0, PADDING) - saveButton:SetText("Save Skills to TRP") - - -- Style the save button with a dark red tint - local saveBg = saveButton:CreateTexture(nil, "BACKGROUND") - saveBg:SetAllPoints() - saveBg:SetColorTexture(0.4, 0.08, 0.08, 0.9) saveButton:SetScript("OnClick", function() local success = AltSystem.Data:SaveSkills(editableSkills) diff --git a/UI.lua b/UI.lua index 0bccae5..bfc7013 100755 --- a/UI.lua +++ b/UI.lua @@ -514,11 +514,9 @@ function AltSystem:CreateMainFrame() yPos = yPos - ROW_HEIGHT - SECTION_GAP -- Roll button - local rollBtn = CreateFrame("Button", "AltSystemRollBtn", content, "UIPanelButtonTemplate") - rollBtn:SetSize(CONTROLS_WIDTH - PADDING * 2, 32) - rollBtn:SetPoint("TOPLEFT", content, "TOPLEFT", PADDING, yPos) local rollLabel = AltSystem.State.rollType == "attack" and "Roll Attack" or "Roll Defense" - rollBtn:SetText(rollLabel) + local rollBtn = AltSystem.CreateFlatButton("AltSystemRollBtn", content, CONTROLS_WIDTH - PADDING * 2, 32, rollLabel) + rollBtn:SetPoint("TOPLEFT", content, "TOPLEFT", PADDING, yPos) rollBtn:SetScript("OnClick", function() AltSystem:PerformRoll(AltSystem.State.rollType)