More restyling

This commit is contained in:
Gonçalo Correia 2026-05-15 13:42:08 +01:00
parent 8da464dcd2
commit cdbaf7db93
2 changed files with 40 additions and 12 deletions

View file

@ -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)