diff --git a/lovely/blind.toml b/lovely/blind.toml index 9464dd24..5f7a3128 100644 --- a/lovely/blind.toml +++ b/lovely/blind.toml @@ -200,14 +200,17 @@ payload = ''' [patches.pattern] target = 'blind.lua' pattern = "local loc_target = localize{type = 'raw_descriptions', key = self.config.blind.key, set = 'Blind', vars = loc_vars or self.config.blind.vars}" -position = 'before' +position = 'at' match_indent = true payload = ''' +local target = {type = 'raw_descriptions', key = self.config.blind.key, set = 'Blind', vars = loc_vars or self.config.blind.vars} local obj = self.config.blind if obj.loc_vars and type(obj.loc_vars) == 'function' then local res = obj:loc_vars() or {} - loc_vars = res.vars or {} -end''' + target.vars = res.vars or target.vars + target.key = res.key or target.key +end +local loc_target = localize(target)''' # Blind:load() [[patches]] @@ -301,16 +304,17 @@ pattern = "local loc_target = localize{type = 'raw_descriptions', key = blind_ch match_indent = true position = 'at' payload = ''' -local loc_vars = nil +local target = {type = 'raw_descriptions', key = self.config.blind.key, set = 'Blind', vars = loc_vars or self.config.blind.vars} if blind_choice.config.name == 'The Ox' then - loc_vars = {localize(G.GAME.current_round.most_played_poker_hand, 'poker_hands')} + target.vars = {localize(G.GAME.current_round.most_played_poker_hand, 'poker_hands')} end local obj = blind_choice.config if obj.loc_vars and _G['type'](obj.loc_vars) == 'function' then local res = obj:loc_vars() or {} - loc_vars = res.vars or {} + target.vars = res.vars or target.vars + target.key = res.key or target.key end -local loc_target = localize{type = 'raw_descriptions', key = blind_choice.config.key, set = 'Blind', vars = loc_vars or blind_choice.config.vars}''' +local loc_target = localize(target)''' # create_UIBox_blind_popup() [[patches]] diff --git a/lovely/center.toml b/lovely/center.toml index 5c1eca8e..6bc34b53 100644 --- a/lovely/center.toml +++ b/lovely/center.toml @@ -111,13 +111,30 @@ pattern = "(?[\t ]+)if (?_c.name == 'Golden Ticket' then)" line_prepend = '$indent' position = 'at' payload = ''' +local res = {} if _c.locked_loc_vars and type(_c.locked_loc_vars) == 'function' then - local res = _c:locked_loc_vars(info_queue) or {} + res = _c:locked_loc_vars(info_queue) or {} loc_vars = res.vars or {} specific_vars = specific_vars or {} specific_vars.not_hidden = res.not_hidden or specific_vars.not_hidden elseif $rest''' +[[patches]] +[patches.pattern] +target = 'functions/common_events.lua' +position = 'at' +match_indent = true +pattern = "localize{type = 'unlocks', key = 'joker_locked_legendary', set = 'Other', nodes = desc_nodes, vars = loc_vars}" +payload = "localize{type = 'unlocks', key = res.key or 'joker_locked_legendary', set = res.set or 'Other', nodes = desc_nodes, vars = loc_vars, text_colour = res.text_colour, scale = res.scale}" + +[[patches]] +[patches.pattern] +target = 'functions/common_events.lua' +position = 'at' +match_indent = true +pattern = "localize{type = 'unlocks', key = _c.key, set = _c.set, nodes = desc_nodes, vars = loc_vars}" +payload = "localize{type = 'unlocks', key = res.key or _c.key, set = res.set or _c.set, nodes = desc_nodes, vars = loc_vars, text_colour = res.text_colour, scale = res.scale}" + [[patches]] [patches.pattern] target = 'functions/common_events.lua' @@ -126,6 +143,8 @@ match_indent = true pattern = 'elseif desc_nodes ~= full_UI_table.main then' payload = 'elseif desc_nodes ~= full_UI_table.main and not desc_nodes.name then' + + # check_for_unlock() [[patches]] [patches.regex] diff --git a/lovely/seal.toml b/lovely/seal.toml index ad922d3f..fe751609 100644 --- a/lovely/seal.toml +++ b/lovely/seal.toml @@ -157,6 +157,7 @@ if seal and seal.generate_ui ~= 0 then local res = seal:loc_vars(info_queue, card) or {} t.vars = res.vars t.key = res.key or t.key + t.set = res.set or t.set end else''' [[patches]] diff --git a/lovely/sticker.toml b/lovely/sticker.toml index d077e471..7e6e848b 100644 --- a/lovely/sticker.toml +++ b/lovely/sticker.toml @@ -35,6 +35,7 @@ if sticker then res = sticker:loc_vars(info_queue, card) or {} t.vars = res.vars or {} t.key = res.key or t.key + t.set = res.set or t.set end info_queue[#info_queue+1] = t else''' diff --git a/src/game_object.lua b/src/game_object.lua index a84d7082..5ea3c0a1 100644 --- a/src/game_object.lua +++ b/src/game_object.lua @@ -2610,7 +2610,7 @@ Set `prefix_config.key = false` on your object instead.]]):format(obj.key), obj. } local res = {} if self.loc_vars and type(self.loc_vars) == 'function' then - -- card is a dead arg here + -- card is actually a `Tag` here res = self:loc_vars(info_queue, card) or {} target.vars = res.vars or target.vars target.key = res.key or target.key diff --git a/version.lua b/version.lua index 42999412..e919da85 100644 --- a/version.lua +++ b/version.lua @@ -1 +1 @@ -return "1.0.0~ALPHA-1224b-STEAMODDED" +return "1.0.0~ALPHA-1224c-STEAMODDED"