Roland/src/main.lua
2026-07-22 03:58:23 +02:00

97 lines
2.9 KiB
Lua

local qol = assert(SMODS.load_file "src/lib/shared.lua")() or require "lib.shared"
local animated = SMODS.current_mod.config.animated_icon
SMODS.current_mod.qol = qol
local f, q = qol[1], qol[2]
q {
front = true,
no_delete = true,
blocking = false,
blockable = false,
func = function()
local contributors = (Bakery_API or {}).contributors
if not contributors then
return false
end
f(assert(SMODS.load_file("src/credits.lua", "Roland"))() or require "credits"):each(function(v, k)
contributors["Roland_" .. k] = v
end)
if SMODS.Mods.DebugPlus and SMODS.Mods.Roland.config.import_funky then
_G.f, _G.q, _G.u, _G.c = unpack(qol)
end
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)
f(tbl):where(function(v, k)
if k == "align" and type(v) == "string" then
tbl[k] = "tr"
end
return k ~= "nodes" and type(v) == "table"
end):each(realign)
return tbl
end
local function toggle(id)
return realign(create_toggle {
label = localize {type = "variable", key = "b_Roland_" .. id},
ref_table = SMODS.Mods.Roland.config,
ref_value = id,
scale = 1.5,
})
end
SMODS.Atlas {
px = 256,
py = 256,
key = "modicon",
fps = animated and 12 or nil,
frames = animated and 12 or nil,
path = animated and "icon.png" or "unicon.png",
atlas_table = animated and "ANIMATION_ATLAS" or "ASSET_ATLAS",
}
function SMODS.current_mod.config_tab()
return {
n = G.UIT.ROOT,
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