From 3b4edab356fd065f99393cf48fc0c325e25de988 Mon Sep 17 00:00:00 2001 From: Casimir Eisenach Date: Sat, 21 Dec 2024 21:25:37 +0100 Subject: [PATCH] no_collection bugfixes (collection count, alerts) --- lovely/ui.toml | 33 ++++++++++++++++++++++++++++++++- src/ui.lua | 2 +- version.lua | 2 +- 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/lovely/ui.toml b/lovely/ui.toml index 8c0c527b..00eaddd0 100644 --- a/lovely/ui.toml +++ b/lovely/ui.toml @@ -356,4 +356,35 @@ payload = 'not part.control.C and args.text_colour or loc_colour(part.control.C target = 'functions/misc_functions.lua' position = 'after' pattern = 'part\.control\.s and tonumber\(part\.control\.s\)' -payload = ' or args.scale ' \ No newline at end of file +payload = ' or args.scale ' + +# set_discover_tallies() +# exclude no_collection objects +[[patches]] +[patches.pattern] +target = 'functions/misc_functions.lua' +match_indent = true +position = 'at' +pattern = "if not v.omit then" +payload = "if not v.omit and not v.no_collection then" + +[[patches]] +[patches.regex] +target = 'functions/misc_functions.lua' +line_prepend = '$indent' +position = 'at' +pattern = '(?[\t ]*)(?for _, v in pairs\(G\.P_[BT].*)(?(\n.*){7})' +payload = '''$start + if not v.no_collection then + $rest +end +''' + +#set_alerts() +[[patches]] +[patches.pattern] +target = 'functions/common_events.lua' +match_indent = true +position = 'at' +pattern = "if v.discovered and not v.alerted then" +payload = "if v.discovered and not v.alerted and not v.no_collection then" \ No newline at end of file diff --git a/src/ui.lua b/src/ui.lua index 8fc6d820..11c7ff24 100644 --- a/src/ui.lua +++ b/src/ui.lua @@ -843,7 +843,7 @@ function modsCollectionTally(pool, set) local obj_tally = {tally = 0, of = 0} for _, v in pairs(pool) do - if v.mod and G.ACTIVE_MOD_UI.id == v.mod.id then + if v.mod and G.ACTIVE_MOD_UI.id == v.mod.id and not v.no_collection then if set then if v.set and v.set == set then obj_tally.of = obj_tally.of+1 diff --git a/version.lua b/version.lua index 7d05e2fc..83af37bb 100644 --- a/version.lua +++ b/version.lua @@ -1 +1 @@ -return "1.0.0~ALPHA-1220a-STEAMODDED" +return "1.0.0~ALPHA-1221a-STEAMODDED"