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