From 8da464dcd27d059690a15156b7fb5405168c6e20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Correia?= Date: Fri, 15 May 2026 13:35:19 +0100 Subject: [PATCH] More restyling --- Data.lua | 4 ++-- UI.lua | 66 ++++++++++++++++++++++++++++---------------------------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/Data.lua b/Data.lua index 7ce6ffc..6706c49 100755 --- a/Data.lua +++ b/Data.lua @@ -252,8 +252,8 @@ end -- Item options: name and modifier (first entry = no item) AltSystem.Data.Items = { { name = "No item", modifier = 0 }, - { name = "Rare item", modifier = 3 }, - { name = "Epic item", modifier = 5 }, + { name = "Rare", modifier = 3 }, + { name = "Epic", modifier = 5 }, } -- Defense / Armor options: name and modifier diff --git a/UI.lua b/UI.lua index c838c90..0bccae5 100755 --- a/UI.lua +++ b/UI.lua @@ -372,41 +372,9 @@ function AltSystem:CreateMainFrame() 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) CreateSectionHeader(content, "Modifiers (optional)", PADDING, yPos) - yPos = yPos - 18 + yPos = yPos - 28 --CreateSubLabel(content, "Label", PADDING, yPos) --yPos = yPos - 22 @@ -484,6 +452,38 @@ function AltSystem:CreateMainFrame() 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 CreateSectionHeader(content, "Roll Dice", PADDING, yPos) yPos = yPos - 22