diff --git a/config.lua b/config.lua index e2ba4dc..0e70b7d 100644 --- a/config.lua +++ b/config.lua @@ -3,6 +3,7 @@ return { pulse = true, -- recommended shop jokers pulse periodically owned_tooltip = true, -- show "Active combos" tooltip on owned jokers + partner_highlight = true, -- hovering a joker pulses its owned partners threshold = 4, -- total synergy score needed to recommend a card learning_mode = false, -- hide verdicts (pulse, "Strong pick!"), keep reasons touch_mode = true, -- enlarge advice text/buttons for phone screens diff --git a/main.lua b/main.lua index c0e0bc4..58cd907 100644 --- a/main.lua +++ b/main.lua @@ -318,6 +318,32 @@ end -- Shop pulse ------------------------------------------------------------------ +-- Partner highlight: while a joker is hovered, the owned jokers it combos +-- with pulse gently so your eyes can find them on the board. The partner +-- set is computed once per hover (scoring every frame would be wasteful) +-- and dropped when the hover ends, so board changes are picked up. +local function highlight_partners(card, dt) + if not (card.states and card.states.hover and card.states.hover.is) then + card.jca_hl = nil + return + end + if not card.jca_hl then + local set = {} + for _, p in ipairs(JCA.partners_for(card)) do set[p.key] = true end + card.jca_hl = {set = set, t = 99} -- oversized t: first pulse now + end + card.jca_hl.t = card.jca_hl.t + dt + if card.jca_hl.t >= 0.9 then + card.jca_hl.t = 0 + for _, owned in ipairs(G.jokers and G.jokers.cards or {}) do + if owned ~= card and owned.config and owned.config.center + and card.jca_hl.set[owned.config.center.key] then + owned:juice_up(0.15, 0.08) + end + end + end +end + local orig_update = Card.update function Card:update(dt) orig_update(self, dt) @@ -331,6 +357,11 @@ function Card:update(dt) if ok and rec then self:juice_up(0.25, 0.15) end end end + if JCA.config.partner_highlight and G.STAGE == G.STAGES.RUN + and is_joker(self) + and (in_buy_area(self) or self.area == G.jokers) then + pcall(highlight_partners, self, dt) + end end -- Combo discovery tracking ----------------------------------------------------- @@ -941,6 +972,12 @@ if SMODS.current_mod then ref_table = JCA.config, ref_value = 'owned_tooltip', }, }}, + {n = G.UIT.R, config = {align = 'cm', padding = 0.05}, nodes = { + create_toggle{ + label = 'Highlight combo partners on hover', + ref_table = JCA.config, ref_value = 'partner_highlight', + }, + }}, {n = G.UIT.R, config = {align = 'cm', padding = 0.05}, nodes = { create_toggle{ label = 'Learning mode (no verdicts, just reasons)',