From 51bfb93fd0aebc259c95bb7ebb75d4ed47354f4b Mon Sep 17 00:00:00 2001 From: RobinFiredrake Date: Sun, 8 Nov 2026 17:55:22 -0600 Subject: [PATCH] Router captions and hover summary, Test board run count, README branching MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The tray captions router steps with the case taken, router hover summaries no longer read "d2 · 2 results", the Test board runs selector starts on the last report's run count, and the README covers conditional pipes and router cards. Co-Authored-By: Claude Opus 5.5 --- README.md | 5 +++++ ui/details_popup.gd | 2 ++ ui/result_tray.gd | 3 +++ ui/test_board_dialog.gd | 6 +++++- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 821e133..3686124 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,11 @@ godot --path . headline when a chain reaches them. Results can carry effects (`@hp -= 2`), edited with the **ƒ** button in Build mode. The tray's Variables tab lists every variable, with **Reset all…**. Try `examples/logic_demo.json` (Board ▾ → Import). +- **Branching:** click a pipe in Build mode to give it an **Only if** condition + (`@str >= 8`), or mark it **Otherwise** so it runs only when none of that result's + conditions are true. All of a result's conditions and pipe counts are checked once, before + any pipe runs, and only the pipes taken light up. A **Router** card (+ Table ▾) lists cases + ("if @species = "Aslan"", "if @str >= 10", "Otherwise") and takes the first true one. - **Collections:** the switcher in the top bar holds separate sets of tables. Build mode's **Board ▾** menu imports and exports TableTower JSON, JSON Canvas, Mermaid, DOT and GraphML. - **Ranged tables** (like *Wilderness Travel*) roll a d100 where each range's size sets its diff --git a/ui/details_popup.gd b/ui/details_popup.gd index ef58848..73e61d7 100644 --- a/ui/details_popup.gd +++ b/ui/details_popup.gd @@ -229,6 +229,8 @@ func table_summary(t: RollTable) -> String: return "Variable @%s · %s" % [t.var_name, t.var_type] RollTable.KIND_SHEET: return "Sheet" + RollTable.KIND_ROUTER: + return "Router · %d cases · the first true case is taken" % t.entries.size() var parts := PackedStringArray([t.dice_label()]) parts.append("%d %s" % [t.entries.size(), "ranges" if t.is_ranged() else "results"]) if t.card_mode: diff --git a/ui/result_tray.gd b/ui/result_tray.gd index b9f6422..62935aa 100644 --- a/ui/result_tray.gd +++ b/ui/result_tray.gd @@ -437,6 +437,9 @@ static func caption_for(step: Dictionary) -> String: caption += " · afterwards" RollTable.KIND_SHEET: caption += " · sheet" + RollTable.KIND_ROUTER: + if step.has("case"): + caption += " · case %d" % (int(step["case"]) + 1) _: if num != "": caption += " · rolled %s on %s" % [num, step.get("dice", "d%d" % int(step.get("die", 0)))] diff --git a/ui/test_board_dialog.gd b/ui/test_board_dialog.gd index 86a6a0f..ef31d35 100644 --- a/ui/test_board_dialog.gd +++ b/ui/test_board_dialog.gd @@ -76,7 +76,11 @@ func _build() -> void: var row := HBoxContainer.new() row.add_theme_constant_override("separation", 18) - row.add_child(field("Runs", segmented(RUN_CHOICES.map(func(n: int) -> String: return str(n)), 0, + # Start on the run count of the last report, so the selector matches it. + var last_runs := int(last.get("report", {}).get("runs_planned", RUN_CHOICES[0])) if last.get("report") is Dictionary else RUN_CHOICES[0] + var runs_index := maxi(0, RUN_CHOICES.find(last_runs)) + runs = RUN_CHOICES[runs_index] + row.add_child(field("Runs", segmented(RUN_CHOICES.map(func(n: int) -> String: return str(n)), runs_index, func(i: int) -> void: runs = RUN_CHOICES[i]))) row.add_child(field("Answers", segmented(["Random", "Prefer options matching…"], 0, func(i: int) -> void: use_prefer = i == 1