From e77763afa044c0fd4a858962a06a820190aded67 Mon Sep 17 00:00:00 2001 From: Emik Date: Wed, 11 Feb 2026 19:21:05 +0100 Subject: [PATCH] Add debug options --- config.lua | 2 +- localization/en-us.lua | 3 +++ src/joker.lua | 4 ---- src/main.lua | 37 ++++++++++++++++++++++++++++++------- 4 files changed, 34 insertions(+), 12 deletions(-) diff --git a/config.lua b/config.lua index e78b40e..e28dc79 100644 --- a/config.lua +++ b/config.lua @@ -1 +1 @@ -return {["equinox_assist"] = false} +return {escapey_debugger = false, equinox_assist = false} diff --git a/localization/en-us.lua b/localization/en-us.lua index a364edd..fece232 100644 --- a/localization/en-us.lua +++ b/localization/en-us.lua @@ -297,6 +297,9 @@ return { b_Roland_bye = "Bye!", b_Roland_comma = ", ", b_Roland_entering_shop = "Entering shop!", + b_Roland_debug_export = "(Debug) Expose helpers", + b_Roland_escapey_debugger = "(Debug) Escapey prints context", + b_Roland_equinox_assist = "(Assist) Only hide text during Equinox Blind", b_Roland_most_common_card = "(Rank)", b_Roland_na = "N/A", b_Roland_of = " of ", diff --git a/src/joker.lua b/src/joker.lua index bd7cc1d..2a9a861 100644 --- a/src/joker.lua +++ b/src/joker.lua @@ -222,10 +222,6 @@ joker { level_up(v, 1, card) end) end, - debug_export = function(self, obj) - local to = obj or self - to.f, to.q, to.u = f, q, u - end, } joker { diff --git a/src/main.lua b/src/main.lua index bf115bb..c5850fd 100644 --- a/src/main.lua +++ b/src/main.lua @@ -24,15 +24,38 @@ end SMODS.current_mod.config_tab = function() return { n = G.UIT.ROOT, - config = {r = 0.1, minw = 8, minh = 6, align = "tl", padding = 0.2, colour = G.C.BLACK}, + config = {r = 0.1, minw = 4, minh = 4, align = "tr", padding = 0.2, colour = G.C.BLACK}, nodes = {{ n = G.UIT.C, - config = {minw = 1, minh = 1, align = "tl", colour = G.C.CLEAR, padding = 0.15}, - nodes = {create_toggle({ - label = "Assist: Only hide text during Equinox Blind", - ref_table = SMODS.Mods.Roland.config, - ref_value = "equinox_assist", - })}, + config = {minw = 1, minh = 1, align = "tr", padding = 0.2, colour = G.C.CLEAR}, + nodes = { + create_toggle { + label = localize {type = "variable", key = "b_Roland_equinox_assist"}, + ref_table = SMODS.Mods.Roland.config, + ref_value = "equinox_assist", + }, + SMODS.Mods.DebugPlus and create_toggle { + label = localize {type = "variable", key = "b_Roland_escapey_debugger"}, + ref_table = SMODS.Mods.Roland.config, + ref_value = "escapey_debugger", + callback = function(v) + G.escapey_debugger = v and print or nil + end, + }, + SMODS.Mods.DebugPlus and UIBox_button { + label = {localize {type = "variable", key = "b_Roland_debug_export"}}, + func = G.P_CENTERS.j_Roland_escapey.debug_export, + button = "Roland_debug_export", + colour = G.C.MULT, + col = true, + scale = 8, + }, + }, }}, } end + +function G.FUNCS.Roland_debug_export(_, tbl) + local to = tbl or _G + to.f, to.q, to.u = unpack(qol) +end