Improve configuration

This commit is contained in:
Emik 2026-02-26 12:59:21 +01:00
parent 2526bee0b6
commit f0d127f2e5
Signed by: emik
GPG key ID: 6B0CD72A5E503BDF
5 changed files with 79 additions and 35 deletions

View file

@ -1 +1,7 @@
return {escapey_debugger = false, equinox_assist = false} return {
equinox_assist = false,
harsh_ante_scaling = true,
illusion_seal = true,
no_highlight_limit = true,
no_wild_debuff = true,
}

View file

@ -13,8 +13,8 @@ return {
name = "Pass GO Deck", name = "Pass GO Deck",
text = { text = {
"Start with a {C:attention}Credit Card", "Start with a {C:attention}Credit Card",
"Set money to {C:money}$0", "Set money to {C:money}$0 {}when",
"when entering the shop", "entering the shop",
}, },
}, },
b_Roland_swapper = { b_Roland_swapper = {
@ -28,7 +28,11 @@ return {
BakeryCharm = { BakeryCharm = {
BakeryCharm_Roland_cocacola = { BakeryCharm_Roland_cocacola = {
name = "coca cola phone", name = "coca cola phone",
text = {"Values on consumables", "increase by {C:attention}1"}, text = {
"Values on consumables",
"increase by {C:attention}1",
"{C:inactive}(excluding {C:planet}Planets{C:inactive})",
},
}, },
BakeryCharm_Roland_fat = { BakeryCharm_Roland_fat = {
name = "fat i phone", name = "fat i phone",
@ -290,8 +294,8 @@ return {
name = "Pass GO Sleeve", name = "Pass GO Sleeve",
text = { text = {
"Start with a {C:attention}Credit Card", "Start with a {C:attention}Credit Card",
"Set money to {C:money}$0", "Set money to {C:money}$0 {}when",
"when entering the shop", "entering the shop",
}, },
}, },
sleeve_Roland_go_alt = { sleeve_Roland_go_alt = {
@ -370,9 +374,13 @@ return {
b_Roland_entering_shop = "Entering shop!", b_Roland_entering_shop = "Entering shop!",
b_Roland_escape = "ESCAPE", b_Roland_escape = "ESCAPE",
b_Roland_fuse = "FUSE", b_Roland_fuse = "FUSE",
b_Roland_debug_export = "Debug: Import funky.lua to _G", b_Roland_debug_export = "Import funky.lua",
b_Roland_equinox_assist = "Assist: Only hide text during Equinox", b_Roland_equinox_assist = "Assist: Only hide text (Equinox)",
b_Roland_harsh_ante_scaling = "Harsh ante scaling (Ante 40+)",
b_Roland_illusion_seal = "Allow seals from Illusion voucher",
b_Roland_most_common_card = "(Rank)", b_Roland_most_common_card = "(Rank)",
b_Roland_no_highlight_limit = "No consumable highlight limit",
b_Roland_no_wild_debuff = "No wild card debuffs",
b_Roland_na = "N/A", b_Roland_na = "N/A",
b_Roland_of = " of ", b_Roland_of = " of ",
}, },

View file

@ -23,8 +23,11 @@ local function protect_ev(fun)
return fun return fun
end end
-- This exists to remove the @deprecated warning.
if false then if false then
-- This allows for better type inference.
SMODS.Mods.Roland.config = require "config"
-- This exists to remove the @deprecated warning.
---Returns the elements from the given `list`. This function is equivalent to ---Returns the elements from the given `list`. This function is equivalent to
---```lua ---```lua
--- return list[i], list[i+1], ···, list[j] --- return list[i], list[i+1], ···, list[j]

View file

@ -1,16 +1,17 @@
local qol = assert(SMODS.load_file "src/lib/shared.lua")() or require "lib.shared" local qol = assert(SMODS.load_file "src/lib/shared.lua")() or require "lib.shared"
local f, q = unpack(qol)
qol[1] {"challenge", "spectral", "tweaks", "blind", "charm", "joker", "back", "seal"}:each(function(v) f {"challenge", "spectral", "tweaks", "blind", "charm", "joker", "back", "seal"}:each(function(v)
assert(SMODS.load_file("src/" .. v .. ".lua"))(qol) assert(SMODS.load_file("src/" .. v .. ".lua"))(qol)
end) end)
if Balatest then if Balatest then
qol[1] {"joker", "blind", "spectral"}:each(function(v) f {"joker", "blind", "spectral"}:each(function(v)
assert(SMODS.load_file("src/tests/" .. v .. ".tests.lua"))(qol) assert(SMODS.load_file("src/tests/" .. v .. ".tests.lua"))(qol)
end) end)
end end
qol[2](function() q(function()
---@type table<string, {name: string, fg: table, bg: table}> ---@type table<string, {name: string, fg: table, bg: table}>
local contributors = Bakery_API.contributors local contributors = Bakery_API.contributors
@ -27,6 +28,15 @@ qol[2](function()
} }
end, true) end, true)
local function toggle(id)
return 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 { SMODS.Atlas {
px = 256, px = 256,
py = 256, py = 256,
@ -38,25 +48,30 @@ SMODS.Atlas {
function SMODS.current_mod.config_tab() function SMODS.current_mod.config_tab()
return { return {
n = G.UIT.ROOT, n = G.UIT.ROOT,
config = {r = 0.1, minw = 4, minh = 4, align = "tr", padding = 0.2, colour = G.C.BLACK}, 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 = "tr", padding = 0.2, colour = G.C.CLEAR},
nodes = { nodes = {
create_toggle { {
label = localize {type = "variable", key = "b_Roland_equinox_assist"}, n = G.UIT.C,
ref_table = SMODS.Mods.Roland.config, config = {minw = 1, minh = 1, align = "tl", padding = 0.1, colour = G.C.CLEAR},
ref_value = "equinox_assist", nodes = {
scale = 2, toggle "illusion_seal",
toggle "no_wild_debuff",
toggle "no_highlight_limit",
_G["Talisman"] and toggle "harsh_ante_scaling",
toggle "equinox_assist",
}, },
SMODS.Mods.DebugPlus and UIBox_button { },
SMODS.Mods.DebugPlus and {
n = G.UIT.C,
config = {minw = 2, minh = 2, align = "tl", padding = 0.2, colour = G.C.CLEAR},
nodes = {
UIBox_button {
label = {localize {type = "variable", key = "b_Roland_debug_export"}}, label = {localize {type = "variable", key = "b_Roland_debug_export"}},
func = G.P_CENTERS.j_Roland_escapey.debug_export, func = G.P_CENTERS.j_Roland_escapey.debug_export,
button = "Roland_debug_export", button = "Roland_debug_export",
colour = G.C.MULT, colour = G.C.MULT,
col = true, col = true,
scale = 5, scale = 5,
minw = 5,
}, },
}, },
}}, }},

View file

@ -8,7 +8,7 @@ local orig_copy_card = copy_card
---@diagnostic disable-next-line: duplicate-set-field ---@diagnostic disable-next-line: duplicate-set-field
function CardArea:can_highlight(...) function CardArea:can_highlight(...)
if self ~= G.consumeables then if self ~= G.consumeables and not SMODS.Mods.Roland.config.no_highlight_limit then
return orig_can_highlight(self, ...) return orig_can_highlight(self, ...)
end end
@ -19,7 +19,9 @@ end
---@diagnostic disable-next-line: duplicate-set-field ---@diagnostic disable-next-line: duplicate-set-field
function Card:set_debuff(...) function Card:set_debuff(...)
if self.config and self.config.center_key == "m_wild" then if self.config and
self.config.center_key == "m_wild" and
SMODS.Mods.Roland.config.no_wild_debuff then
self.debuff = false self.debuff = false
else else
orig_set_debuff(self, ...) orig_set_debuff(self, ...)
@ -28,6 +30,10 @@ end
---@diagnostic disable-next-line: duplicate-set-field ---@diagnostic disable-next-line: duplicate-set-field
function Card:highlight(is_highlighted, ...) function Card:highlight(is_highlighted, ...)
if not SMODS.Mods.Roland.config.no_highlight_limit then
return orig_highlight(self, is_highlighted, ...)
end
self.highlighted = is_highlighted self.highlighted = is_highlighted
if not G.CONTROLLER.HID.controller then if not G.CONTROLLER.HID.controller then
@ -88,7 +94,9 @@ q(function()
---@diagnostic disable-next-line: duplicate-set-field ---@diagnostic disable-next-line: duplicate-set-field
function Bakery_API.can_highlight_area(area, ...) function Bakery_API.can_highlight_area(area, ...)
return area == G.consumeables or orig_can_highlight_area(area, ...) return (area == G.consumeables and
SMODS.Mods.Roland.config.no_highlight_limit) or
orig_can_highlight_area(area, ...)
end end
end) end)
@ -99,6 +107,10 @@ function create_card_for_shop(...)
---@type Card ---@type Card
local ret = orig_create_card_for_shop(...) local ret = orig_create_card_for_shop(...)
if not SMODS.Mods.Roland.config.illusion_seal then
return ret
end
if not G.GAME.used_vouchers.v_illusion or if not G.GAME.used_vouchers.v_illusion or
not ({Default = true, Enhanced = true})[(((ret or {}).config or {}).center or {}).set] or not ({Default = true, Enhanced = true})[(((ret or {}).config or {}).center or {}).set] or
pseudorandom(pseudoseed "Roland_illusion") <= 0.8 then pseudorandom(pseudoseed "Roland_illusion") <= 0.8 then