Router captions and hover summary, Test board run count, README branching

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 <noreply@anthropic.com>
This commit is contained in:
RobinFiredrake 2026-11-08 17:55:22 -06:00
parent 4bacb8100a
commit 51bfb93fd0
4 changed files with 15 additions and 1 deletions

View file

@ -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

View file

@ -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:

View file

@ -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)))]

View file

@ -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