From 179cecd9fa96f69d4be5ea614e4ae732f3742762 Mon Sep 17 00:00:00 2001 From: Emik Date: Wed, 15 Jul 2026 13:15:08 +0200 Subject: [PATCH] Split settings into two columns with proper alignment --- manifest.json | 2 +- src/main.lua | 84 +++++++++++++++++++++++++++------------------------ 2 files changed, 46 insertions(+), 40 deletions(-) diff --git a/manifest.json b/manifest.json index c724662..7399b91 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "id": "Roland", "name": "Roland", "prefix": "Roland", - "version": "2.9.56", + "version": "2.9.57", "badge_colour": "8BE9FD", "display_name": "Roland", "main_file": "src/main.lua", diff --git a/src/main.lua b/src/main.lua index f8d2580..638026d 100644 --- a/src/main.lua +++ b/src/main.lua @@ -13,46 +13,44 @@ q { return false end - f(assert(SMODS.load_file "src/credits.lua")() or require "credits"):each(function(v, k) + f(assert(SMODS.load_file("src/credits.lua", "Roland"))() or require "credits"):each(function(v, k) contributors["Roland_" .. k] = v end) - if not SMODS.Mods.DebugPlus or not SMODS.Mods.Roland.config.import_funky then - return + if SMODS.Mods.DebugPlus and SMODS.Mods.Roland.config.import_funky then + _G.f, _G.q, _G.u, _G.c = unpack(qol) end - - _G.f, _G.q, _G.u, _G.c = unpack(qol) end, } -f { - "challenge", - "spectral", - "edition", - "voucher", - "tweaks", - "blind", - "charm", - "joker", - "tarot", - "back", - "seal", - "tag", -}:each(function(v) - assert(SMODS.load_file("src/" .. v .. ".lua"))(qol) -end) +f {"challenge", "spectral", "edition", "voucher", "tweaks", "blind", "charm", "joker", "tarot", "back", "seal", "tag"} + :each(function(v) + assert(SMODS.load_file("src/" .. v .. ".lua"))(qol) + end) local _ = Balatest and f {"joker", "blind", "spectral"}:each(function(v) assert(SMODS.load_file("src/tests/" .. v .. ".tests.lua"))(qol) end) +local function realign(tbl, align) + f(tbl):where(function(v, k) + if k == "align" and type(v) == "string" then + tbl[k] = align + end + + return k ~= "nodes" and type(v) == "table" + end):each(realign) + + return tbl +end + local function toggle(id) - return create_toggle { + return realign(create_toggle { label = localize {type = "variable", key = "b_Roland_" .. id}, ref_table = SMODS.Mods.Roland.config, ref_value = id, scale = 1.5, - } + }, "tr") end SMODS.current_mod.qol = qol @@ -71,22 +69,30 @@ SMODS.Atlas { function SMODS.current_mod.config_tab() return { n = G.UIT.ROOT, - config = {minw = 1, minh = 1, align = "tl", padding = 0.1, colour = G.C.BLACK}, - nodes = {{ - n = G.UIT.C, - config = {minw = 1, minh = 1, align = "tl", padding = 0.1, colour = G.C.CLEAR}, - nodes = { - toggle "animated_icon", - toggle "cool_phones", - toggle "faster_planets", - -- toggle "illusion_seal", - -- toggle "no_wild_debuff", - toggle "vitriol", - toggle "equinox_assist", - SMODS.Mods.DebugPlus and toggle "import_funky", - G.P_CENTERS.c_Bakery_Scribe and toggle "scribable_basket", - Talisman and toggle "harsh_ante_scaling", + config = {minw = 1, minh = 1, align = "tr", padding = 0.1, colour = G.C.BLACK}, + nodes = { + { + n = G.UIT.C, + config = {minw = 1, minh = 1, align = "tr", padding = 0.1, colour = G.C.CLEAR}, + nodes = { + toggle "animated_icon", + toggle "cool_phones", + toggle "vitriol", + toggle "equinox_assist", + G.P_CENTERS.c_Bakery_Scribe and toggle "scribable_basket", + }, }, - }}, + { + n = G.UIT.C, + config = {minw = 1, minh = 1, align = "tr", padding = 0.1, colour = G.C.CLEAR}, + nodes = { + toggle "faster_planets", + toggle "illusion_seal", + toggle "no_wild_debuff", + SMODS.Mods.DebugPlus and toggle "import_funky", + Talisman and toggle "harsh_ante_scaling", + }, + }, + }, } end