@@ -8,50 +8,26 @@ priority = -5
88[patches .pattern ]
99target = " functions/UI_definitions.lua"
1010pattern = " local challenge_unlocked = G.PROFILES[G.SETTINGS.profile].challenges_unlocked and (G.PROFILES[G.SETTINGS.profile].challenges_unlocked >= k)"
11- position = ' after'
12- payload = """
13- if v.unlocked and type(v.unlocked) == 'function' then
14- challenge_unlocked = v:unlocked()
15- elseif type(v.unlocked) == 'boolean' then
16- challenge_unlocked = v.unlocked
17- end
18- challenge_unlocked = challenge_unlocked or G.PROFILES[G.SETTINGS.profile].all_unlocked
19-
20- """
11+ position = ' at'
12+ payload = " local challenge_unlocked = SMODS.challenge_is_unlocked(v, k)"
2113match_indent = true
2214
2315# function G.UIDEF.challenges() - fix challenge unlock count
2416[[patches ]]
2517[patches .pattern ]
2618target = " functions/UI_definitions.lua"
2719pattern = """
28- function G.UIDEF.challenges(from_game_over)
29- """
30- position = ' after'
31- payload = """
32- local unlock_count = 0
33- """
34- match_indent = true
35-
36- # function G.UIDEF.challenges() - fix challenge unlock count p2
37- [[patches ]]
38- [patches .pattern ]
39- target = " functions/UI_definitions.lua"
40- pattern = """
4120local _ch_tab = {comp = _ch_comp, unlocked = G.PROFILES[G.SETTINGS.profile].challenges_unlocked}
4221"""
4322position = ' at'
4423payload = """
24+ local unlock_count = 0
4525for k, v in ipairs(G.CHALLENGES) do
46- if (v.unlocked and type(v.unlocked) == 'function' and v:unlocked())
47- or (v.unlocked == true)
48- or (G.PROFILES[G.SETTINGS.profile].all_unlocked)
49- or (not v.unlocked and (_ch_comp+5 <= k)) then
26+ if SMODS.challenge_is_unlocked(v, k) then
5027 unlock_count = unlock_count + 1
5128 end
5229end
53-
54- local _ch_tab = {comp = _ch_comp, unlocked = unlock_count or G.PROFILES[G.SETTINGS.profile].challenges_unlocked}
30+ local _ch_tab = {comp = _ch_comp, unlocked = unlock_count}
5531"""
5632match_indent = true
5733
0 commit comments