Migrate to SMODS.set_scoring_calculation

This commit is contained in:
Emik 2026-02-05 11:33:53 +01:00
parent 6ff684ed79
commit 777aa0ca75
Signed by: emik
GPG key ID: 6B0CD72A5E503BDF
2 changed files with 2 additions and 38 deletions

View file

@ -17,5 +17,5 @@
"conflicts": [ "conflicts": [
"Jen" "Jen"
], ],
"version": "1.5.19" "version": "1.5.20"
} }

View file

@ -7,12 +7,6 @@ SMODS.Atlas {
path = Jane.config.texture_pack .. "/bl_jane_blinds.png", path = Jane.config.texture_pack .. "/bl_jane_blinds.png",
} }
local final_operations = {
[1] = {"+", "UI_CHIPS"},
[2] = {"X", "UI_MULT"},
[3] = {"^", G.C.jane_RGB},
}
local function offset_operator(by) local function offset_operator(by)
local function set(number) local function set(number)
if G.GAME then if G.GAME then
@ -23,37 +17,7 @@ local function offset_operator(by)
local previous = Jane.get_operator() local previous = Jane.get_operator()
set(by + previous) set(by + previous)
by = Jane.get_operator() by = Jane.get_operator()
local txt = final_operations[by][1] ---@diagnostic disable-next-line: cast-local-type SMODS.set_scoring_calculation(({"add", "multiply", "exponent"})[by])
local col = type(final_operations[by][2]) == "table" and final_operations[by][2] or G.C[final_operations[by][2]]
Jane.q(function()
local changed_text = false
for _, outer in pairs(G.STAGE_OBJECTS) do
if type(outer) == "table" then
for _, inner in pairs(outer) do
if type(inner) == "table" and
type(inner.config) == "table" and
(inner.config.text == final_operations[previous][1] or
inner.config.text == final_operations[2][1]) and
inner.config.text_drawable then
if inner.config.text ~= txt then
changed_text = true
end
inner.config.text = txt
inner.config.text_drawable:set(txt)
inner.config.colour = col
inner:juice_up(0.8, 0.5)
end
end
end
end
if changed_text then
play_sound("button", 1.1, 0.65)
end
end)
end end
local function to_number(x) local function to_number(x)