From ea71aed1b9f7ca42da53b459da9e4a54da1124cd Mon Sep 17 00:00:00 2001 From: Foo45 <157067370+Foo54@users.noreply.github.com> Date: Fri, 3 Apr 2026 22:52:52 -0400 Subject: [PATCH 1/7] Update utils.lua --- src/utils.lua | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/src/utils.lua b/src/utils.lua index 8e8876eb9..8c5d7b9cf 100644 --- a/src/utils.lua +++ b/src/utils.lua @@ -3050,26 +3050,29 @@ function SMODS.scale_card(card, args) args.block_overrides = args.block_overrides or {} args.ref_table = args.ref_table or card.ability.extra args.scalar_table = args.scalar_table or args.ref_table + args.do_calc_scaling = args.do_calc_scaling ~= nil and args.do_calc_scaling or true local initial = args.ref_table[args.ref_value] local scalar_value = args.scalar_table[args.scalar_value] if args.operation == '-' and scalar_value < 0 then scalar_value = scalar_value * -1 end local scaling_message = args.scaling_message local scaling_responses = {} - for _, area in ipairs(SMODS.get_card_areas('jokers')) do - for _, _card in ipairs(area.cards) do - local obj = _card.config.center - if obj.calc_scaling and type(obj.calc_scaling) == "function" then - local ret = obj:calc_scaling(_card, card, initial, scalar_value, args) - if ret then - if ret.override_value and not args.block_overrides.value then initial = ret.override_value.value; SMODS.calculate_effect(ret.override_value, _card) end - if ret.override_scalar_value and not args.block_overrides.scalar then scalar_value = ret.override_scalar_value.value; SMODS.calculate_effect(ret.override_scalar_value, _card) end - if ret.override_message and not args.block_overrides.message then scaling_message = SMODS.merge_defaults(ret.override_message, scaling_message) end - if ret.post then ret.post.source = _card; scaling_responses[#scaling_responses + 1] = ret.post end - SMODS.calculate_effect(ret, _card) - end - end - end - end + if args.do_calc_scaling then + for _, area in ipairs(SMODS.get_card_areas('jokers')) do + for _, _card in ipairs(area.cards) do + local obj = _card.config.center + if obj.calc_scaling and type(obj.calc_scaling) == "function" then + local ret = obj:calc_scaling(_card, card, initial, scalar_value, args) + if ret then + if ret.override_value and not args.block_overrides.value then initial = ret.override_value.value; SMODS.calculate_effect(ret.override_value, _card) end + if ret.override_scalar_value and not args.block_overrides.scalar then scalar_value = ret.override_scalar_value.value; SMODS.calculate_effect(ret.override_scalar_value, _card) end + if ret.override_message and not args.block_overrides.message then scaling_message = SMODS.merge_defaults(ret.override_message, scaling_message) end + if ret.post then ret.post.source = _card; scaling_responses[#scaling_responses + 1] = ret.post end + SMODS.calculate_effect(ret, _card) + end + end + end + end + end if card.edition then local edition = G.P_CENTERS[card.edition.key] if edition.calc_scaling and type(edition.calc_scaling) == 'function' then @@ -4050,4 +4053,4 @@ end -- Simple unlock text function, created to give mod authors an option to hook rather than patch for their use cases. function SMODS.create_unlock_text(center) return localize('k_'..string.lower(center and center.set or 'unknown')) -end \ No newline at end of file +end From c753985ab641b1630e0db3f47eb4a66f76f75abc Mon Sep 17 00:00:00 2001 From: Foo45 <157067370+Foo54@users.noreply.github.com> Date: Fri, 3 Apr 2026 22:54:02 -0400 Subject: [PATCH 2/7] Update utils.lua --- src/utils.lua | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/utils.lua b/src/utils.lua index 8c5d7b9cf..389c743d4 100644 --- a/src/utils.lua +++ b/src/utils.lua @@ -3073,19 +3073,21 @@ function SMODS.scale_card(card, args) end end end - if card.edition then - local edition = G.P_CENTERS[card.edition.key] - if edition.calc_scaling and type(edition.calc_scaling) == 'function' then - local ret = edition:calc_scaling(card, card, initial, scalar_value, args) - if ret then - if ret.override_value and not args.block_overrides.value then initial = ret.override_value.value; SMODS.calculate_effect(ret.override_value, card) end - if ret.override_scalar_value and not args.block_overrides.scalar then scalar_value = ret.override_scalar_value.value; SMODS.calculate_effect(ret.override_scalar_value, card) end - if ret.override_message and not args.block_overrides.message then scaling_message = SMODS.merge_defaults(ret.override_message, scaling_message) end - if ret.post then ret.post.source = card; scaling_responses[#scaling_responses + 1] = ret.post end - SMODS.calculate_effect(ret, card) - end - end - end + if args.do_calc_scaling then + if card.edition then + local edition = G.P_CENTERS[card.edition.key] + if edition.calc_scaling and type(edition.calc_scaling) == 'function' then + local ret = edition:calc_scaling(card, card, initial, scalar_value, args) + if ret then + if ret.override_value and not args.block_overrides.value then initial = ret.override_value.value; SMODS.calculate_effect(ret.override_value, card) end + if ret.override_scalar_value and not args.block_overrides.scalar then scalar_value = ret.override_scalar_value.value; SMODS.calculate_effect(ret.override_scalar_value, card) end + if ret.override_message and not args.block_overrides.message then scaling_message = SMODS.merge_defaults(ret.override_message, scaling_message) end + if ret.post then ret.post.source = card; scaling_responses[#scaling_responses + 1] = ret.post end + SMODS.calculate_effect(ret, card) + end + end + end + end if type(args.operation) == 'function' then args.operation(args.ref_table, args.ref_value, initial, scalar_value) From 695b6276bb8d633b794dcb25bd3135a008491a34 Mon Sep 17 00:00:00 2001 From: Foo45 <157067370+Foo54@users.noreply.github.com> Date: Wed, 29 Apr 2026 21:46:19 -0400 Subject: [PATCH 3/7] Create attention_text.toml --- lovely/attention_text.toml | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 lovely/attention_text.toml diff --git a/lovely/attention_text.toml b/lovely/attention_text.toml new file mode 100644 index 000000000..adb0caeb3 --- /dev/null +++ b/lovely/attention_text.toml @@ -0,0 +1,43 @@ +[manifest] +version = "1.0.0" +dump_lua = true +priority = -10 + +# insert font from attention text +[[patches]] +[patches.pattern] +target = 'functions/UI_definitions.lua' +pattern = '''{n=G.UIT.O, config={draw_layer = 1, object = DynaText({scale = args.scale, string = args.text, maxw = args.maxw, colours = {args.colour},float = true, shadow = true, silent = not args.noisy, args.scale, pop_in = 0, pop_in_rate = 6, rotate = args.rotate or nil})}},''' +position = 'at' +payload = '''{n=G.UIT.O, config={draw_layer = 1, object = DynaText({scale = args.scale, string = args.text, maxw = args.maxw, colours = {args.colour},float = true, shadow = true, silent = not args.noisy, args.scale, pop_in = 0, pop_in_rate = 6, rotate = args.rotate or nil, font = args.font})}},''' +match_indent = true + +# insert font into attention text +[[patches]] +[patches.pattern] +target = 'functions/common_events.lua' +pattern = '''attention_text({ + text = text, + scale = config.scale or 1, + hold = delay - 0.2, + colour = extra and extra.text_colour, + backdrop_colour = colour, + align = card_aligned, + major = card, + offset = {x = 0, y = y_off} + })''' +position = 'at' +payload = '''attention_text({ + text = text, + scale = config.scale or 1, + hold = delay - 0.2, + colour = extra and extra.text_colour, + backdrop_colour = colour, + align = card_aligned, + major = card, + offset = {x = 0, y = y_off}, + font = extra and extra.font and (type(extra.font) == "table" and extra.font or G.FONTS[extra.font] or SMODS.Fonts[extra.font]) + })''' +match_indent = true + + From 350c521d9a7cc557048239ef100f71931ed49103 Mon Sep 17 00:00:00 2001 From: Foo45 <157067370+Foo54@users.noreply.github.com> Date: Thu, 30 Apr 2026 06:03:16 -0400 Subject: [PATCH 4/7] reverted earlier pr --- src/utils.lua | 57 +++++++++++++++++++++++---------------------------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/src/utils.lua b/src/utils.lua index f847cd391..ec5a176a8 100644 --- a/src/utils.lua +++ b/src/utils.lua @@ -3084,43 +3084,38 @@ function SMODS.scale_card(card, args) args.block_overrides = args.block_overrides or {} args.ref_table = args.ref_table or card.ability.extra args.scalar_table = args.scalar_table or args.ref_table - args.do_calc_scaling = args.do_calc_scaling ~= nil and args.do_calc_scaling or true local initial = args.ref_table[args.ref_value] local scalar_value = args.scalar_table[args.scalar_value] if args.operation == '-' and scalar_value < 0 then scalar_value = scalar_value * -1 end local scaling_message = args.scaling_message local scaling_responses = {} - if args.do_calc_scaling then - for _, area in ipairs(SMODS.get_card_areas('jokers')) do - for _, _card in ipairs(area.cards) do - local obj = _card.config.center - if obj.calc_scaling and type(obj.calc_scaling) == "function" then - local ret = obj:calc_scaling(_card, card, initial, scalar_value, args) - if ret then - if ret.override_value and not args.block_overrides.value then initial = ret.override_value.value; SMODS.calculate_effect(ret.override_value, _card) end - if ret.override_scalar_value and not args.block_overrides.scalar then scalar_value = ret.override_scalar_value.value; SMODS.calculate_effect(ret.override_scalar_value, _card) end - if ret.override_message and not args.block_overrides.message then scaling_message = SMODS.merge_defaults(ret.override_message, scaling_message) end - if ret.post then ret.post.source = _card; scaling_responses[#scaling_responses + 1] = ret.post end - SMODS.calculate_effect(ret, _card) - end - end - end - end + for _, area in ipairs(SMODS.get_card_areas('jokers')) do + for _, _card in ipairs(area.cards) do + local obj = _card.config.center + if obj.calc_scaling and type(obj.calc_scaling) == "function" then + local ret = obj:calc_scaling(_card, card, initial, scalar_value, args) + if ret then + if ret.override_value and not args.block_overrides.value then initial = ret.override_value.value; SMODS.calculate_effect(ret.override_value, _card) end + if ret.override_scalar_value and not args.block_overrides.scalar then scalar_value = ret.override_scalar_value.value; SMODS.calculate_effect(ret.override_scalar_value, _card) end + if ret.override_message and not args.block_overrides.message then scaling_message = SMODS.merge_defaults(ret.override_message, scaling_message) end + if ret.post then ret.post.source = _card; scaling_responses[#scaling_responses + 1] = ret.post end + SMODS.calculate_effect(ret, _card) + end + end + end end - if args.do_calc_scaling then - if card.edition then - local edition = G.P_CENTERS[card.edition.key] - if edition.calc_scaling and type(edition.calc_scaling) == 'function' then - local ret = edition:calc_scaling(card, card, initial, scalar_value, args) - if ret then - if ret.override_value and not args.block_overrides.value then initial = ret.override_value.value; SMODS.calculate_effect(ret.override_value, card) end - if ret.override_scalar_value and not args.block_overrides.scalar then scalar_value = ret.override_scalar_value.value; SMODS.calculate_effect(ret.override_scalar_value, card) end - if ret.override_message and not args.block_overrides.message then scaling_message = SMODS.merge_defaults(ret.override_message, scaling_message) end - if ret.post then ret.post.source = card; scaling_responses[#scaling_responses + 1] = ret.post end - SMODS.calculate_effect(ret, card) - end - end - end + if card.edition then + local edition = G.P_CENTERS[card.edition.key] + if edition.calc_scaling and type(edition.calc_scaling) == 'function' then + local ret = edition:calc_scaling(card, card, initial, scalar_value, args) + if ret then + if ret.override_value and not args.block_overrides.value then initial = ret.override_value.value; SMODS.calculate_effect(ret.override_value, card) end + if ret.override_scalar_value and not args.block_overrides.scalar then scalar_value = ret.override_scalar_value.value; SMODS.calculate_effect(ret.override_scalar_value, card) end + if ret.override_message and not args.block_overrides.message then scaling_message = SMODS.merge_defaults(ret.override_message, scaling_message) end + if ret.post then ret.post.source = card; scaling_responses[#scaling_responses + 1] = ret.post end + SMODS.calculate_effect(ret, card) + end + end end if type(args.operation) == 'function' then From 25b8dee1b879558032f8e63d30eb0c575fe4c610 Mon Sep 17 00:00:00 2001 From: N Date: Thu, 30 Apr 2026 16:10:24 -0300 Subject: [PATCH 5/7] revert whitespace --- src/utils.lua | 56 +++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/utils.lua b/src/utils.lua index ec5a176a8..aaa957bef 100644 --- a/src/utils.lua +++ b/src/utils.lua @@ -3089,34 +3089,34 @@ function SMODS.scale_card(card, args) if args.operation == '-' and scalar_value < 0 then scalar_value = scalar_value * -1 end local scaling_message = args.scaling_message local scaling_responses = {} - for _, area in ipairs(SMODS.get_card_areas('jokers')) do - for _, _card in ipairs(area.cards) do - local obj = _card.config.center - if obj.calc_scaling and type(obj.calc_scaling) == "function" then - local ret = obj:calc_scaling(_card, card, initial, scalar_value, args) - if ret then - if ret.override_value and not args.block_overrides.value then initial = ret.override_value.value; SMODS.calculate_effect(ret.override_value, _card) end - if ret.override_scalar_value and not args.block_overrides.scalar then scalar_value = ret.override_scalar_value.value; SMODS.calculate_effect(ret.override_scalar_value, _card) end - if ret.override_message and not args.block_overrides.message then scaling_message = SMODS.merge_defaults(ret.override_message, scaling_message) end - if ret.post then ret.post.source = _card; scaling_responses[#scaling_responses + 1] = ret.post end - SMODS.calculate_effect(ret, _card) - end - end - end - end - if card.edition then - local edition = G.P_CENTERS[card.edition.key] - if edition.calc_scaling and type(edition.calc_scaling) == 'function' then - local ret = edition:calc_scaling(card, card, initial, scalar_value, args) - if ret then - if ret.override_value and not args.block_overrides.value then initial = ret.override_value.value; SMODS.calculate_effect(ret.override_value, card) end - if ret.override_scalar_value and not args.block_overrides.scalar then scalar_value = ret.override_scalar_value.value; SMODS.calculate_effect(ret.override_scalar_value, card) end - if ret.override_message and not args.block_overrides.message then scaling_message = SMODS.merge_defaults(ret.override_message, scaling_message) end - if ret.post then ret.post.source = card; scaling_responses[#scaling_responses + 1] = ret.post end - SMODS.calculate_effect(ret, card) - end - end - end + for _, area in ipairs(SMODS.get_card_areas('jokers')) do + for _, _card in ipairs(area.cards) do + local obj = _card.config.center + if obj.calc_scaling and type(obj.calc_scaling) == "function" then + local ret = obj:calc_scaling(_card, card, initial, scalar_value, args) + if ret then + if ret.override_value and not args.block_overrides.value then initial = ret.override_value.value; SMODS.calculate_effect(ret.override_value, _card) end + if ret.override_scalar_value and not args.block_overrides.scalar then scalar_value = ret.override_scalar_value.value; SMODS.calculate_effect(ret.override_scalar_value, _card) end + if ret.override_message and not args.block_overrides.message then scaling_message = SMODS.merge_defaults(ret.override_message, scaling_message) end + if ret.post then ret.post.source = _card; scaling_responses[#scaling_responses + 1] = ret.post end + SMODS.calculate_effect(ret, _card) + end + end + end + end + if card.edition then + local edition = G.P_CENTERS[card.edition.key] + if edition.calc_scaling and type(edition.calc_scaling) == 'function' then + local ret = edition:calc_scaling(card, card, initial, scalar_value, args) + if ret then + if ret.override_value and not args.block_overrides.value then initial = ret.override_value.value; SMODS.calculate_effect(ret.override_value, card) end + if ret.override_scalar_value and not args.block_overrides.scalar then scalar_value = ret.override_scalar_value.value; SMODS.calculate_effect(ret.override_scalar_value, card) end + if ret.override_message and not args.block_overrides.message then scaling_message = SMODS.merge_defaults(ret.override_message, scaling_message) end + if ret.post then ret.post.source = card; scaling_responses[#scaling_responses + 1] = ret.post end + SMODS.calculate_effect(ret, card) + end + end + end if type(args.operation) == 'function' then args.operation(args.ref_table, args.ref_value, initial, scalar_value) From b1a355dab6085537c462a48eee1ecbaba1f167ef Mon Sep 17 00:00:00 2001 From: N Date: Thu, 30 Apr 2026 16:16:21 -0300 Subject: [PATCH 6/7] make patch smaller --- lovely/attention_text.toml | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/lovely/attention_text.toml b/lovely/attention_text.toml index adb0caeb3..58181d0d9 100644 --- a/lovely/attention_text.toml +++ b/lovely/attention_text.toml @@ -16,28 +16,11 @@ match_indent = true [[patches]] [patches.pattern] target = 'functions/common_events.lua' -pattern = '''attention_text({ - text = text, - scale = config.scale or 1, - hold = delay - 0.2, - colour = extra and extra.text_colour, - backdrop_colour = colour, - align = card_aligned, - major = card, - offset = {x = 0, y = y_off} - })''' -position = 'at' -payload = '''attention_text({ - text = text, - scale = config.scale or 1, - hold = delay - 0.2, - colour = extra and extra.text_colour, - backdrop_colour = colour, - align = card_aligned, - major = card, - offset = {x = 0, y = y_off}, - font = extra and extra.font and (type(extra.font) == "table" and extra.font or G.FONTS[extra.font] or SMODS.Fonts[extra.font]) - })''' +pattern = '''offset = {x = 0, y = y_off}''' +position = 'before' +payload = ''' +font = extra and extra.font and (type(extra.font) == "table" and extra.font or G.FONTS[extra.font] or SMODS.Fonts[extra.font]), +''' match_indent = true From b25d6ae925522cd7326215ba52d2560d25eeeeaf Mon Sep 17 00:00:00 2001 From: Foo45 Date: Fri, 17 Jul 2026 19:48:29 -0400 Subject: [PATCH 7/7] new lovely patch --- lovely/unlock.toml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 lovely/unlock.toml diff --git a/lovely/unlock.toml b/lovely/unlock.toml new file mode 100644 index 000000000..904efae4c --- /dev/null +++ b/lovely/unlock.toml @@ -0,0 +1,17 @@ +[manifest] +version = "1.0.0" +dump_lua = true +priority = -10 + +# check_for_unlock +[[patches]] +[patches.pattern] +target = 'functions/common_events.lua' +pattern = '''if args.type == 'have_edition' then''' +position = 'at' +payload = '''if args.type == 'have_edition' and G.jokers then''' +match_indent = true + + + +