diff --git a/main.lua b/main.lua index c6aa108..2da6f39 100644 --- a/main.lua +++ b/main.lua @@ -714,6 +714,14 @@ local function reveal_params() end end +-- Cards must be materialized as they are emplaced, the way every vanilla +-- collection page does it -- otherwise they pop in with no animation when a +-- tab or a page is built. Only the first card of a page build plays the +-- whoosh; the rest are silent (vanilla's `i>1 or j>1` flag). Each tab def +-- calls begin_page() so the counter tracks one page, not one row. +local page_cards = 0 +local function begin_page() page_cards = 0 end + -- `face_down` renders the cards back-up (used for unfielded famous pairs); -- face-down cards also show no hover tooltip, keeping the mystery. local function card_row_node(keys, scale, face_down) @@ -732,6 +740,8 @@ local function card_row_node(keys, scale, face_down) card.facing = 'back' card.sprite_facing = 'back' end + card:start_materialize(nil, page_cards > 0) + page_cards = page_cards + 1 area:emplace(card) end end @@ -819,6 +829,7 @@ end -- One theme per page; the pager is labelled with theme names. local function theme_tab_def(group, page_no) + begin_page() page_no = math.min(page_no or 1, #group.themes) local theme = group.themes[page_no] local sources, payoffs, both = theme_members(theme.tag) @@ -886,6 +897,7 @@ end local PAIRS_PER_PAGE = 6 local sorted_pairs local function combos_tab_def(page_no) + begin_page() if not sorted_pairs or JCA._pairs_dirty then JCA._pairs_dirty = false sorted_pairs = {}