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 35 additions and 35 deletions
Showing only changes of commit 8da464dcd2 - Show all commits

View file

@ -252,8 +252,8 @@ end
-- Item options: name and modifier (first entry = no item) -- Item options: name and modifier (first entry = no item)
AltSystem.Data.Items = { AltSystem.Data.Items = {
{ name = "No item", modifier = 0 }, { name = "No item", modifier = 0 },
{ name = "Rare item", modifier = 3 }, { name = "Rare", modifier = 3 },
{ name = "Epic item", modifier = 5 }, { name = "Epic", modifier = 5 },
} }
-- Defense / Armor options: name and modifier -- Defense / Armor options: name and modifier

66
UI.lua
View file

@ -372,41 +372,9 @@ function AltSystem:CreateMainFrame()
yPos = yPos - ROW_HEIGHT - SECTION_GAP yPos = yPos - ROW_HEIGHT - SECTION_GAP
-- Item label
CreateSubLabel(content, "Item", PADDING, yPos)
yPos = yPos - 20
-- Item radio buttons
local itemRadios = {}
local function UpdateItemSelection(index)
AltSystem.State.selectedItemIndex = index
for i, radio in ipairs(itemRadios) do
radio:SetChecked(i == index)
radio.UpdateVisual()
end
end
local itemX = PADDING
for i, item in ipairs(AltSystem.Data.Items) do
local text = item.name
if item.modifier > 0 then
text = text .. " (+" .. item.modifier .. ")"
end
local radio = CreateRadioButton(content, "AltSystemItemRadio" .. i, text, itemX, yPos,
AltSystem.State.selectedItemIndex == i,
function()
UpdateItemSelection(i)
end)
table.insert(itemRadios, radio)
itemX = itemX + 110
end
yPos = yPos - ROW_HEIGHT - SECTION_GAP
-- Section: Modifiers (optional) -- Section: Modifiers (optional)
CreateSectionHeader(content, "Modifiers (optional)", PADDING, yPos) CreateSectionHeader(content, "Modifiers (optional)", PADDING, yPos)
yPos = yPos - 18 yPos = yPos - 28
--CreateSubLabel(content, "Label", PADDING, yPos) --CreateSubLabel(content, "Label", PADDING, yPos)
--yPos = yPos - 22 --yPos = yPos - 22
@ -484,6 +452,38 @@ function AltSystem:CreateMainFrame()
yPos = yPos - ROW_HEIGHT - SECTION_GAP yPos = yPos - ROW_HEIGHT - SECTION_GAP
-- Item label
CreateSubLabel(content, "Item", PADDING, yPos)
yPos = yPos - 20
-- Item radio buttons
local itemRadios = {}
local function UpdateItemSelection(index)
AltSystem.State.selectedItemIndex = index
for i, radio in ipairs(itemRadios) do
radio:SetChecked(i == index)
radio.UpdateVisual()
end
end
local itemX = PADDING
for i, item in ipairs(AltSystem.Data.Items) do
local text = item.name
if item.modifier > 0 then
text = text .. " (+" .. item.modifier .. ")"
end
local radio = CreateRadioButton(content, "AltSystemItemRadio" .. i, text, itemX, yPos,
AltSystem.State.selectedItemIndex == i,
function()
UpdateItemSelection(i)
end)
table.insert(itemRadios, radio)
itemX = itemX + 110
end
yPos = yPos - ROW_HEIGHT - SECTION_GAP
-- Section: Roll Dice -- Section: Roll Dice
CreateSectionHeader(content, "Roll Dice", PADDING, yPos) CreateSectionHeader(content, "Roll Dice", PADDING, yPos)
yPos = yPos - 22 yPos = yPos - 22