feat/redesign #1

Merged
rukira merged 20 commits from feat/redesign into main 2026-05-15 14:53:16 +01:00
2 changed files with 40 additions and 12 deletions
Showing only changes of commit cdbaf7db93 - Show all commits

View file

@ -95,6 +95,43 @@ function AltSystem.CreateFlatDropdown(name, parent, width)
return btn return btn
end 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 ──────────────────────────────────────── -- ─── Create a single skill row frame ────────────────────────────────────────
local function CreateSkillRowFrame(index) local function CreateSkillRowFrame(index)
@ -326,15 +363,8 @@ function AltSystem:CreateBuildSkillsContent(parentFrame)
yPos = yPos - 20 yPos = yPos - 20
-- Save button (pinned to bottom, outside scroll frame) -- Save button (pinned to bottom, outside scroll frame)
local saveButton = CreateFrame("Button", "AltSystemSaveSkillsButton", parentFrame, "UIPanelButtonTemplate") local saveButton = AltSystem.CreateFlatButton("AltSystemSaveSkillsButton", parentFrame, 180, 30, "Save Skills to TRP")
saveButton:SetSize(180, 30)
saveButton:SetPoint("BOTTOM", parentFrame, "BOTTOM", 0, PADDING) 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() saveButton:SetScript("OnClick", function()
local success = AltSystem.Data:SaveSkills(editableSkills) local success = AltSystem.Data:SaveSkills(editableSkills)

6
UI.lua
View file

@ -514,11 +514,9 @@ function AltSystem:CreateMainFrame()
yPos = yPos - ROW_HEIGHT - SECTION_GAP yPos = yPos - ROW_HEIGHT - SECTION_GAP
-- Roll button -- 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" 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() rollBtn:SetScript("OnClick", function()
AltSystem:PerformRoll(AltSystem.State.rollType) AltSystem:PerformRoll(AltSystem.State.rollType)