From c40dba8de4762c69bb5458d406d4e2dd4b3a06bc Mon Sep 17 00:00:00 2001 From: Robin Anderson <81711759+VioletTides@users.noreply.github.com> Date: Fri, 16 Oct 2026 13:08:37 -0400 Subject: [PATCH] Show only the knock kinds left on in the tour's knock steps The double and triple knock steps cycled through all three kinds, so a card listing only together and table knocks still showed a headset knock. With every kind off, the steps still show all three. --- src/panel.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/panel.cpp b/src/panel.cpp index c1e84c3..4bd7407 100644 --- a/src/panel.cpp +++ b/src/panel.cpp @@ -730,9 +730,13 @@ void Panel::tour_knock_step(const PanelState& state, const TourView& tour) { canvas_.text(bold_, triple ? "Knock three times" : "Knock twice", kMargin, 68, 38, kText); const Rect box{kMargin, 128, 420, 500}; canvas_.rounded_rect(box, kRadius, kSurface); - // The scene shows each knock kind in turn, one per loop. + // The scene shows each knock kind left on in turn, one per loop. + std::vector shown; + for (int k = 0; k < 3; ++k) + if (state.enabled[k]) shown.push_back(static_cast(k)); + if (shown.empty()) shown = {KnockKind::Together, KnockKind::Surface, KnockKind::Headset}; const double loop = 2.6; - const auto kind = static_cast(static_cast(now_ / loop) % 3); + const auto kind = shown[static_cast(now_ / loop) % shown.size()]; knock_scene(kind, {box.x + 20, box.y + 40, box.w - 40, 340}, static_cast(std::fmod(now_, loop)), triple ? 3 : 2); canvas_.text(bold_, kKindTitles[static_cast(kind)], box.x + box.w / 2, box.y + 440, 28, kText, Align::Center);