Pulse a hovered joker's combo partners on the board
While hovering a shop/pack joker (or an owned one), the owned jokers it synergizes with juice gently every ~0.9s, so the tooltip's partner names are matched to cards by eye. Partner set is computed once per hover and dropped when it ends. New config toggle: partner_highlight (default on); stays active in learning mode since it explains rather than judges. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -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)',
|
||||
|
||||
Reference in New Issue
Block a user