diff --git a/README.md b/README.md index 9650a9c..e11827d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# TableTower +# Table Tarot Random roll tables for tabletop games, built as a board of table cards joined by pipes. Click the die on any table and the result flows down its pipes into the next table. diff --git a/assets/art/fortune_teller_logo.svg b/assets/art/fortune_teller_logo.svg new file mode 100644 index 0000000..29e05ab --- /dev/null +++ b/assets/art/fortune_teller_logo.svg @@ -0,0 +1,624 @@ + + + + + + + + diff --git a/assets/art/fortune_teller_logo.svg.import b/assets/art/fortune_teller_logo.svg.import new file mode 100644 index 0000000..880a4b8 --- /dev/null +++ b/assets/art/fortune_teller_logo.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://drx0r4ci8h5ts" +path="res://.godot/imported/fortune_teller_logo.svg-efad97bd871de6a5fbe287e31d86930a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/art/fortune_teller_logo.svg" +dest_files=["res://.godot/imported/fortune_teller_logo.svg-efad97bd871de6a5fbe287e31d86930a.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=0.25 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/core/board_tester.gd b/core/board_tester.gd index b91a9c9..98b76ac 100644 --- a/core/board_tester.gd +++ b/core/board_tester.gd @@ -278,7 +278,7 @@ static func static_checks(b: TowerBoard) -> Array[Dictionary]: add.call("range", t, "", rp) match t.kind: RollTable.KIND_LOOP: - expr.call("Loop rule", t.loop_expr) + expr.call("Repeat rule", t.loop_expr) RollTable.KIND_CHOICE: if t.choice == "pick" and t.entries.is_empty(): add.call("empty_choice", t, "", "Choice card has no options.") @@ -296,10 +296,10 @@ static func static_checks(b: TowerBoard) -> Array[Dictionary]: add.call("effect", t, e.id, "Change \"%s\": %s" % [p["src"], p["error"]]) for target in e.pipes: if b.get_table(target) == null: - add.call("missing_pipe", t, e.id, "Pipe to a table that doesn't exist (%s)." % target) + add.call("missing_pipe", t, e.id, "Thread to a table that doesn't exist (%s)." % target) var ce := e.count_expr(target) if ce != "": - expr.call("Pipe count", ce, e.id) + expr.call("Thread count", ce, e.id) for id in Roller.endless_cycles(b): var t := b.get_table(id) add.call("cycle", t, "", "Can never finish: every result leads back into an endless cycle.") diff --git a/core/describe.gd b/core/describe.gd index 0889dd1..114c75a 100644 --- a/core/describe.gd +++ b/core/describe.gd @@ -24,8 +24,8 @@ const _OPS := {"*": "×", "/": "÷", "-": MINUS, "==": "=", "!=": "≠", ">=": " ## What each kind of card is called in the UI (search, inspector, settings, previews). const KIND_LABELS := { - RollTable.KIND_ROLL: "Roll table", RollTable.KIND_CHOICE: "Choice", RollTable.KIND_LOOP: "Loop", - RollTable.KIND_ROUTER: "Router", RollTable.KIND_CHECK: "Check", RollTable.KIND_VARIABLE: "Variable", + RollTable.KIND_ROLL: "Roll table", RollTable.KIND_CHOICE: "Choice", RollTable.KIND_LOOP: "Repeat", + RollTable.KIND_ROUTER: "Branch", RollTable.KIND_CHECK: "Check", RollTable.KIND_VARIABLE: "Variable", RollTable.KIND_SHEET: "Sheet", } ## What each kind of choice is called (the + Card menu, settings, card, previews). @@ -516,7 +516,7 @@ static func why(fact: Dictionary, board: TowerBoard, plain: bool = true) -> Stri var val := Expr.format_value(fact.get("value")) var from_pipe := str(fact.get("from", "")) == "pipe" if plain: - s = "%s was %s (%s)" % [_label(nm, L), val, "from the pipe" if from_pipe else "default"] + s = "%s was %s (%s)" % [_label(nm, L), val, "from the thread" if from_pipe else "default"] else: s = "input %s = %s (%s)" % [nm, val, "with" if from_pipe else "default"] _: diff --git a/core/roll_lint.gd b/core/roll_lint.gd index a20de5b..df84d48 100644 --- a/core/roll_lint.gd +++ b/core/roll_lint.gd @@ -85,16 +85,16 @@ static func lint_pipes(board: TowerBoard) -> Array[Dictionary]: has_when = true if Expr.check(pw) != "": out.append({"table_id": t.id, "entry_id": e.id, - "message": "Pipe condition %s: %s" % [pw, Expr.check(pw)]}) + "message": "Thread condition %s: %s" % [pw, Expr.check(pw)]}) if first_other != "" and not warned: warned = true out.append({"table_id": t.id, "entry_id": e.id, - "message": "The otherwise pipe to %s comes before a conditional pipe; put it last so it reads in order" % _table_name(board, first_other)}) + "message": "The otherwise thread to %s comes before a conditional thread; put it last so it reads in order" % _table_name(board, first_other)}) elif e.is_otherwise(p) and first_other == "": first_other = p if first_other != "" and not has_when: out.append({"table_id": t.id, "entry_id": e.id, - "message": "The otherwise pipe to %s always runs: no pipe on this result has a condition" % _table_name(board, first_other)}) + "message": "The otherwise thread to %s always runs: no thread on this result has a condition" % _table_name(board, first_other)}) return out @@ -105,7 +105,7 @@ static func lint_router(t: RollTable) -> Array[Dictionary]: if t.kind != RollTable.KIND_ROUTER: return out if t.entries.is_empty(): - out.append({"table_id": t.id, "entry_id": "", "message": "This router has no cases"}) + out.append({"table_id": t.id, "entry_id": "", "message": "This branch has no cases"}) for i in t.entries.size(): var e := t.entries[i] var w := e.when.strip_edges() @@ -210,10 +210,10 @@ static func lint_inputs(board: TowerBoard, t: RollTable) -> Array[Dictionary]: var src := str(w[nm]) if Expr.check(src) != "": out.append({"table_id": t.id, "entry_id": e.id, "kind": "inputs", "level": "error", - "message": "Pipe input %s = %s: %s" % [nm, src, Expr.check(src)]}) + "message": "Thread input %s = %s: %s" % [nm, src, Expr.check(src)]}) if target != null and target.find_input(nm).is_empty(): out.append({"table_id": t.id, "entry_id": e.id, "kind": "inputs", "level": "hint", - "message": "The pipe to %s passes %s, but that card has no input called %s" % [_table_name(board, p), nm, nm]}) + "message": "The thread to %s passes %s, but that card has no input called %s" % [_table_name(board, p), nm, nm]}) return out diff --git a/core/roll_pipes.gd b/core/roll_pipes.gd index 6220510..7fea65f 100644 --- a/core/roll_pipes.gd +++ b/core/roll_pipes.gd @@ -29,7 +29,7 @@ static func pipe_plan(e: TableEntry, ctx: RollContext, log: Array = [], why: Arr var r := Expr.evaluate(w, ctx) var fact := {"type": "when", "to": p, "expr": w, "values": Expr.values_read(w, ctx), "result": false} if r["error"] != "": - log.append({"text": "Pipe condition %s: %s" % [w, r["error"]], "error": true}) + log.append({"text": "Thread condition %s: %s" % [w, r["error"]], "error": true}) run = false fact["error"] = str(r["error"]) else: @@ -62,7 +62,7 @@ static func with_values(e: TableEntry, target: String, ctx: RollContext, log: Ar var src := str(w[nm]) var r := Expr.evaluate(src, ctx) if r["error"] != "": - log.append({"text": "Pipe input %s = %s: %s" % [nm, src, r["error"]], "error": true}) + log.append({"text": "Thread input %s = %s: %s" % [nm, src, r["error"]], "error": true}) else: out[nm] = Expr.normalize(r["value"]) return out diff --git a/core/table_entry.gd b/core/table_entry.gd index d660fb0..4c42bc2 100644 --- a/core/table_entry.gd +++ b/core/table_entry.gd @@ -87,7 +87,7 @@ func count_value(target: String, ctx: RollContext, log: Array = []) -> int: return count_for(target) var r := Expr.evaluate(e, ctx) if r["error"] != "": - log.append({"text": "Pipe count %s: %s" % [e, r["error"]], "error": true}) + log.append({"text": "Thread count %s: %s" % [e, r["error"]], "error": true}) return 0 return clampi(Expr.as_int(r, 0), 0, MAX_EXPR_COUNT) diff --git a/core/tower_board.gd b/core/tower_board.gd index 933b2c6..e52c5f2 100644 --- a/core/tower_board.gd +++ b/core/tower_board.gd @@ -256,7 +256,7 @@ static func write_text_atomic(path: String, text: String) -> Error: func save(path: String = SAVE_PATH) -> bool: var err := write_text_atomic(path, to_json()) if err != OK: - push_warning("Couldn't save the board to %s: %s" % [path, error_string(err)]) + push_warning("Couldn't save the spread to %s: %s" % [path, error_string(err)]) return false return true diff --git a/help/topics.txt b/help/topics.txt index f12e28f..0f4e87a 100644 --- a/help/topics.txt +++ b/help/topics.txt @@ -1,21 +1,21 @@ # Getting started -TableTower holds [b]random tables[/b] for tabletop games. Each table is a card on the felt. Cards are joined by copper [b]pipes[/b], so one roll can lead on to the next: a travel roll finds a stranger, and the stranger gets a name. +Table Tarot holds [b]random tables[/b] for tabletop games. Each table is a card on the felt. Cards are joined by copper [b]threads[/b], so one roll can lead on to the next: a travel roll finds a stranger, and the stranger gets a name. ## Two modes - [b]Play[/b] is for the game table. Click a die to roll, and read the result in the tray at the bottom. -- [b]Build[/b] is for making and changing tables. Click a card, a result or a pipe to edit it in the inspector on the right. +- [b]Build[/b] is for making and changing tables. Click a card, a result or a thread to edit it in the inspector on the right. Switch between them with [b]Play | Build[/b] at the top left. Everything you build is saved as you go. ## Try the sample -The Fantasy Loot collection shows most features: -- [b]Wilderness Travel[/b] is a d100 table whose results pipe into other tables. -- [b]Party Roles[/b] deals each role once until the deck is reshuffled ([topic]Card mode[/topic]). +The Fantasy Loot spread shows most features: +- [b]Wilderness Travel[/b] is a d100 table whose results thread into other tables. +- [b]Party Roles[/b] deals each role once until the deck is reshuffled ([topic]Deck mode[/topic]). - [b]Make Camp[/b] asks you to pick what the party does ([topic]Choice cards[/topic]). - [b]Search the Ruins[/b] adds your [b]Luck[/b] to the roll, and two of its results can only be reached with good or bad luck ([topic]Roll modifiers[/topic]). # Rolling -Click the die button on a card to roll it. The results flicker, one lands and lights up in brass, and the roll follows any pipes from that result to other cards. +Click the die button on a card to roll it. The results flicker, one lands and lights up in brass, and the roll follows any threads from that result to other cards. - [b]Shift-click[/b] the die to skip the animation. - Hover a result to read its details. A small ⓘ after a card's name means the card has details too. - On a ranged card, the percentage beside each result is its chance right now. @@ -27,7 +27,7 @@ The tray at the bottom of the window shows the last roll as a row of steps, one - [b]Why this?[/b] on a step explains it in plain words: what was rolled, any modifier, and why the roll went where it did. - [b]Roll again[/b] repeats the last roll. - [b]Copy ▾[/b] copies the result as plain text, as BBCode for forums, or with the details of each step. -- [b]Earlier[/b] lists your recent rolls. [b]Variables[/b] lists the values the board remembers between rolls, such as Luck. +- [b]Earlier[/b] lists your recent rolls. [b]Variables[/b] lists the values the spread remembers between rolls, such as Luck. Drag the tray's top edge to make it taller or shorter. Double-click the edge to reset it. @@ -38,12 +38,12 @@ Switch to [b]Build[/b] to edit. - The [b]×1[/b] beside a result is its weight. A weight of 3 makes that result three times as likely as a weight of 1. - Hover a row to show its [b]×[/b] delete button. - The card's [b]⋯[/b] menu has Table settings, Save as template, Collapse and Delete table. -- Click a card's title, a result's text or a pipe to edit it in the [b]inspector[/b] on the right. Drag the inspector's left edge to resize it. +- Click a card's title, a result's text or a thread to edit it in the [b]inspector[/b] on the right. Drag the inspector's left edge to resize it. Every edit can be undone with [b]Ctrl+Z[/b] or the ↶ button, and redone with [b]Ctrl+Shift+Z[/b], [b]Ctrl+Y[/b] or ↷. ## Table settings -[b]Table settings…[/b] in the ⋯ menu sets the card's type, dice, details and tags, and turns on [topic]Card mode[/topic]. +[b]Table settings…[/b] in the ⋯ menu sets the card's type, dice, details and tags, and turns on [topic]Deck mode[/topic]. # Ranged tables and dice A [b]ranged table[/b] gives each result a range of numbers instead of a weight, the way printed tables do: 01–30 Travelers on the road, 31–50 Beasts on the hunt, and so on. @@ -53,17 +53,17 @@ A [b]ranged table[/b] gives each result a range of numbers instead of a weight, Dice can be written `2d6`, `d20`, `3D` or `D3`. A missing count means 1 and missing sides mean 6, so `2D` is 2d6. To add a value to the dice, use a [topic]Roll modifiers[/topic] modifier. -# Pipes -A pipe carries the roll from a result to another card. -- In Build mode, drag from the ● at the right of a result onto another card to lay a pipe. -- When that result is rolled, the card at the other end is rolled too. The pipes of a roll light up in brass. -- Click a pipe on the felt to edit it in the inspector. +# Threads +A thread carries the roll from a result to another card. +- In Build mode, drag from the ● at the right of a result onto another card to lay a thread. +- When that result is rolled, the card at the other end is rolled too. The threads of a roll light up in brass. +- Click a thread on the felt to edit it in the inspector. -## Pipe options +## Thread options - [b]Count[/b] rolls the next card more than once. It can be a number or an expression such as `1d3`. - [b]Save as[/b] keeps the next card's result under a name, so later text can show it as `{name}`. -- [b]Only if[/b] runs the pipe only when a condition is true, such as `@gold >= 10`. -- [b]Otherwise[/b] runs the pipe only when none of the result's Only if pipes ran. +- [b]Only if[/b] runs the thread only when a condition is true, such as `@gold >= 10`. +- [b]Otherwise[/b] runs the thread only when none of the result's Only if threads ran. - [b]Inputs[/b] pass values to a card that declares them. # Roll modifiers @@ -76,11 +76,11 @@ A ranged table can add a [b]modifier[/b] to its dice, for rules like "roll 1d20 ## In the sample [b]Search the Ruins[/b] rolls 1d6 + Luck. With no Luck you can't reach "A tunnel caves in" or "A hidden vault". Pray at the shrine in [b]Make Camp[/b] to raise your Luck, gamble with the guards to lower it, then search again and watch the chances move. Why this? on the step names the modifier: "+1 for Luck". -Card mode decks ignore the modifier. +Deck mode decks ignore the modifier. -# Card mode -[b]Card mode[/b] turns a table into a deck of cards. Each result is dealt once, with no repeats, until the deck runs out. -- Turn it on in [b]Table settings… → Card mode[/b]. +# Deck mode +[b]Deck mode[/b] turns a table into a deck of cards. Each result is dealt once, with no repeats, until the deck runs out. +- Turn it on in [b]Table settings… → Deck mode[/b]. - The card shows how many are left, for example [b]4 / 6 left[/b]. - [b]↻ Reshuffle[/b] under the card's name puts every card back. - [b]When the deck runs out[/b] can reshuffle by itself or stop until you reshuffle. @@ -89,11 +89,11 @@ Card mode decks ignore the modifier. # Choice cards A choice card stops the roll and asks the player. Add one from [b]+ Card ▾[/b]. -- [b]Which option[/b] lists the card's options to pick from. [b]Random[/b] is always offered too. The picked option runs exactly as if it had been rolled: its changes happen and its pipes follow. +- [b]Which option[/b] lists the card's options to pick from. [b]Random[/b] is always offered too. The picked option runs exactly as if it had been rolled: its changes happen and its threads follow. - [b]How many[/b] asks for a number between a lowest and highest value. - [b]Open ended[/b] asks for any text. -The question can show values, such as "Your Luck is {@luck}. What now?". Answers can be saved under a name for later. [b]Cancel[/b] in the pop-up stops the whole roll, and the pop-up can be minimized to look at the board first. +The question can show values, such as "Your Luck is {@luck}. What now?". Answers can be saved under a name for later. [b]Cancel[/b] in the pop-up stops the whole roll, and the pop-up can be minimized to look at the spread first. ## Options that come and go An option can have [b]Show only if[/b], so it's offered only when a condition is true, such as `@gold >= 10`. A Which option card can also build its options from a collection of values, such as every skill the character has. @@ -101,7 +101,7 @@ An option can have [b]Show only if[/b], so it's offered only when a condition is [b]Make Camp[/b] in the sample is a Which option card. # Values and changes -A board can remember [b]values[/b] between rolls, such as Luck, Gold or the current town. In rules a value is written with @: `@luck`. +A spread can remember [b]values[/b] between rolls, such as Luck, Gold or the current town. In rules a value is written with @: `@luck`. - Any result can have [b]changes[/b] that happen when it comes up: [b]Add 1 to Luck[/b], [b]Subtract 3 from Gold[/b], [b]Set Town to …[/b]. Edit them in the inspector as rows, or with Edit as text. - A [b]Variable[/b] card gives a value a name, a type and a starting value, and shows what it is now. The sample's [b]Luck[/b] card starts at 0. - A [b]Collection[/b] card groups related values, such as Skills, so they can be listed and picked from together. @@ -113,17 +113,17 @@ A board can remember [b]values[/b] between rolls, such as Luck, Gold or the curr - Text values work as lists: `@traits += "Brave"` adds an item. ## Conditions -Conditions are used by Only if pipes, routers, loops and Show only if. In plain words they read "Luck is at least 2". As text: `@luck >= 2`, `@town = "Saltmere"`, `@gold > 0 and @luck < 3`. +Conditions are used by Only if threads, branches, repeats and Show only if. In plain words they read "Luck is at least 2". As text: `@luck >= 2`, `@town = "Saltmere"`, `@gold > 0 and @luck < 3`. # Logic cards Besides roll tables and choices, [b]+ Card ▾[/b] adds: - [b]Check card[/b]: rolls dice plus a modifier against a target, such as 2d6 + Skill against 8, and follows its Success or Failure result. -- [b]Loop[/b]: repeats its Each time result a number of times, or while or until a condition holds, then runs Afterwards once. -- [b]Router[/b]: checks its cases from top to bottom (if, else if, otherwise) and follows the first one that's true. +- [b]Repeat[/b]: repeats its Each time result a number of times, or while or until a condition holds, then runs Afterwards once. +- [b]Branch[/b]: checks its cases from top to bottom (if, else if, otherwise) and follows the first one that's true. - [b]Sheet[/b]: a page of text, such as a character sheet, that always shows the current values. A roll that reaches it prints it in the tray. - [b]Variable[/b] and [b]Collection[/b]: see [topic]Values and changes[/topic]. -Use [b]Test board[/b] to check that a board of logic cards works. See [topic]Testing a board[/topic]. +Use [b]Test spread[/b] to check that a spread of logic cards works. See [topic]Testing a spread[/topic]. # Text in results Result text can do more than plain words: @@ -140,7 +140,7 @@ Result text can do more than plain words: - Ctrl-click or Shift-click cards to select several, or Ctrl-drag a box around them. - Press [b]Ctrl+G[/b] to put them in a group: a frame that moves and collapses as one. - Drag cards into or out of a group. The group's ⋯ menu renames, saves as a template, ungroups or deletes it. -- [b]Board ▾ → Pack collapsed groups[/b] moves collapsed groups together to close the gaps. +- [b]Spread ▾ → Pack collapsed groups[/b] moves collapsed groups together to close the gaps. ## Templates A template is a saved card, group or selection that you can insert again, with blanks to fill in. @@ -148,29 +148,29 @@ A template is a saved card, group or selection that you can insert again, with b - Insert one from [b]+ Card ▾ → From template…[/b]. - Built-in templates include a skill check, ask-and-repeat, a pick menu, a counter and a simple sheet. -# Collections, import and export -A [b]collection[/b] is one board of tables. Use the switcher beside Play | Build (it shows the collection's name) to switch, or to make a new collection, rename, duplicate or delete one. +# Spreads, import and export +A [b]spread[/b] is one layout of cards, saved under its own name. Use the switcher beside Play | Build (it shows the spread's name) to switch, or to make a new spread, rename, duplicate or delete one. -In Build mode, [b]Board ▾[/b] has: -- [b]Import as new collection…[/b] for TableTower JSON, JSON Canvas and GraphML files. -- [b]Export as…[/b] TableTower JSON, JSON Canvas, GraphML, a Mermaid diagram or Graphviz DOT. +In Build mode, [b]Spread ▾[/b] has: +- [b]Import as new spread…[/b] for Table Tarot JSON, JSON Canvas and GraphML files. +- [b]Export as…[/b] Table Tarot JSON, JSON Canvas, GraphML, a Mermaid diagram or Graphviz DOT. Exports hold the tables only. Your roll history, decks and remembered values stay on this computer. -# Testing a board -[b]Board ▾ → Test board…[/b] rolls a card hundreds of times, answering every question at random, and reports: +# Testing a spread +[b]Spread ▾ → Test spread…[/b] rolls a card hundreds of times, answering every question at random, and reports: - errors, such as a rule that can't be worked out - dead ends, where a roll stops unexpectedly - cards and results that never came up - tips, such as an option that can never be offered -Click any item in the report to jump to that card. A board that can loop forever shows a warning in the top bar while you build. +Click any item in the report to jump to that card. A spread that can loop forever shows a warning in the top bar while you build. # Finding your way - [b]Search[/b] (the magnifier, or [b]Ctrl+F[/b]) finds cards by name, result, question, value or group, opens closed groups and flashes the card. - Drag the felt to move around. The mouse wheel scrolls up and down, [b]Shift+wheel[/b] scrolls sideways and [b]Ctrl+wheel[/b] zooms. -- The zoom control at the top right shows the zoom. − and + step it, and the percentage opens [b]Fit board[/b], [b]Zoom to 100%[/b] and the minimap. -- The [b]minimap[/b] (press [b]M[/b]) shows the whole board in the corner. Click or drag on it to move there. +- The zoom control at the top right shows the zoom. − and + step it, and the percentage opens [b]Fit spread[/b], [b]Zoom to 100%[/b] and the minimap. +- The [b]minimap[/b] (press [b]M[/b]) shows the whole spread in the corner. Click or drag on it to move there. ## The View menu - [b]Rules[/b]: show rules in [b]Plain words[/b] ("Subtract 1 from Luck") or as [b]Rule text[/b] (`@luck -= 1`). diff --git a/io/canvas_io.gd b/io/canvas_io.gd index e096155..ecfc92b 100644 --- a/io/canvas_io.gd +++ b/io/canvas_io.gd @@ -250,7 +250,7 @@ static func import_canvas(text: String, sanitize: Callable = Callable()) -> Dict for e in t4["entries"]: e.erase("_has_pipes") if edge_pipes > 0: - guesses.append("Built %d pipe(s) from edges and their labels." % edge_pipes) + guesses.append("Built %d thread(s) from edges and their labels." % edge_pipes) var raw := { "format_version": JsonIO.FORMAT_VERSION, @@ -259,7 +259,7 @@ static func import_canvas(text: String, sanitize: Callable = Callable()) -> Dict "tables": tables, } if doc_extra.is_empty(): - guesses.append("No collection name in the canvas; using a default.") + guesses.append("No spread name in the canvas; using a default.") return JsonIO.finish_import(raw, sanitize, result) diff --git a/io/graphml_io.gd b/io/graphml_io.gd index ea4962c..7f5a755 100644 --- a/io/graphml_io.gd +++ b/io/graphml_io.gd @@ -215,7 +215,7 @@ static func import_graphml(text: String, sanitize: Callable = Callable()) -> Dic tables.append(t2) if not rich: - guesses.append("No TableTower data in this file; each node became a table and each edge an entry with a pipe.") + guesses.append("No Table Tarot data in this file; each node became a table and each edge an entry with a thread.") var by_table := {} for t3 in tables: by_table[t3["id"]] = t3 diff --git a/io/json_io.gd b/io/json_io.gd index 20d3ecd..a25d915 100644 --- a/io/json_io.gd +++ b/io/json_io.gd @@ -49,7 +49,7 @@ static func import_json(text: String, sanitize: Callable = Callable()) -> Dictio errors.append("Not valid JSON (line %d): %s" % [json.get_error_line(), json.get_error_message()]) return {"ok": false, "collection": {}, "errors": errors, "warnings": warnings} if not (json.data is Dictionary): - errors.append("The file is not a collection (expected a JSON object).") + errors.append("The file is not a spread (expected a JSON object).") return {"ok": false, "collection": {}, "errors": errors, "warnings": warnings} return import_dict(json.data, sanitize) @@ -66,7 +66,7 @@ static func import_dict(data: Dictionary, sanitize: Callable = Callable()) -> Di if (fv is int or fv is float) and fv > FORMAT_VERSION: errors.append("format_version %s is newer than this version supports (%d)." % [str(fv), FORMAT_VERSION]) if not (data.get("tables") is Array): - errors.append("The collection has no \"tables\" list.") + errors.append("The spread has no \"tables\" list.") return result var raw_tables: Array = data["tables"] for ti in raw_tables.size(): @@ -93,8 +93,8 @@ static func import_dict(data: Dictionary, sanitize: Callable = Callable()) -> Di c["name"] = clean.call(str(c["name"])) if str(c["name"]) == "": - c["name"] = "Untitled collection" - warnings.append("The collection had no name; called it \"Untitled collection\".") + c["name"] = "Untitled spread" + warnings.append("The spread had no name; called it \"Untitled spread\".") if str(c["id"]) == "": c["id"] = slug(str(c["name"]), "collection") @@ -184,7 +184,7 @@ static func import_dict(data: Dictionary, sanitize: Callable = Callable()) -> Di elif by_name.has(target.to_lower()): target = by_name[target.to_lower()] else: - warnings.append("\"%s\" pipes to unknown table \"%s\"." % [str(ed["text"]), target]) + warnings.append("\"%s\" threads to unknown table \"%s\"." % [str(ed["text"]), target]) if p is Dictionary: var np: Dictionary = (p as Dictionary).duplicate() np["table"] = target diff --git a/project.godot b/project.godot index 0b97927..f4a71f3 100644 --- a/project.godot +++ b/project.godot @@ -14,7 +14,7 @@ config/name="TableTower" run/main_scene="res://ui/main.tscn" config/features=PackedStringArray("4.7", "Forward Plus") boot_splash/bg_color=Color(0.0706, 0.1882, 0.1216, 1) -config/icon="res://icon.svg" +config/icon="res://assets/art/fortune_teller.svg" [display] diff --git a/tests/test_board_tester.gd b/tests/test_board_tester.gd index c47b699..c8a737f 100644 --- a/tests/test_board_tester.gd +++ b/tests/test_board_tester.gd @@ -25,10 +25,10 @@ func _init() -> void: _check(_has(probs, "effect", "start", "e1"), "a bad effect is found with its table and entry: %s" % str(probs)) _check(_has(probs, "expression", "badexpr", ""), "a bad dice expression is found") _check(_has(probs, "expression", "pick", "") and _text_has(probs, "Prompt"), "a bad {= } in a prompt is found") - _check(_has(probs, "expression", "loop", "") and _text_has(probs, "Loop rule"), "a bad loop rule is found") - _check(_has(probs, "expression", "start", "e1") and _text_has(probs, "Pipe count"), "a bad pipe count is found") + _check(_has(probs, "expression", "loop", "") and _text_has(probs, "Repeat rule"), "a bad loop rule is found") + _check(_has(probs, "expression", "start", "e1") and _text_has(probs, "Thread count"), "a bad thread count is found") _check(_has(probs, "range", "gap", "") and _text_has(probs, "No result for 3"), "a range gap is found") - _check(_has(probs, "missing_pipe", "start", "e1"), "a pipe to a missing table is found") + _check(_has(probs, "missing_pipe", "start", "e1"), "a thread to a missing table is found") _check(_has(probs, "empty_choice", "empty", ""), "a choice card with no options is found") _check(_has(probs, "cycle", "ping", ""), "an endless cycle is found") _check(not _has(probs, "range", "okrange", "") and not _has(probs, "effect", "mine", ""), "good cards give no problems") @@ -163,7 +163,7 @@ func _board() -> TowerBoard: be.range_lo = 2 be.range_hi = 12 bad.entries.append(be) - var loop := RollTable.create(RollTable.KIND_LOOP, "loop", "Loop", "times") + var loop := RollTable.create(RollTable.KIND_LOOP, "loop", "Repeat", "times") loop.loop_expr = "3 *" var empty := RollTable.create(RollTable.KIND_CHOICE, "empty", "Empty", "pick") empty.entries.clear() diff --git a/tests/test_builder.gd b/tests/test_builder.gd index 08f204e..cf6631a 100644 --- a/tests/test_builder.gd +++ b/tests/test_builder.gd @@ -195,18 +195,18 @@ func _test_known_values() -> void: order.append(v["name"]) for k in ["name", "label", "kind", "source"]: _check(v.has(k), "%s has %s" % [v.get("name"), k]) - _eq(order.slice(0, 3), ["@luck", "@town", "@skill_*"], "variable cards first, then collections") + _eq(order.slice(0, 3), ["@luck", "@town", "@skill_*"], "variable cards first, then spreads") _eq(by["@luck"], {"name": "@luck", "label": "Luck", "kind": "number", "source": "variable", "table_id": "v_luck"}, "a variable card") _eq(by["@town"]["kind"], "text", "text variable") _eq(by["@town"]["label"], "Home Town", "label from the card") - _eq(by["@skill_*"]["kind"], "collection", "collection kind") - _eq(by["@skill_*"]["label"], "Skills", "collection label") + _eq(by["@skill_*"]["kind"], "collection", "spread kind") + _eq(by["@skill_*"]["label"], "Skills", "spread label") _eq(by["@skill_pilot"]["label"], "Pilot", "member label") - _eq(by["@skill_pilot"]["collection"], "@skill_*", "member knows its collection") + _eq(by["@skill_pilot"]["collection"], "@skill_*", "member knows its spread") _eq(by["@skill_pilot"]["source"], "effect", "effect target") _eq(by["@traits"]["kind"], "list", "append makes a list") _eq(by["@credits"]["kind"], "number", "number effect") - _eq(by["@weapon"]["source"], "save_as", "pipe save_as") + _eq(by["@weapon"]["source"], "save_as", "thread save_as") _eq(by["hero"]["source"], "save_as", "[[ -> hero]] save") _eq(by["@terms"]["kind"], "number", "number choice save_as") _eq(by["tier"]["source"], "input", "card input") @@ -217,4 +217,4 @@ func _test_known_values() -> void: _check(by.has("nat") and by.has("total") and by.has("effect"), "check chain names") _check(not by.has("i") and not by.has("option"), "no loop, no dynamic pick") _check(not by.has("@[option]") and not by.has("@x_*"), "no indirect or prefix targets") - _eq(Builder.known_values(null), [] as Array[Dictionary], "null board") + _eq(Builder.known_values(null), [] as Array[Dictionary], "null spread") diff --git a/tests/test_check_inputs.gd b/tests/test_check_inputs.gd index 2c226c3..797d3b4 100644 --- a/tests/test_check_inputs.gd +++ b/tests/test_check_inputs.gd @@ -168,7 +168,7 @@ func _test_check_le_and_dice() -> void: chk.entries[0].add_pipe("win") chk.entries[1].add_pipe("lose") b = _board([chk, _one("win", "Won with {total}"), _one("lose", "Lost")]) - _eq(_texts(_roll(b, "chk")[0]), ["Success", "Won with 10"], "success pipes, total in text") + _eq(_texts(_roll(b, "chk")[0]), ["Success", "Won with 10"], "success threads, total in text") func _test_check_errors() -> void: @@ -215,11 +215,11 @@ func _test_inputs_two_pipes() -> void: bb.entries[0].set_pipe_with("show", {"tier": "3"}) var b := _board([start, a, bb, _show()]) var r := _roll(b, "start") - _eq(_texts(r[0]), ["go", "A", "Tier 2", "B", "Tier 3"], "two pipes pass different values") + _eq(_texts(r[0]), ["go", "A", "Tier 2", "B", "Tier 3"], "two threads pass different values") var steps := Roller.flatten(r[0]) _eq(steps[2]["inputs"], {"tier": 2}, "step inputs") _eq(steps[2]["why"][0], {"type": "input", "name": "tier", "value": 2, "from": "pipe"}, "input fact") - _eq(Describe.why(steps[2]["why"][0], b), "Tier was 2 (from the pipe)", "input sentence") + _eq(Describe.why(steps[2]["why"][0], b), "Tier was 2 (from the thread)", "input sentence") _check(not (r[1] as RollContext).chain_vars.has("tier"), "tier is gone after the roll") @@ -334,7 +334,7 @@ func _test_inputs_snapshot() -> void: func _test_inputs_loops_routers_choices_inline() -> void: # Loop: each pass passes i. - var loop := RollTable.create(RollTable.KIND_LOOP, "loop", "Loop") + var loop := RollTable.create(RollTable.KIND_LOOP, "loop", "Repeat") loop.loop_expr = "3" loop.entries[0].add_pipe("show") loop.entries[0].set_pipe_with("show", {"tier": "i * 10"}) @@ -363,15 +363,15 @@ func _test_inputs_loops_routers_choices_inline() -> void: start.entries.append(e) b = _board([start, router, _show()]) r = _roll(b, "start") - _eq(_texts(r[0]), ["go", "high", "Tier 200"], "router with inputs") + _eq(_texts(r[0]), ["go", "high", "Tier 200"], "branch with inputs") var rstep: Dictionary = Roller.flatten(r[0])[1] var types: Array = [] for f: Dictionary in rstep["why"]: types.append(f["type"]) - _eq(types, ["input", "case"], "router facts: input then case") + _eq(types, ["input", "case"], "branch facts: input then case") _eq(Describe.why(rstep["why"][1], b), "Case 1 matched because Tier was 2 (needs 2 or more)", "case sentence with input") e.set_pipe_with("route", {"tier": "1"}) - _eq(_texts(_roll(b, "start")[0]), ["go", "low"], "router otherwise") + _eq(_texts(_roll(b, "start")[0]), ["go", "low"], "branch otherwise") # Number choice: the Answer's pipe passes answer. var ask := RollTable.create(RollTable.KIND_CHOICE, "ask", "Ask", "number") ask.min_expr = "4" @@ -438,7 +438,7 @@ func _test_inputs_errors() -> void: var r := _roll(b, "start") _eq(_texts(r[0]), ["go", "Tier 1 extra 7"], "bad value uses the default; undeclared names still pass") _eq(_errors(r[0]).size(), 1, "one error line") - _check(str(_errors(r[0])[0]).begins_with("Pipe input tier = 2 +"), "error names the input") + _check(str(_errors(r[0])[0]).begins_with("Thread input tier = 2 +"), "error names the input") show.inputs = [{"name": "tier", "label": "", "default": "1 +"}] e.set_pipe_with("show", {}) r = _roll(b, "start") @@ -450,7 +450,7 @@ func _test_inputs_errors() -> void: func _test_collections() -> void: var c := RollTable.create(RollTable.KIND_VARIABLE, "skills", "Skills", "collection") - _eq(c.var_type, "collection", "collection type") + _eq(c.var_type, "collection", "spread type") _eq(c.var_name, "skill", "stem from the name") _eq(c.initial, "", "no starting value") _check(c.is_collection(), "is_collection") @@ -467,7 +467,7 @@ func _test_collections() -> void: var r := _roll(b, "start", vars) _eq(Describe.options(raise, b), "your Skills, level 1 or more", "options description") var shown := Roller.variable_display(b, vars, c) - _check(shown["set"], "collection display is set") + _check(shown["set"], "spread display is set") _check(str(shown["text"]).contains("Pilot") and str(shown["text"]).contains("Gun Combat"), "members listed: %s" % shown["text"]) var raised := int(_var(vars, "skill_pilot")) + int(_var(vars, "skill_gun_combat")) _eq(raised, 4, "one member raised") @@ -478,7 +478,7 @@ func _test_collections() -> void: fx.append(f) _eq(fx.size(), 1, "options_where fact") _eq(Describe.why(fx[0], b), "Offered 2 of 3 Skills (level 1 or more)", "options_where sentence") - _eq(Roller.variable_display(b, {}, c), {"text": "", "set": false, "error": ""}, "empty collection") + _eq(Roller.variable_display(b, {}, c), {"text": "", "set": false, "error": ""}, "empty spread") # reset @skill_* still clears every member; a collection isn't declared. var clear := _one("clear", "clear", "reset @skill_*") b.tables.append(clear) @@ -491,7 +491,7 @@ func _test_collections() -> void: _eq(_texts(_roll(b, "probe", v2)[0]), ["Pilot 1 / 1"], "list text and count") # JSON. var back := RollTable.from_dict(JSON.parse_string(JSON.stringify(c.to_dict()))) - _eq(back.var_type, "collection", "collection survives JSON") + _eq(back.var_type, "collection", "spread survives JSON") _eq(back.var_name, "skill", "stem survives JSON") @@ -572,7 +572,7 @@ func _test_json() -> void: _eq(d["kind"], "check", "kind written") _eq([d["check_dice"], d["check_mod"], d["check_cmp"], d["check_target"]], ["3d6", "dm(@str)", "le", "@skill"], "check keys") _eq(d["inputs"], [{"name": "tier", "label": "Tier", "default": "1"}, {"name": "bonus"}], "inputs written without empty keys") - _eq(d["entries"][0]["pipes"], [{"table": "next", "with": {"level": "tier + 1"}}], "pipe with written") + _eq(d["entries"][0]["pipes"], [{"table": "next", "with": {"level": "tier + 1"}}], "thread with written") var pd := plain.to_dict() for k in ["check_dice", "check_mod", "check_cmp", "check_target", "inputs"]: _check(not pd.has(k), "default %s left out" % k) @@ -639,9 +639,9 @@ func _test_lint() -> void: _check(not target.is_empty() and target["level"] == "error" and target["kind"] == "check", "bad check target") _check(not find.call("Check modifier dm(@str").is_empty(), "bad check modifier") _check(not find.call("A check needs a Success").is_empty(), "missing Failure entry") - var bad_with: Dictionary = find.call("Pipe input tier = 2 +") + var bad_with: Dictionary = find.call("Thread input tier = 2 +") _check(not bad_with.is_empty() and bad_with["level"] == "error" and bad_with["entry_id"] == "e1", "bad with expression is an error") - var hint: Dictionary = find.call("The pipe to Show passes extra") + var hint: Dictionary = find.call("The thread to Show passes extra") _check(not hint.is_empty() and hint["level"] == "hint" and hint["kind"] == "inputs", "undeclared input is a hint") _check(not find.call("Input \"Bad Name\" isn't a name").is_empty(), "bad input name") _check(not find.call("Input Bad Name default").is_empty(), "bad input default") @@ -654,7 +654,7 @@ func _test_lint() -> void: var hint_level := false for p: Dictionary in probs: kinds[p["kind"]] = true - if str(p["text"]).begins_with("The pipe to Show passes extra"): + if str(p["text"]).begins_with("The thread to Show passes extra"): hint_level = p.get("level", "") == "hint" _check(kinds.has("check") and kinds.has("inputs"), "static checks have check and inputs kinds: %s" % [kinds.keys()]) _check(hint_level, "static check keeps the hint level") @@ -662,4 +662,4 @@ func _test_lint() -> void: var good := _board([RollTable.create(RollTable.KIND_CHECK, "c", "C"), _show()]) good.get_table("c").entries[0].add_pipe("show") good.get_table("c").entries[0].set_pipe_with("show", {"tier": "total"}) - _eq(BoardTester.static_checks(good), [] as Array[Dictionary], "clean board") + _eq(BoardTester.static_checks(good), [] as Array[Dictionary], "clean spread") diff --git a/tests/test_choice_dialog.gd b/tests/test_choice_dialog.gd index 8b3768d..ad43c5c 100644 --- a/tests/test_choice_dialog.gd +++ b/tests/test_choice_dialog.gd @@ -131,7 +131,7 @@ func _test_preview_content() -> void: _check(d != null and d.kind == "pick", "the pick question opens") if d == null: return - _check(d.board == main.data, "the dialog finds the board") + _check(d.board == main.data, "the dialog finds the spread") # Plain words (the default): effects and counts read as phrases. _check(d.plain, "previews read in plain words by default") var pp := d.preview_for_option(0) @@ -144,11 +144,11 @@ func _test_preview_content() -> void: d.plain = false # Option 1 pipes to a ranged table, twice. var p := d.preview_for_option(0) - _check(p != null, "an option that pipes on has a preview") + _check(p != null, "an option that threads on has a preview") _check(_has(p, "A **busy** place") or _has(p, "busy"), "the preview shows the option's details") _check(_has(p, "@gold -= 5"), "the preview lists the option's effects") _check(_has(p, "Loot") and _has(p, "d6"), "the piped table's name and dice show") - _check(_has(p, "×2"), "the pipe count shows") + _check(_has(p, "×2"), "the thread count shows") _check(_has(p, "What the stalls sell"), "the piped table's details show") _check(_has(p, "1–2") and _has(p, "3–5") and _has(p, "33%"), "ranged entries show their range and chance") _check(_has(p, TablePreview.NEXT_HINT), "an entry that leads further gets a next-table hint") @@ -159,7 +159,7 @@ func _test_preview_content() -> void: var q := d.preview_for_option(1) _check(_has(q, "Which way?") and _has(q, "Choice card"), "a choice target shows its kind") _check(_has(q, "Asks: Left or right?"), "a choice target shows its question") - _check(_has(q, "×@terms"), "an expression pipe count shows") + _check(_has(q, "×@terms"), "an expression thread count shows") q.free() _check(d.preview_for_option(2) == null, "an option with nothing to show has no preview") main.rolling.cancel_choice() @@ -197,7 +197,7 @@ func _test_minimize() -> void: d._input(_key(KEY_M)) _check(d.minimized and not d.card.is_visible_in_tree(), "M hides the dialog") _check(d.pill.visible and _has(d.pill, "Question waiting: Where to?"), "the pill names the question") - _check(d.mouse_filter == Control.MOUSE_FILTER_IGNORE, "the board gets the mouse while minimized") + _check(d.mouse_filter == Control.MOUSE_FILTER_IGNORE, "the spread gets the mouse while minimized") _check(not d._dim.visible, "the dim goes away") _check(not d.preview_panel.visible, "the preview hides") _check(not d.reply.finished and main.rolling.pending_choice() == d, "the question is still waiting") diff --git a/tests/test_describe.gd b/tests/test_describe.gd index 5ae43ed..3647c37 100644 --- a/tests/test_describe.gd +++ b/tests/test_describe.gd @@ -74,25 +74,25 @@ func _board() -> TowerBoard: func _test_labels() -> void: var b := _board() - _eq(b.get_table("v_skills").var_name, "skill", "a collection's stem drops the final s") + _eq(b.get_table("v_skills").var_name, "skill", "a spread's stem drops the final s") _eq(Describe.label("@str", b), "Strength", "variable card label") _eq(Describe.label("@STR", b), "Strength", "labels ignore case") - _eq(Describe.label("@skill_gun_combat", b), "Gun Combat", "collection member label") - _eq(Describe.label("@skill_*", b), "Skills", "collection label") - _eq(Describe.label("@contact_*", b), "Contact values", "a prefix without a collection") - _eq(Describe.label("@soc_x", b), "Soc X", "no collection: pretty name") + _eq(Describe.label("@skill_gun_combat", b), "Gun Combat", "spread member label") + _eq(Describe.label("@skill_*", b), "Skills", "spread label") + _eq(Describe.label("@contact_*", b), "Contact values", "a prefix without a spread") + _eq(Describe.label("@soc_x", b), "Soc X", "no spread: pretty name") _eq(Describe.label("@dex", b), "Dex", "unlabelled value") _eq(Describe.label("tier", b), "Tier", "input label") _eq(Describe.label("answer", b), "Answer", "chain label") _eq(Describe.label("nat", b), "Natural roll", "nat label") _eq(Describe.label("@[option]", b), "Chosen value", "indirect label") - _eq(Describe.label("@str", null), "Str", "no board") + _eq(Describe.label("@str", null), "Str", "no spread") # The variable card wins over a collection. b.tables.append(_var_card("v_pilot", "Piloting", "skill_pilot")) - _eq(Describe.label("@skill_pilot", b), "Piloting", "card label before collection") + _eq(Describe.label("@skill_pilot", b), "Piloting", "card label before spread") # A collection doesn't declare its stem as a variable. var ctx := Roller.new_context(b, RandomNumberGenerator.new(), {}) - _check(ctx.declared("skill") == null, "a collection isn't a declared variable") + _check(ctx.declared("skill") == null, "a spread isn't a declared variable") _check(ctx.declared("str") != null, "a number card is") @@ -101,7 +101,7 @@ func _test_labels() -> void: func _test_effects() -> void: var b := _board() _eq(Describe.effect("@luck -= 1", b), "Luck −1", "subtract") - _eq(Describe.effect("@skill_pilot += 1", b), "Pilot +1", "add to a collection member") + _eq(Describe.effect("@skill_pilot += 1", b), "Pilot +1", "add to a spread member") _eq(Describe.effect("@luck += -2", b), "Luck −2", "add a negative") _eq(Describe.effect("@luck -= -2", b), "Luck +2", "subtract a negative") _eq(Describe.effect("@town = \"Millbrook\"", b), "Town = Millbrook", "set text") @@ -112,7 +112,7 @@ func _test_effects() -> void: _eq(Describe.effect("@age /= 2", b), "Age ÷2", "divide") _eq(Describe.effect("@traits += \"Psionic\"", b), "Add Psionic to Traits", "append") _eq(Describe.effect("@traits -= \"Psionic\"", b), "Remove Psionic from Traits", "remove") - _eq(Describe.effect("reset @skill_*", b), "Reset all Skills", "reset a collection") + _eq(Describe.effect("reset @skill_*", b), "Reset all Skills", "reset a spread") _eq(Describe.effect("reset @contact_*", b), "Reset all Contact values", "reset a prefix") _eq(Describe.effect("reset @luck", b), "Reset Luck", "reset a declared value") _eq(Describe.effect("reset @dex", b), "Clear Dex", "reset an undeclared value") @@ -121,7 +121,7 @@ func _test_effects() -> void: pick.options_from = "@skill_*" _eq(Describe.effect("@[option] += 1", b, pick), "Chosen skill +1", "indirect on a skills card") pick.options_from = "@contacts" - _eq(Describe.effect("@[option] += 1", b, pick), "Chosen value +1", "indirect outside a collection") + _eq(Describe.effect("@[option] += 1", b, pick), "Chosen value +1", "indirect outside a spread") _eq(Describe.effect("hero = \"Bob\"", b), "Hero = Bob", "chain target") _eq(Describe.effects("@luck -= 1; @str = 7\nreset @skill_*", b), ["Luck −1", "Strength = 7", "Reset all Skills"] as Array[String], "effects field") @@ -144,7 +144,7 @@ func _test_conditions() -> void: _eq(Describe.condition("not @commissioned", b), "Commissioned is not set", "unset") _eq(Describe.condition("option_value >= 1", b), "Chosen value is 1 or more", "chain value") _eq(Describe.condition("tier = 3", b), "Tier is 3", "input") - _eq(Describe.condition("@skill_pilot >= 1", b), "Pilot is 1 or more", "collection member") + _eq(Describe.condition("@skill_pilot >= 1", b), "Pilot is 1 or more", "spread member") _eq(Describe.condition("", b), "", "empty") @@ -171,14 +171,14 @@ func _test_options() -> void: var t := RollTable.create(RollTable.KIND_CHOICE, "raise", "Raise", "pick") _eq(Describe.options(t, b), "", "fixed card") t.options_from = "@skill_*" - _eq(Describe.options(t, b), "your Skills", "collection source") + _eq(Describe.options(t, b), "your Skills", "spread source") t.options_where = "option_value >= 1" _eq(Describe.options(t, b), "your Skills, level 1 or more", "level filter") t.options_where = "option != @last" _eq(Describe.options(t, b), "your Skills, where Chosen option is not Last", "other filter") t.options_where = "" t.options_from = "@contact_*" - _eq(Describe.options(t, b), "your Contact values", "prefix without collection") + _eq(Describe.options(t, b), "your Contact values", "prefix without spread") t.options_from = "@traits" _eq(Describe.options(t, b), "your Traits", "list source") t.options_from = "skills" @@ -191,7 +191,7 @@ func _test_pipes() -> void: var b := _board() var e := TableEntry.new("e1", "x") e.add_pipe("tier3") - _eq(Describe.pipe(e, "tier3", b), "", "plain pipe") + _eq(Describe.pipe(e, "tier3", b), "", "plain thread") e.set_pipe_with("tier3", {"tier": "3"}) e.set_pipe_when("tier3", "@luck >= 2") _eq(Describe.pipe(e, "tier3", b), "Tier 3 · only if Luck is 2 or more", "input and condition") @@ -261,7 +261,7 @@ func _test_why_facts() -> void: _eq(W.call({"type": "effect", "var": "@dex", "op": "reset", "before": 4, "after": null}), "Dex was cleared", "reset effect") _eq(W.call({"type": "effect", "var": "@skill_*", "op": "reset", "count": 3}), "Reset all Skills (3)", "prefix reset") _eq(W.call({"type": "effect", "var": "@luck", "op": "-=", "before": 2, "after": 1}, false), "@luck -=: 2 → 1", "effect text mode") - _eq(W.call({"type": "input", "name": "tier", "value": 3, "from": "pipe"}), "Tier was 3 (from the pipe)", "input") + _eq(W.call({"type": "input", "name": "tier", "value": 3, "from": "pipe"}), "Tier was 3 (from the thread)", "input") _eq(W.call({"type": "input", "name": "tier", "value": 1, "from": "default"}), "Tier was 1 (default)", "input default") _eq(W.call({"type": "show_if", "hidden": 2, "chosen_hidden": false}), "2 options hidden by their conditions", "show_if") _eq(W.call({"type": "options_where", "from": "@skill_*", "expr": "option_value >= 1", "kept": 3, "total": 5}), diff --git a/tests/test_fast_roll.gd b/tests/test_fast_roll.gd index 1fa0786..ef5a9a5 100644 --- a/tests/test_fast_roll.gd +++ b/tests/test_fast_roll.gd @@ -27,7 +27,7 @@ func _init() -> void: var all: Array = main.current["all"] _check(main.current.get("done", false), "fast roll is done immediately") _check(main.current["steps"].size() == all.size(), "fast roll shows every step at once") - _check(main.board.pipes.pulse_key == "", "fast roll sends no bead down the pipes") + _check(main.board.pipes.pulse_key == "", "fast roll sends no bead down the threads") var lit_steps := 0 for s: Dictionary in all: if s.has("entry_id") and not s.get("stop", false): @@ -36,7 +36,7 @@ func _init() -> void: _check(main.lit_entries.size() == lit_steps, "only the path's results are lit") # Chains from Wilderness Travel are a single line, so n results have n - 1 pipes. _check(main.lit_pipes.size() == maxi(0, lit_steps - 1), - "each link in the chain lights its pipe (%d pipes, %d results)" % [main.lit_pipes.size(), lit_steps]) + "each link in the chain lights its thread (%d threads, %d results)" % [main.lit_pipes.size(), lit_steps]) for c in main.cards.values(): _check(not (c as TableCard)._rolling, "no card is left tumbling") diff --git a/tests/test_groups.gd b/tests/test_groups.gd index 967aab3..9e89af2 100644 --- a/tests/test_groups.gd +++ b/tests/test_groups.gd @@ -83,7 +83,7 @@ func _test_model() -> void: _check(gone == ["b"] and b.get_table("b") == null and b.get_group(g.id) == null, "delete_group removes the group and its tables") b.ungroup(h.id) _check(b.groups.is_empty(), "ungroup removes the group") - _check(b.get_table("start").entries[0].pipes.is_empty(), "pipes into deleted tables go") + _check(b.get_table("start").entries[0].pipes.is_empty(), "threads into deleted tables go") func _test_json() -> void: @@ -96,7 +96,7 @@ func _test_json() -> void: g.size = Vector2(700, 300) var text := b.to_json() var b2 := TowerBoard.new() - _check(b2.load_json(text), "a board with groups loads") + _check(b2.load_json(text), "a spread with groups loads") _check(b2.groups.size() == 1, "one group back") var g2 := b2.groups[0] _check(g2.id == g.id and g2.name == "Middle" and g2.collapsed and g2.details == g.details, "id, name, collapsed and details round-trip") @@ -106,7 +106,7 @@ func _test_json() -> void: # Old files without groups load unchanged, and save without a groups key. var old := TowerBoard.new() var src := SampleBoard.create().to_dict() - _check(not src.has("groups"), "boards without groups write no groups key") + _check(not src.has("groups"), "spreads without groups write no groups key") _check(old.load_dict(src) and old.groups.is_empty(), "an old file loads with no groups") _check(old.to_json() == SampleBoard.create().to_json() or JSON.parse_string(old.to_json())["tables"].size() == src["tables"].size(), "an old file saves the same tables") var v1 := TowerBoard.new() @@ -135,7 +135,7 @@ func _test_import() -> void: _check(r["ok"] and gl[0]["members"] == ["a", "b"], "import maps members by id or name and drops unknown ones: %s" % str(gl[0]["members"])) _check(str(r["warnings"]).contains("ghost"), "import warns about unknown members") var b := TowerBoard.new() - _check(b.load_dict(r["collection"]) and b.groups.size() == 1 and b.groups[0].collapsed, "an imported collection keeps its groups") + _check(b.load_dict(r["collection"]) and b.groups.size() == 1 and b.groups[0].collapsed, "an imported spread keeps its groups") var res := JsonIO.import_json(JsonIO.export_json(b.to_dict())) _check(res["ok"] and res["collection"]["groups"][0]["members"] == ["a", "b"], "export and import round-trip groups") @@ -157,7 +157,7 @@ func _test_group_from_selection() -> void: _check(g != null and g.members == ["a", "b"], "Group makes a group of the selection") _check(main.selection.is_empty() and not main.editing._sel_bar.visible, "grouping clears the selection") var node := main.group_node(g.id) - _check(node != null and node.get_parent() == main.board.groups, "an expanded group's frame sits behind the pipes") + _check(node != null and node.get_parent() == main.board.groups, "an expanded group's frame sits behind the threads") var ra := Rect2(main.card_for("a").position, main.card_for("a").size) var rb := Rect2(main.card_for("b").position, main.card_for("b").size) _check(g.rect().encloses(ra) and g.rect().encloses(rb), "the frame fits around its members") @@ -178,12 +178,12 @@ func _test_collapse() -> void: _check(main.card_for("start").visible and main.card_for("out").visible, "other cards stay") var paths: Dictionary = main.board.pipes._paths var into: PackedVector2Array = paths.get("start:e1>a", PackedVector2Array()) - _check(not into.is_empty() and into[into.size() - 1].distance_to(node.inlet_point()) < 0.5, "a pipe into a member attaches to the group's inlet") + _check(not into.is_empty() and into[into.size() - 1].distance_to(node.inlet_point()) < 0.5, "a thread into a member attaches to the group's inlet") var outp: PackedVector2Array = paths.get("b:e1>out", PackedVector2Array()) - _check(not outp.is_empty() and is_equal_approx(outp[0].x, node.position.x + node.size.x), "a pipe out of a member leaves from the group's right edge") + _check(not outp.is_empty() and is_equal_approx(outp[0].x, node.position.x + node.size.x), "a thread out of a member leaves from the group's right edge") _check(outp.is_empty() or outp[outp.size() - 1].distance_to(main.card_for("out").inlet_point()) < 0.5, "and still reaches its target") - _check(not paths.has("a:e1>b"), "pipes inside the collapsed group aren't drawn") - _check(main.board.pipes.pipe_at(into[into.size() / 2], 3.0) == "", "re-routed pipes can't be clicked") + _check(not paths.has("a:e1>b"), "threads inside the collapsed group aren't drawn") + _check(main.board.pipes.pipe_at(into[into.size() / 2], 3.0) == "", "re-routed threads can't be clicked") var gp: Dictionary = main.board.pipes.group_ports _check(not gp.is_empty(), "the group card gets an outlet port") _check(main.data.to_dict()["groups"][0]["collapsed"] == true, "collapsed is saved") @@ -211,7 +211,7 @@ func _test_lit_and_choice() -> void: break _check(main.current.get("done", false), "the roll finishes after the answer") _check(main.is_entry_lit("b", "e2") and main.is_entry_lit("out", "e1"), "the picked option and what follows are lit") - _check(main.lit_pipes.has("b:e2>out"), "the pipe out of the group is lit") + _check(main.lit_pipes.has("b:e2>out"), "the thread out of the group is lit") node = main.group_node(g.id) var keys := main.lit_keys_for_group(g) _check(keys.has("b:e2") and (keys.has("a:e1") or keys.has("a:e2")), "the group knows its members' lit results: %s" % str(keys)) @@ -222,7 +222,7 @@ func _test_lit_and_choice() -> void: if row and not outp.is_empty(): var to_world := main.board.world.get_global_transform().affine_inverse() var mid := (to_world * row.get_global_rect().get_center()).y - _check(absf(outp[0].y - mid) < 1.0, "a lit result's pipe leaves from its row on the group card") + _check(absf(outp[0].y - mid) < 1.0, "a lit result's thread leaves from its row on the group card") main.prompt_hook = func(_req: Dictionary) -> Variant: return 0 # Fast roll: lights at once. main.start_roll("start", true) @@ -331,7 +331,7 @@ func _test_ungroup_and_delete() -> void: (b as Button).pressed.emit() await process_frame _check(main.data.groups.is_empty() and main.data.get_table("a") == null and main.data.get_table("b") == null, "deleting the group deletes its cards") - _check(main.card_for("a") == null and main.data.get_table("start").entries[0].pipes.is_empty(), "their cards and the pipes into them go") + _check(main.card_for("a") == null and main.data.get_table("start").entries[0].pipes.is_empty(), "their cards and the threads into them go") _check(main.top_bar._toast.visible and main.top_bar._toast_undo.visible, "with an undo toast") main.top_bar._undo() await process_frame diff --git a/tests/test_inspector.gd b/tests/test_inspector.gd index 9023b8e..625c76f 100644 --- a/tests/test_inspector.gd +++ b/tests/test_inspector.gd @@ -83,7 +83,7 @@ func _board_dict() -> Dictionary: {"id": "str", "name": "Strength", "kind": "variable", "var_name": "str", "var_type": "number", "initial": "9", "x": 40, "y": 330, "entries": []}, {"id": "luck", "name": "Luck", "kind": "variable", "var_name": "luck", "var_type": "number", "initial": "2", "x": 40, "y": 470, "entries": []}, {"id": "skills", "name": "Skills", "kind": "variable", "var_name": "skill", "var_type": "collection", "x": 40, "y": 610, "entries": []}, - {"id": "rt", "name": "Router", "kind": "router", "x": 1000, "y": 40, "entries": [ + {"id": "rt", "name": "Branch", "kind": "router", "x": 1000, "y": 40, "entries": [ {"id": "c1", "text": "Strong", "when": "@str >= 8"}, {"id": "c2", "text": "Otherwise"}]}, {"id": "lp", "name": "Repeat", "kind": "loop", "loop_mode": "times", "loop_expr": "3", "x": 1000, "y": 300, "entries": [{"id": "e1", "text": "Each time"}, {"id": "e2", "text": "Afterwards"}]}, @@ -114,21 +114,21 @@ func _test_selection() -> void: print("Selection") _check(insp.visible, "the inspector shows in Build mode") _check(insp.selection.is_empty(), "nothing is selected at first") - _check(_has_text(insp, "Select a card, a result or a pipe to edit it."), "the empty state says how to select") + _check(_has_text(insp, "Select a card, a result or a thread to edit it."), "the empty state says how to select") main.select_card("gate") _eq(main.inspector_selection(), {"kind": "card", "tid": "gate"}, "select_card") _check(insp.fields.has("check_dice"), "a check card shows its dice field") main.select_result("beyond", "e2") _eq(insp.selection.get("kind"), "result", "select_result") - _check(insp.effects != null and insp.pipe_parts.has("loot") and insp.pipe_parts.has("curios"), "a result shows its effects and both pipes") + _check(insp.effects != null and insp.pipe_parts.has("loot") and insp.pipe_parts.has("curios"), "a result shows its effects and both threads") main.inspecting.select_pipe("beyond:e2>loot") _eq(insp.selection.get("to"), "loot", "select_pipe") - _eq(insp.pipe_parts.keys(), ["loot"], "a pipe shows only its own box") - _eq(main.board.pipes.select_key, "beyond:e2>loot", "the selected pipe is highlighted on the board") + _eq(insp.pipe_parts.keys(), ["loot"], "a thread shows only its own box") + _eq(main.board.pipes.select_key, "beyond:e2>loot", "the selected thread is highlighted on the spread") main.clear_inspector() _check(insp.selection.is_empty(), "clear_inspector") main.open_pipe_options("beyond:e2>curios", Vector2(10, 10)) - _eq(insp.selection.get("to"), "curios", "clicking a pipe in Build selects it in the inspector") + _eq(insp.selection.get("to"), "curios", "clicking a thread in Build selects it in the inspector") main.request_table_settings("loot") _eq(insp.selection, {"kind": "card", "tid": "loot"}, "Table settings… selects the card") main.select_result("beyond", "nope") @@ -274,7 +274,7 @@ func _test_otherwise() -> void: main.select_result("beyond", "e2") var loot_other: CheckBox = insp.pipe_parts["loot"]["otherwise"] var cur_other: CheckBox = insp.pipe_parts["curios"]["otherwise"] - _check(cur_other.button_pressed and not cur_other.disabled, "the otherwise pipe is ticked") + _check(cur_other.button_pressed and not cur_other.disabled, "the otherwise thread is ticked") _check(loot_other.disabled and not loot_other.button_pressed, "Otherwise is off while Only if is set") insp.set_pipe_when("loot", "") _check(not loot_other.disabled, "clearing Only if allows Otherwise") @@ -300,7 +300,7 @@ func _test_otherwise() -> void: func _test_pipe_inputs() -> void: - print("Pipe inputs") + print("Thread inputs") main.select_result("beyond", "e2") var le: LineEdit = insp.pipe_parts["loot"]["inputs"]["tier"] _eq(le.text, "3", "the target's input shows the passed value") @@ -360,13 +360,13 @@ func _test_check() -> void: func _test_collection() -> void: - print("Collection members") + print("Spread members") main.select_card("skills") var t := _t("skills") _eq(insp.members(t), [], "no members at first") var item := InspectorCard.add_member(insp, t) _eq(item, "new", "+ Add member") - _eq(main.persistent_vars.get("skill_new", {}).get("value"), 0, "it's the board value @skill_new = 0") + _eq(main.persistent_vars.get("skill_new", {}).get("value"), 0, "it's the spread value @skill_new = 0") InspectorCard.set_member(insp, t, "new", "2") InspectorCard.rename_member(insp, t, "new", "pilot") _check(not main.persistent_vars.has("skill_new"), "renaming drops the old name") @@ -377,7 +377,7 @@ func _test_collection() -> void: _check(InspectorKit.find_tagged(insp, "member.pilot.value") != null, "each member has a value field") InspectorCard.remove_member(insp, t, "gun_combat") _eq(insp.members(t), [["pilot", "2"]], "× removes a member") - _eq(Describe.label("@skill_pilot", main.data), "Pilot", "(members are labelled through the collection)") + _eq(Describe.label("@skill_pilot", main.data), "Pilot", "(members are labelled through the spread)") await _frames() @@ -387,15 +387,15 @@ func _test_options() -> void: var t := _t("learn") _check(not t.is_dynamic(), "a fixed list at first") var err := InspectorCard.set_options(insp, "@skill_*", "") - _eq(err, "", "From a collection") + _eq(err, "", "From a spread") _check(t.is_dynamic() and t.options_from == "@skill_*", "options come from Skills") var where: ConditionBuilder = insp.fields.get("options_where") _check(where != null, "a where builder") where.add_clause("option_value", "ge", "1") _eq(t.options_where, "option_value >= 1", "where Its value is at least 1") var picker: ValuePicker = insp.fields["options_from"] - _eq(picker.value, "@skill_*", "the source picker shows the collection") - _check(picker.items().any(func(it: Dictionary) -> bool: return it["name"] == "@skill_*"), "it offers collections") + _eq(picker.value, "@skill_*", "the source picker shows the spread") + _check(picker.items().any(func(it: Dictionary) -> bool: return it["name"] == "@skill_*"), "it offers spreads") _check(not picker.items().any(func(it: Dictionary) -> bool: return it["name"] == "@luck"), "but not numbers") _eq(insp.apply_settings({"options_mode": "fixed"}, true), "", "back to a fixed list") _check(t.options_from == "" and not t.is_dynamic(), "options_from is cleared") @@ -407,14 +407,14 @@ func _test_value_picker() -> void: var p := ValuePicker.new(main, "") root.add_child(p) var names := p.items().map(func(it: Dictionary) -> String: return it["name"]) - _check(names.has("@luck") and names.has("@str"), "it lists the board's values") + _check(names.has("@luck") and names.has("@str"), "it lists the spread's values") var luck: Dictionary = p.items().filter(func(it: Dictionary) -> bool: return it["name"] == "@luck")[0] _eq([luck["label"], luck["kind"], luck["group"]], ["Luck", "number", "Variables"], "with label, kind and group") _check(names.find("@luck") < names.find("@skill_pilot") or not names.has("@skill_pilot"), "variables come first") - _check(names.has("@skill_pilot"), "collection members with values are offered") - _check(not names.has("@skill_*"), "collection patterns only where they fit") + _check(names.has("@skill_pilot"), "spread members with values are offered") + _check(not names.has("@skill_*"), "spread patterns only where they fit") p.allow_patterns = true - _check(p.items().any(func(it: Dictionary) -> bool: return it["name"] == "@skill_*" and it["group"] == "Collections"), "grouped under Collections") + _check(p.items().any(func(it: Dictionary) -> bool: return it["name"] == "@skill_*" and it["group"] == "Collections"), "grouped under Spreads") _eq(p.filtered("lu").map(func(it: Dictionary) -> String: return it["name"]), ["@luck"], "search by label") p.open_menu() await _frames() @@ -428,12 +428,12 @@ func _test_value_picker() -> void: var n := p.create_value("Fame", true) _eq(n, "@fame", "+ New value… names it") var card := main.variable_card("fame") - _check(card != null and card.name == "Fame", "Show on the board adds a variable card") + _check(card != null and card.name == "Fame", "Show on the spread adds a variable card") _eq(got.back(), "@fame", "and picks it") var steps := main.undo_redo.edits.undo_stack.size() n = p.create_value("Mood", false) _eq(n, "@mood", "without a card") - _check(main.variable_card("mood") == null and main.undo_redo.edits.undo_stack.size() == steps, "no card, no board change") + _check(main.variable_card("mood") == null and main.undo_redo.edits.undo_stack.size() == steps, "no card, no spread change") p.queue_free() await _frames() @@ -499,7 +499,7 @@ func _test_dirty_and_save() -> void: main._saving_enabled = true main._save_timer.stop() insp.apply_settings({"tags": "loot, treasure"}) - _check(main.edit_rev > rev, "an inspector edit marks the board dirty") + _check(main.edit_rev > rev, "an inspector edit marks the spread dirty") _check(not main._save_timer.is_stopped(), "and schedules a save") main._save_timer.stop() main._saving_enabled = false @@ -507,7 +507,7 @@ func _test_dirty_and_save() -> void: var copy := TowerBoard.new() copy.load_dict(main.data.to_dict()) _eq(copy.get_table("loot").tags, ["loot", "treasure"], "the saved form has it") - _eq(copy.get_table("beyond").find_entry("e2").with_for("loot"), {"tier": "3"}, "pipe inputs are saved") + _eq(copy.get_table("beyond").find_entry("e2").with_for("loot"), {"tier": "3"}, "thread inputs are saved") main.undo_redo._commit_edits() _check(main.undo_redo.can_undo(), "and it's an undo step") await _frames() @@ -533,7 +533,7 @@ func _test_other_cards() -> void: _eq(rt.entries[2].id, "c2", "it goes before the Otherwise case") insp.set_case_when(rt.entries[1].id, "@luck >= 1") _eq(rt.entries[1].when, "@luck >= 1", "a case's condition") - _eq(Roller.lint_router(rt), [], "the router is fine") + _eq(Roller.lint_router(rt), [], "the branch is fine") # A router case from the result side. main.select_result("rt", "c1") _check(insp.case_builder != null and insp.case_builder.clauses.size() == 1, "a case result shows its condition builder") @@ -557,13 +557,13 @@ func _test_add_kinds() -> void: print("+ Card ▾") var labels: Array = main.editing.ADD_KINDS.map(func(k: Array) -> String: return k[0]) _check(labels.any(func(s: String) -> bool: return s.begins_with("Check")), "Check card is in the menu") - _check(labels.any(func(s: String) -> bool: return s.begins_with("Collection")), "Collection is in the menu") + _check(labels.any(func(s: String) -> bool: return s.begins_with("Collection")), "Spread is in the menu") _eq(main.editing._add_menu.text, "+ Card ▾", "the button reads + Card ▾") var c := main.editing.add_table(RollTable.KIND_CHECK) _check(c.kind == RollTable.KIND_CHECK and c.name == "Check" and c.entries.size() == 2, "adding a check card") _eq(insp.selection.get("tid"), c.id, "a new card is selected in the inspector") var col := main.editing.add_table(RollTable.KIND_VARIABLE, RollTable.VAR_COLLECTION) - _check(col.is_collection() and col.name == "Skills" and col.var_name == "skill_2", "adding a collection (%s, @%s)" % [col.name, col.var_name]) + _check(col.is_collection() and col.name == "Skills" and col.var_name == "skill_2", "adding a spread (%s, @%s)" % [col.name, col.var_name]) var v := main.editing.add_table(RollTable.KIND_VARIABLE, "number") _eq(v.name, "New variable", "a plain variable keeps its name") await _frames() diff --git a/tests/test_integration.gd b/tests/test_integration.gd index 1a102cb..d08d1ec 100644 --- a/tests/test_integration.gd +++ b/tests/test_integration.gd @@ -87,11 +87,11 @@ func _test_pipe_save() -> void: var ctx := Roller.new_context(b, _rng(3), store, {}) var n := Roller.roll(b, "src", ctx.rng, 0, {}, ctx) # Text is expanded before pipes roll, so {foe} isn't set yet in the same entry. - _check((n["summary"] as String).contains("{foe?}"), "pipes roll after the entry's text") - _eq(ctx.lookup("foe"), "[b]Ogre[/b]", "pipe save_as stores the export BBCode in a chain var") + _check((n["summary"] as String).contains("{foe?}"), "threads roll after the entry's text") + _eq(ctx.lookup("foe"), "[b]Ogre[/b]", "thread save_as stores the export BBCode in a chain var") _check(not (ctx.lookup("foe") as String).contains("url="), "saved value has no internal markers") _check(store.has("pal") and store["pal"]["value"] == "Mira" and store["pal"]["source"] == "pals", "@ save goes to persistent vars with source: %s" % str(store)) - _check(ctx.persistent_changed, "persistent_changed after a pipe save") + _check(ctx.persistent_changed, "persistent_changed after a thread save") # A later table in the same chain sees the chain var. var a := _table("a", "A", ["start"]) var c := _table("c", "C", ["uses {foe}"]) @@ -100,7 +100,7 @@ func _test_pipe_save() -> void: var b2 := _board([a, c, dst]) var n2 := Roller.roll(b2, "a", _rng(4)) var used: String = (n2["children"] as Array)[1]["summary"] - _eq(used, "uses [url=var:foe][b]Ogre[/b][/url]", "chain var from a pipe is used by a later pipe") + _eq(used, "uses [url=var:foe][b]Ogre[/b][/url]", "chain var from a thread is used by a later thread") func _test_persistent_across_rolls() -> void: @@ -162,7 +162,7 @@ func _test_depth_limit() -> void: for s in Roller.flatten(n2, []): if s.get("inline", false): inline += 1 - _check(inline <= Roller.MAX_DEPTH and worst <= 2 * Roller.MAX_DEPTH + 1, "mixed pipes and refs stop at the reference limit (%d refs, depth %d)" % [inline, worst]) + _check(inline <= Roller.MAX_DEPTH and worst <= 2 * Roller.MAX_DEPTH + 1, "mixed threads and refs stop at the reference limit (%d refs, depth %d)" % [inline, worst]) func _test_missing_and_unset() -> void: @@ -215,8 +215,8 @@ func _test_lit_and_steps() -> void: var lp := {} var lt := {} Roller.collect_lit(n, le, lp, lt) - _check(lp.has(Roller.ref_key("quest", "quest0", "names")), "reference pipe is lit") - _check(lp.has(Roller.pipe_key("quest", "quest0", "names")), "real pipe is lit too") + _check(lp.has(Roller.ref_key("quest", "quest0", "names")), "reference thread is lit") + _check(lp.has(Roller.pipe_key("quest", "quest0", "names")), "real thread is lit too") _check(Roller.is_ref_key(Roller.ref_key("a", "b", "c")) and not Roller.is_ref_key(Roller.pipe_key("a", "b", "c")), "ref keys are told apart") _check((lt[Roller.entry_key("quest", "quest0")] as String).contains("Aldric"), "lit texts hold the expanded text") # Steps survive JSON (history is saved as JSON). diff --git a/tests/test_io.gd b/tests/test_io.gd index 08580c3..9c1138a 100644 --- a/tests/test_io.gd +++ b/tests/test_io.gd @@ -57,12 +57,12 @@ func _test_json() -> void: var small := _small() var res2 := JsonIO.import_json(JsonIO.export_json(small)) - _check(res2["ok"] and res2["collection"] == JsonIO.canonical(small), "small collection round-trips exactly") + _check(res2["ok"] and res2["collection"] == JsonIO.canonical(small), "small spread round-trips exactly") _check(not JsonIO.export_json({"tables": [], "state": {"draws": 1}}).contains("state"), "export drops unknown/local keys") # Legacy keys: triggers, die, collection name. var legacy := JsonIO.import_json('{"format_version":1,"collection":"Old","tables":[{"id":"a","name":"A","die":20,"entries":[{"text":"x","triggers":["a"]}]}]}') - _check(legacy["ok"] and legacy["collection"]["name"] == "Old", "legacy collection key becomes name") + _check(legacy["ok"] and legacy["collection"]["name"] == "Old", "legacy spread key becomes name") var lt: Dictionary = legacy["collection"]["tables"][0] _check(lt["dice"] == "1d20" and lt["entries"][0]["pipes"] == ["a"] and lt["entries"][0]["id"] == "e1", "legacy die/triggers/missing entry id handled") @@ -81,8 +81,8 @@ func _test_json() -> void: _check(ids.size() == 3, "table ids are unique after import") _check(dt[0]["id"] == "t" and dt[1]["id"] != "t" and dt[2]["id"] == "third_table", "first keeps id, others get fresh ones") _check(dt[0]["entries"][0]["id"] != dt[0]["entries"][1]["id"], "duplicate entry ids are fixed") - _check(dt[1]["entries"][0]["pipes"] == ["t"], "pipe by table name is resolved to the id") - _check(dt[2]["entries"][0]["pipes"] == ["t"], "pipe to the original id keeps pointing at the first table") + _check(dt[1]["entries"][0]["pipes"] == ["t"], "thread by table name is resolved to the id") + _check(dt[2]["entries"][0]["pipes"] == ["t"], "thread to the original id keeps pointing at the first table") # Validation. _check(not JsonIO.import_json("not json")["ok"], "garbage is rejected") @@ -119,13 +119,13 @@ func _test_canvas() -> void: for e in doc["edges"]: labels.append(str(e.get("label", ""))) _check(labels.has("×2 → weapon") and labels.has("ref → w2"), "canvas edge labels (%s)" % str(labels)) - _check(doc["edges"].size() == 3, "canvas edges: 2 pipes + 1 ref (missing target skipped), got %d" % doc["edges"].size()) + _check(doc["edges"].size() == 3, "canvas edges: 2 threads + 1 ref (missing target skipped), got %d" % doc["edges"].size()) var res := CanvasIO.import_canvas(text) _check(res["ok"], "canvas imports") var want := JsonIO.canonical(small) var got: Dictionary = res["collection"] _check(got["tables"] == want["tables"], "canvas round trip keeps every field") - _check(got["id"] == "demo" and got["name"] == small["name"], "canvas round trip keeps collection id and name") + _check(got["id"] == "demo" and got["name"] == small["name"], "canvas round trip keeps spread id and name") # Group sizing: entries sit inside their group. var ok_inside := true @@ -146,7 +146,7 @@ func _test_canvas() -> void: var sample := SampleBoard.create().to_dict() var big := CanvasIO.import_canvas(CanvasIO.export_canvas(sample)) _check(big["ok"] and _plain_tables(big["collection"]["tables"], sample) == _plain_tables(JsonIO.canonical(sample)["tables"], sample), - "sample board's roll tables survive a canvas round trip (logic keys are JSON-only)") + "sample spread's roll tables survive a canvas round trip (logic keys are JSON-only)") func _test_canvas_stripped() -> void: @@ -172,8 +172,8 @@ func _test_canvas_stripped() -> void: _check(loot["entries"][1]["text"] == "Melee weapon \"sharp\" [1]", "stripped: BBCode is gone from visible text") var pipe: Variant = loot["entries"][1].get("pipes", [])[0] _check(pipe is Dictionary and pipe["table"] == weapons["id"] and pipe["count"] == 2 and pipe["save_as"] == "weapon", "stripped: count and save_as parsed from edge label") - _check(weapons["entries"][1].get("pipes", []) == [loot["id"]], "stripped: plain pipe becomes a table id") - _check(not loot["entries"][2].has("pipes"), "stripped: reference edges do not become pipes") + _check(weapons["entries"][1].get("pipes", []) == [loot["id"]], "stripped: plain thread becomes a table id") + _check(not loot["entries"][2].has("pipes"), "stripped: reference edges do not become threads") var found := false for g in res["guesses"]: found = found or (g as String).contains("1d6") @@ -194,9 +194,9 @@ func _test_mermaid_dot() -> void: var m := MermaidExporter.export_mermaid(small) _check(m.begins_with("graph LR"), "mermaid starts with graph LR") _check(m.contains("t0[\"Loot\"]") and m.contains("t1[\"Weapons (1d6)\"]"), "mermaid nodes, dice in label") - _check(m.contains("t0 -->|\"") and m.contains("×2 → weapon") and m.contains("| t1"), "mermaid pipe edge with count and save_as") + _check(m.contains("t0 -->|\"") and m.contains("×2 → weapon") and m.contains("| t1"), "mermaid thread edge with count and save_as") _check(m.contains("t0 -.->|\"") , "mermaid dashed edge for reference") - _check(m.contains("t1 -->|\"Sword") and m.contains("| t0"), "mermaid pipe back to Loot") + _check(m.contains("t1 -->|\"Sword") and m.contains("| t0"), "mermaid thread back to Loot") _check(m.contains("missing: ghost") and m.contains(":::missing"), "mermaid marks the missing target") _check(not m.contains("[b]") and not m.contains("[/b]"), "mermaid strips BBCode") _check(m.contains("#quot;sharp#quot;") and m.contains("#91;1#93;"), "mermaid escapes quotes and brackets") @@ -209,9 +209,9 @@ func _test_mermaid_dot() -> void: var d := DotExporter.export_dot(small) _check(d.begins_with("digraph TableTower {") and d.strip_edges().ends_with("}"), "dot has a digraph wrapper") _check(d.contains("Weapons (1d6)") and d.contains("PORT=\"e1\""), "dot table labels and entry ports") - _check(d.contains("t0:e1:e -> t1:head:w [label=\"×2 → weapon\"]"), "dot pipe edge from entry port to table") + _check(d.contains("t0:e1:e -> t1:head:w [label=\"×2 → weapon\"]"), "dot thread edge from entry port to table") _check(d.contains("t0:e2:e -> t1:head:w [label=\"ref → w2\", style=dashed]"), "dot dashed reference edge") - _check(d.contains("t1:e1:e -> t0:head:w;"), "dot plain pipe edge") + _check(d.contains("t1:e1:e -> t0:head:w;"), "dot plain thread edge") _check(d.contains("missing: ghost") and d.contains("color=red"), "dot marks the missing target") _check(d.contains(""sharp"") and not d.contains("[b]"), "dot escapes quotes in HTML labels and strips BBCode") _check(d.contains("label=\"Demo \\\"Set\\\"\""), "dot escapes quotes in strings") @@ -221,7 +221,7 @@ func _test_mermaid_dot() -> void: # Big tables don't explode. var sm := MermaidExporter.export_mermaid(SampleBoard.create().to_dict()) var sd := DotExporter.export_dot(SampleBoard.create().to_dict()) - _check(sm.contains("graph LR") and sd.contains("more"), "sample board exports to mermaid and dot") + _check(sm.contains("graph LR") and sd.contains("more"), "sample spread exports to mermaid and dot") func _test_graphml() -> void: @@ -245,13 +245,13 @@ func _test_graphml() -> void: var sample := SampleBoard.create().to_dict() var big := GraphMLIO.import_graphml(GraphMLIO.export_graphml(sample)) _check(big["ok"] and _plain_tables(big["collection"]["tables"], sample) == _plain_tables(JsonIO.canonical(sample)["tables"], sample), - "sample board's roll tables survive a graphml round trip (logic keys are JSON-only)") + "sample spread's roll tables survive a graphml round trip (logic keys are JSON-only)") # Foreign GraphML: nodes become tables, edges entries. var foreign := 'AlphaBeta' var fres := GraphMLIO.import_graphml(foreign) _check(fres["ok"] and fres["collection"]["tables"].size() == 2 and not (fres["guesses"] as Array).is_empty(), "foreign graphml imports with guesses") - _check(fres["collection"]["tables"][0]["entries"][0]["pipes"] == ["beta"], "foreign graphml edge becomes a pipe") + _check(fres["collection"]["tables"][0]["entries"][0]["pipes"] == ["beta"], "foreign graphml edge becomes a thread") _check(not GraphMLIO.import_graphml("")["ok"], "non-graphml is rejected") # Write a file once to make sure the text survives disk. diff --git a/tests/test_logic.gd b/tests/test_logic.gd index dfe7f61..f305005 100644 --- a/tests/test_logic.gd +++ b/tests/test_logic.gd @@ -299,7 +299,7 @@ func _test_choices() -> void: _check(n.get("picked", false) and (n["entry"] as TableEntry).text == "Army" and n.get("kind") == "choice", "picked entry is the node's entry") _eq(_var(vars, "branch"), "ground", "picked entry's effects run") _eq(_var(vars, "career"), "Army", "save_as gets the picked text") - _check((n["children"] as Array).size() == 1 and Formatter.strip_tags((n["children"] as Array)[0]["summary"]) == "Then Army", "picked entry's pipes follow") + _check((n["children"] as Array).size() == 1 and Formatter.strip_tags((n["children"] as Array)[0]["summary"]) == "Then Army", "picked entry's threads follow") _check(not n.has("value"), "a picked entry has no die value") # pick: Random. var randoms := {} @@ -323,7 +323,7 @@ func _test_choices() -> void: _check(_var(vars, "terms") is int, "...as an int") _eq(ctx.chain_vars.get("answer"), 4, "chain variable answer") _eq(_var(vars, "total"), 14, "the Answer entry's effects see answer") - _eq((n["children"] as Array).size(), 4, "the Answer entry's pipe count can be an expression") + _eq((n["children"] as Array).size(), 4, "the Answer entry's thread count can be an expression") _check(n.has("effects") and Effects.log_text(n["effects"]) == PackedStringArray(["Total +4 → 14"]), "effects log on the node: %s" % str(n.get("effects"))) var steps := Roller.flatten(n, []) _check(steps[0].get("answer") == 4 and steps[0].get("kind") == "choice" and steps[0].has("effects"), "steps carry kind, answer and effects") @@ -382,7 +382,7 @@ func _test_choices() -> void: func _test_loops() -> void: # times - var loop := RollTable.create(RollTable.KIND_LOOP, "loop", "Loop", "times") + var loop := RollTable.create(RollTable.KIND_LOOP, "loop", "Repeat", "times") loop.loop_expr = "3" loop.entries[0].effects = "@sum += i" loop.entries[0].text = "Pass {i}" @@ -396,13 +396,13 @@ func _test_loops() -> void: _eq(n.get("summary"), "Repeated 3 times", "loop node text") _eq(_var(vars, "sum"), 6, "i is 1, 2, 3") _eq(_texts(Roller.flatten(n, [])), ["Repeated 3 times", "Pass 1", "Pass 2", "Pass 3", "Afterwards", "Done after 6"], "loop steps") - _check(not ctx.chain_vars.has("i"), "i is gone after the loop") + _check(not ctx.chain_vars.has("i"), "i is gone after the repeat") var steps := Roller.flatten(n, []) _check(steps[1].get("pass") == 1 and steps[1]["num"] == "1" and steps[4].get("after", false) and steps[0].get("passes") == 3, "pass and Afterwards steps are marked") var le := {} var lp := {} Roller.collect_lit(n, le, lp) - _check(lp.has(Roller.pipe_key("loop", "e2", "done")) and not lp.has(Roller.pipe_key("loop", "e1", "loop")), "passes light no pipe; Afterwards' pipe is lit") + _check(lp.has(Roller.pipe_key("loop", "e2", "done")) and not lp.has(Roller.pipe_key("loop", "e1", "loop")), "passes light no thread; Afterwards' thread is lit") loop.loop_expr = "0" n = Roller.roll(b, "loop", _rng(2)) _check(n.get("passes") == 0 and (n["children"] as Array).size() == 1, "times 0 runs only Afterwards") @@ -447,7 +447,7 @@ func _test_loop_from_answer() -> void: var q := RollTable.create(RollTable.KIND_CHOICE, "q", "How many?", "number") q.max_expr = "10" q.entries[0].add_pipe("loop") - var loop := RollTable.create(RollTable.KIND_LOOP, "loop", "Loop", "times") + var loop := RollTable.create(RollTable.KIND_LOOP, "loop", "Repeat", "times") loop.loop_expr = "answer" loop.entries[0].effects = "@count += 1" var b := _board([q, loop]) @@ -488,7 +488,7 @@ func _test_cycles() -> void: _check(steps.back().get("stop", false) and steps.back().get("limit", false), "the marker is a stop step") _eq(ctx.halted, "Stopped after 10,000 actions", "ctx.halted") _check(ms < 15000, "the endless cycle stops in reasonable time (%d ms)" % ms) - _eq(Roller.endless_cycles(b2), ["loop"] as Array[String], "a plain self-pipe is still flagged") + _eq(Roller.endless_cycles(b2), ["loop"] as Array[String], "a plain self-thread is still flagged") # Mixed with inline references. var r := _table("r", ["[[Loop]] and on"]) b2.tables.append(r) @@ -601,7 +601,7 @@ func _test_json() -> void: num.min_expr = "1" num.max_expr = "@max" var txt := RollTable.create(RollTable.KIND_CHOICE, "txt", "Txt", "text") - var loop := RollTable.create(RollTable.KIND_LOOP, "loop", "Loop", "until") + var loop := RollTable.create(RollTable.KIND_LOOP, "loop", "Repeat", "until") var vcard := RollTable.create(RollTable.KIND_VARIABLE, "var", "STR", "list") vcard.initial = "\"a, b\"" var sheet := RollTable.create(RollTable.KIND_SHEET, "sheet", "Sheet") @@ -622,12 +622,12 @@ func _test_json() -> void: _check(not plain["entries"][0].has("effects"), "an entry without effects has no effects key") var d := num.to_dict() _check(d["kind"] == "choice" and d["choice"] == "number" and d["min"] == "1" and d["max"] == "@max" and not d.has("save_as"), "choice keys: %s" % str(d)) - _eq(roll.to_dict()["entries"][0]["pipes"], [{"table": "loop", "count": "@terms"}], "an expression pipe count") + _eq(roll.to_dict()["entries"][0]["pipes"], [{"table": "loop", "count": "@terms"}], "an expression thread count") # RollTable round trip through JSON text. var text := b.to_json() var b2 := TowerBoard.new() - _check(b2.load_json(text), "board JSON loads") - _eq(b2.to_json(), text, "board JSON round-trips unchanged") + _check(b2.load_json(text), "spread JSON loads") + _eq(b2.to_json(), text, "spread JSON round-trips unchanged") _eq(b2.get_table("roll").entries[0].count_expr("loop"), "@terms", "expression count survives") # JsonIO canonical/import keep every new key. var exported := JsonIO.export_json(b.to_dict()) @@ -643,7 +643,7 @@ func _test_json() -> void: var ct: Dictionary = canon["tables"][0] _check(ct["kind"] == "choice" and ct["min"] == "2" and not ct.has("max"), "canonical keeps kind keys, numbers as text, drops defaults: %s" % str(ct)) _check(ct["entries"][0]["effects"] == "@a += 1" and ct["entries"][0]["pipes"] == [{"table": "y", "count": "@n"}, {"table": "z", "count": 3}], "canonical keeps effects and counts: %s" % str(ct["entries"][0])) - _eq(JsonIO.pipe_label(JsonIO.pipe_info({"table": "y", "count": "@n"})), "×@n", "pipe label for an expression count") + _eq(JsonIO.pipe_label(JsonIO.pipe_info({"table": "y", "count": "@n"})), "×@n", "thread label for an expression count") # ---------------------------------------------------------------- scenario diff --git a/tests/test_logic_ui.gd b/tests/test_logic_ui.gd index 4662d9b..8ee9143 100644 --- a/tests/test_logic_ui.gd +++ b/tests/test_logic_ui.gd @@ -85,9 +85,9 @@ func _var(name: String) -> Variant: func _test_demo_file() -> void: var text := FileAccess.get_file_as_string(DEMO) var r := IoMenu.parse_import(text, IoMenu.detect_format("logic_demo.json", text)) - _check(r["ok"] and (r["errors"] as Array).is_empty(), "the demo imports through Board ▾ → Import: %s" % str(r["errors"])) + _check(r["ok"] and (r["errors"] as Array).is_empty(), "the demo imports through Spread ▾ → Import: %s" % str(r["errors"])) var b := TowerBoard.new() - _check(b.load_json(text), "the demo loads as a board") + _check(b.load_json(text), "the demo loads as a spread") var kinds := {} for t in b.tables: kinds[t.kind + ("/" + t.choice if t.kind == "choice" else "")] = true @@ -110,7 +110,7 @@ func _test_cards() -> void: var loop := main.card_for("explore") _check(loop.rows.size() == 2 and loop.anchor_for("e1").size() > 0 and loop.anchor_for("e2").size() > 0, "a loop card has Each time and Afterwards rows with outlets") - _eq(TableCard.loop_rule(loop.table), "× @rooms", "the loop rule reads × @rooms") + _eq(TableCard.loop_rule(loop.table), "× @rooms", "the repeat rule reads × @rooms") var hp := main.card_for("v_hp") _check(hp.rows.is_empty() and hp.anchor_for("x").is_empty(), "a variable card has no outlets") var sheet := main.card_for("report") @@ -137,7 +137,7 @@ func _test_scripted() -> void: for s: Dictionary in main.current["all"]: if s.has("pass"): passes += 1 - _eq(passes, 3, "the number answer drives the loop") + _eq(passes, 3, "the number answer drives the repeat") var last: Dictionary = (main.current["all"] as Array).back() _eq(last.get("table_id"), "report", "the chain ends at the sheet") _check(main.tray._headline.visible and Formatter.strip_tags(main.tray._headline_text.text).begins_with("Brin the delver"), @@ -186,7 +186,7 @@ func _test_dialog_answers() -> void: _check(d != null and d.kind == "pick" and d._options.size() == 3, "then the pick pop-up with three options") if d == null: return - _check(main.is_entry_lit("explore", "e1") and main.is_entry_lit("explore", "e2"), "the loop's steps are lit before the pick") + _check(main.is_entry_lit("explore", "e1") and main.is_entry_lit("explore", "e2"), "the repeat's steps are lit before the pick") d.answer(-1) await process_frame _check(main.rolling.pending_choice() == null and main.current.get("done", false), "Random finishes the roll") @@ -311,7 +311,7 @@ func _test_live_edits() -> void: for c in main.tray._vars._list.get_children(): if c is HBoxContainer: rows += 1 - _check(rows >= 4, "the Variables tab lists every board variable, numbers included (%d rows)" % rows) + _check(rows >= 4, "the Variables tab lists every spread variable, numbers included (%d rows)" % rows) var dlg := main.tray._vars.confirm_reset_all() _check(dlg != null and dlg.is_inside_tree(), "Reset all asks first, in the app") dlg.close() @@ -331,7 +331,7 @@ func _test_settings_rules() -> void: c.entries[0].add_pipe("x") var r := TableSettingsDialog.apply_settings(c, {"name": "C", "choice": "number", "min": "1", "max": "@top", "prompt": "How many?", "save_as": "@n"}) _check(r["ok"] and c.choice == "number" and c.entries.size() == 1 and c.entries[0].text == "Answer", "pick → number keeps one Answer row") - _check(Array(c.entries[0].pipes) == ["x"] and c.entries[0].effects == "@a = 1", "…with the first option's pipes and effects") + _check(Array(c.entries[0].pipes) == ["x"] and c.entries[0].effects == "@a = 1", "…with the first option's threads and effects") _check(c.max_expr == "@top" and c.save_as == "@n", "min/max and save as applied") var bad := TableSettingsDialog.apply_settings(c, {"name": "C", "choice": "number", "min": "1 +", "max": "5"}) _check(not bad["ok"] and c.min_expr == "1", "a bad min is refused and nothing changes") @@ -349,11 +349,11 @@ func _test_settings_rules() -> void: var s := RollTable.create(RollTable.KIND_SHEET, "s", "S") TableSettingsDialog.apply_settings(s, {"template": "HP {@hp}"}) _eq(s.entries[0].text, "HP {@hp}", "sheet template applied") - _eq(PipePopover._count_error("@terms"), "", "pipe counts take expressions") - _check(PipePopover._count_error("@terms +") != "", "bad pipe counts are flagged") + _eq(PipePopover._count_error("@terms"), "", "thread counts take expressions") + _check(PipePopover._count_error("@terms +") != "", "bad thread counts are flagged") var e := TableEntry.new("e", "x") e.set_pipe_count("y", "@terms") - _eq(PipeLayer._pipe_tag(e, "y"), "×@terms", "expression counts show on the pipe") + _eq(PipeLayer._pipe_tag(e, "y"), "×@terms", "expression counts show on the thread") # Previews. var pv := RichText.preview("{@skill_*} and {= dm(@str)} and {= 1 +}", main.data) _check(pv.contains("{@skill_*}") and pv.contains("{= dm(@str)}"), "previews show {@x_*} and {= expr} readably") diff --git a/tests/test_model.gd b/tests/test_model.gd index 1c3ae50..ce99883 100644 --- a/tests/test_model.gd +++ b/tests/test_model.gd @@ -149,7 +149,7 @@ func _test_pipes() -> void: e.add_pipe("other") e.add_pipe("dst", 3, "foe") src.entries.append(e) - _check(e.pipes.size() == 2, "pipe targets stay unique") + _check(e.pipes.size() == 2, "thread targets stay unique") var dst := RollTable.new("dst", "Dst") dst.entries.append(_entry("d1", "Thing")) var other := RollTable.new("other", "Other") @@ -157,19 +157,19 @@ func _test_pipes() -> void: var b := _board([src, dst, other]) var n := Roller.roll(b, "src", _rng(1)) var kids: Array = n["children"] - _check(kids.size() == 4, "count 3 plus one plain pipe gives 4 children (got %d)" % kids.size()) + _check(kids.size() == 4, "count 3 plus one plain thread gives 4 children (got %d)" % kids.size()) var saved := 0 for c: Dictionary in kids: if c.get("save_as", "") == "foe": saved += 1 _check(saved == 3, "save_as is set on the 3 counted children") - _check(not (kids[3] as Dictionary).has("save_as"), "plain pipe has no save_as") + _check(not (kids[3] as Dictionary).has("save_as"), "plain thread has no save_as") _check(not n.has("save_as"), "root node has no save_as") _check(Roller.flatten(n, []).size() == 5, "flatten walks counted children") var lit_e := {} var lit_p := {} Roller.collect_lit(n, lit_e, lit_p) - _check(lit_p.has(Roller.pipe_key("src", "e1", "dst")), "counted pipe is lit") + _check(lit_p.has(Roller.pipe_key("src", "e1", "dst")), "counted thread is lit") e.remove_pipe("dst") _check(e.pipes == ["other"] and e.pipe_count.is_empty() and e.pipe_save.is_empty(), "remove_pipe clears options") @@ -177,7 +177,7 @@ func _test_pipes() -> void: e.set_pipe_count("other", 0) _check(e.count_for("other") == 1, "count below 1 clamps to 1") e.set_pipe_save("other", "@loot") - _check(e.to_dict()["pipes"] == [{"table": "other", "save_as": "@loot"}], "save-only pipe serializes as object") + _check(e.to_dict()["pipes"] == [{"table": "other", "save_as": "@loot"}], "save-only thread serializes as object") func _test_cards() -> void: @@ -263,7 +263,7 @@ func _test_cycles() -> void: var board := _board([a, bt]) _check(Roller.endless_cycles(board) == ["a", "b"], "two-table loop is endless") bt.entries.append(_entry("eb2", "exit")) - _check(Roller.endless_cycles(board).is_empty(), "an exit entry fixes the loop") + _check(Roller.endless_cycles(board).is_empty(), "an exit entry fixes the repeat") bt.entries[1].weight = 0 _check(Roller.endless_cycles(board).size() == 2, "a zero-weight exit does not count") bt.entries[1].weight = 1 @@ -271,9 +271,9 @@ func _test_cycles() -> void: var es := _entry("es", "again") es.add_pipe("s") self_t.entries.append(es) - _check(Roller.endless_cycles(_board([self_t])) == ["s"], "sole self-pipe is endless") + _check(Roller.endless_cycles(_board([self_t])) == ["s"], "sole self-thread is endless") self_t.entries.append(_entry("es2", "done")) - _check(Roller.endless_cycles(_board([self_t])).is_empty(), "self-pipe on some entries is fine") + _check(Roller.endless_cycles(_board([self_t])).is_empty(), "self-thread on some entries is fine") # An entry that pipes into a cycle and a fine table is still stuck. var ok := RollTable.new("ok", "Ok") ok.entries.append(_entry("k", "fine")) @@ -283,7 +283,7 @@ func _test_cycles() -> void: em.add_pipe("mix") mix.entries.append(em) _check(Roller.endless_cycles(_board([ok, mix])) == ["mix"], "entry needing a cycle blocks its table") - _check(Roller.endless_cycles(SampleBoard.create()).is_empty(), "sample board has no endless cycles") + _check(Roller.endless_cycles(SampleBoard.create()).is_empty(), "sample spread has no endless cycles") func _test_seed() -> void: @@ -313,17 +313,17 @@ func _test_json() -> void: {"id": "e1", "text": "Low", "range": [1, 10], "pipes": ["x", {"table": "y", "count": 2, "save_as": "@pal"}]}, {"id": "e2", "text": "High", "range": [11, 20], "weight": 4, "details": "[b]hi[/b]"}]}]} var b := TowerBoard.new() - _check(b.load_json(JSON.stringify(legacy)), "legacy board loads") + _check(b.load_json(JSON.stringify(legacy)), "legacy spread loads") var t := b.get_table("old") _check(t.dice == "1d20" and t.die_size() == 20 and t.dice_label() == "d20", "legacy die 20 becomes 1d20") var e := t.entries[0] - _check(e.pipes == ["x", "y"] and e.count_for("y") == 2 and e.save_for("y") == "@pal" and e.count_for("x") == 1, "mixed string/object pipes load") + _check(e.pipes == ["x", "y"] and e.count_for("y") == 2 and e.save_for("y") == "@pal" and e.count_for("x") == 1, "mixed string/object threads load") _check(t.entries[1].weight == 4 and t.entries[1].details == "[b]hi[/b]", "weight and entry details load") var d := t.to_dict() _check(not d.has("die") and d["dice"] == "1d20", "die is no longer written") var ed: Dictionary = d["entries"][0] - _check(ed["pipes"] == ["x", {"table": "y", "count": 2, "save_as": "@pal"}], "pipes save in contract form") - _check(not (d["entries"][1] as Dictionary).has("pipes"), "empty pipes omitted") + _check(ed["pipes"] == ["x", {"table": "y", "count": 2, "save_as": "@pal"}], "threads save in contract form") + _check(not (d["entries"][1] as Dictionary).has("pipes"), "empty threads omitted") var plain := RollTable.new("p", "P") plain.entries.append(_entry("e", "x")) @@ -338,12 +338,12 @@ func _test_json() -> void: plain.card_mode = true plain.deck_empty = "stop" var back := RollTable.from_dict(JSON.parse_string(JSON.stringify(plain.to_dict()))) - _check(back.details == "Hello" and back.tags == ["a", "b"] and back.card_mode and back.deck_empty == "stop", "details, tags, card mode round-trip") + _check(back.details == "Hello" and back.tags == ["a", "b"] and back.card_mode and back.deck_empty == "stop", "details, tags, deck mode round-trip") _check(back.to_dict() == plain.to_dict(), "table dict round-trips") var sample := SampleBoard.create() var copy := TowerBoard.new() - _check(copy.load_json(sample.to_json()) and copy.to_json() == sample.to_json(), "sample board JSON round-trips") + _check(copy.load_json(sample.to_json()) and copy.to_json() == sample.to_json(), "sample spread JSON round-trips") func _test_sample() -> void: @@ -357,7 +357,7 @@ func _test_sample() -> void: _check(not eids.has(e.id), "unique entry ids in %s" % t.id) eids[e.id] = true for p in e.pipes: - _check(s.get_table(p) != null, "pipe target %s exists" % p) + _check(s.get_table(p) != null, "thread target %s exists" % p) var loot := s.get_table("loot") _check(loot.entries[0].weight == 3 and absf(loot.chance(loot.entries[0]) - 3.0 / 8.0) < 1e-9, "gold weight 3 of 8") var roles := s.get_table("party_roles") diff --git a/tests/test_navigation.gd b/tests/test_navigation.gd index 0fd44e5..4fa65d2 100644 --- a/tests/test_navigation.gd +++ b/tests/test_navigation.gd @@ -104,9 +104,9 @@ func _test_lazy_cards() -> void: var paths: Dictionary = main.board.pipes._paths var gn := main.group_node("careers") var into: PackedVector2Array = paths.get("start:e1>agent", PackedVector2Array()) - _check(not into.is_empty() and into[into.size() - 1].distance_to(gn.inlet_point()) < 0.5, "a pipe into a hidden member still routes to its group") + _check(not into.is_empty() and into[into.size() - 1].distance_to(gn.inlet_point()) < 0.5, "a thread into a hidden member still routes to its group") var out: PackedVector2Array = paths.get("skill:e1>gems", PackedVector2Array()) - _check(out.is_empty(), "pipes inside one collapsed group aren't drawn") + _check(out.is_empty(), "threads inside one collapsed group aren't drawn") main.toggle_group("careers") await process_frame _check(main.card_for("agent") != null and main.card_for("army") != null, "expanding the group builds its cards") @@ -122,10 +122,10 @@ func _test_lazy_cards() -> void: var rev := main.board.geometry_rev for i in 5: await process_frame - _check(main.board.geometry_rev == rev, "nothing redraws while the board is idle") + _check(main.board.geometry_rev == rev, "nothing redraws while the spread is idle") main.board.world.position += Vector2(30, 10) await process_frame - _check(main.board.geometry_rev == rev, "panning doesn't redraw the pipe, port or card layers") + _check(main.board.geometry_rev == rev, "panning doesn't redraw the thread, port or card layers") func _test_search() -> void: @@ -244,7 +244,7 @@ func _test_minimap() -> void: main.top_bar.view_menu.sync() var view_pm := main.top_bar.view_menu.get_popup() _check(mm.visible and view_pm.is_item_checked(view_pm.get_item_index(ViewMenu.ID_MINIMAP)), "the minimap shows, and View ▾ has it checked") - _check(mm.position.x + mm.size.x <= main.board.size.x and mm.position.y + mm.size.y <= main.board.size.y, "in the board's bottom-right corner") + _check(mm.position.x + mm.size.x <= main.board.size.x and mm.position.y + mm.size.y <= main.board.size.y, "in the spread's bottom-right corner") mm.set_world(Rect2(-100, -100, 4000, 2000)) var p := Vector2(1234, 567) _check(mm.map_to_world(mm.world_to_map(p)).distance_to(p) < 0.01, "map and world coordinates round-trip") @@ -252,7 +252,7 @@ func _test_minimap() -> void: main.board.center_on(Vector2(1900, 900)) var v := main.board.view_rect() var vm := mm.view_rect_on_map() - _check(vm.position.distance_to(mm.world_to_map(v.position)) < 0.01 and absf(vm.size.x - v.size.x * mm._scale) < 0.01, "the view rect is the board's view, scaled") + _check(vm.position.distance_to(mm.world_to_map(v.position)) < 0.01 and absf(vm.size.x - v.size.x * mm._scale) < 0.01, "the view rect is the spread's view, scaled") var target := mm.world_to_map(Vector2(500, 300)) mm.pan_to_map_point(target) _check(main.board.view_rect().get_center().distance_to(Vector2(500, 300)) < 1.0, "clicking the map pans there") @@ -294,7 +294,7 @@ func _test_pack() -> void: "reading order holds along the top row") _check(after["end"].position.y > after["start"].position.y and after["pick"].position.x > after["end"].position.x, "and in the row below") var bounds1 := main.board.content_bounds() - _check(bounds1.size.x < bounds0.size.x * 0.5 and bounds1.size.y < bounds0.size.y, "the board gets much smaller: %s -> %s" % [str(bounds0.size), str(bounds1.size)]) + _check(bounds1.size.x < bounds0.size.x * 0.5 and bounds1.size.y < bounds0.size.y, "the spread gets much smaller: %s -> %s" % [str(bounds0.size), str(bounds1.size)]) var agent := main.data.get_table("agent") _check(agent.position - main.data.get_group("careers").position == Vector2(22, 68), "members move with their group") _check(main.top_bar._toast.visible and main.top_bar._toast_undo.visible, "with an undo toast") @@ -320,7 +320,7 @@ func _test_zoom_range() -> void: main.board.set_zoom(0.01) _check(is_equal_approx(main.board.zoom, BoardView.MIN_ZOOM) and BoardView.MIN_ZOOM <= 0.1, "zoom goes down to about 0.1") main.board.fit() - _check(main.board.zoom < 0.35, "Fit can zoom below the old minimum for a wide board: %.2f" % main.board.zoom) + _check(main.board.zoom < 0.35, "Fit can zoom below the old minimum for a wide spread: %.2f" % main.board.zoom) ## Rects of the blocks Pack works on: groups (compact or frame) and loose cards. diff --git a/tests/test_options.gd b/tests/test_options.gd index ff157ca..e0e00c7 100644 --- a/tests/test_options.gd +++ b/tests/test_options.gd @@ -344,7 +344,7 @@ func _test_json() -> void: _check(not plain.has("options_from") and not plain.has("options_where"), "a fixed pick card has no options keys") var col := {"format_version": 2, "id": "c", "name": "C", "tables": [d]} var res := JsonIO.import_json(JsonIO.export_json(col)) - _check(res["ok"], "the collection imports") + _check(res["ok"], "the spread imports") var td: Dictionary = (res["collection"]["tables"] as Array)[0] _check(str(td.get("options_from", "")) == "@skill_*" and str(td.get("options_where", "")) == "option_value >= 1" \ and str((td["entries"][1] as Dictionary).get("show_if", "")) == "@terms > 2", "export and import keep them") @@ -433,7 +433,7 @@ func _test_tester() -> void: spend.entries.append(TableEntry.new("keep", "Keep it all")) var b := _board([start, spend]) var report: Dictionary = await BoardTester.simulate(b, "start", {"runs": 100, "seed": 4}) - _check(BoardTester.is_clean(report), "the simulator runs a dynamic board cleanly") + _check(BoardTester.is_clean(report), "the simulator runs a dynamic spread cleanly") _check(not (report["unchosen"] as Dictionary).has("spend"), "both the Chosen entry and the fixed extra get chosen") @@ -471,7 +471,7 @@ func _test_dialog() -> void: pp.free() d.plain = false var p := d.preview_for_option(1) - _check(p != null and _has(p, "@[option] += 1") and _has(p, "Next step"), "a dynamic option's preview shows the Chosen entry's effects and pipes") + _check(p != null and _has(p, "@[option] += 1") and _has(p, "Next step"), "a dynamic option's preview shows the Chosen entry's effects and threads") _check(_has(p, "skill_gun_combat"), "the preview names the variable behind the option") p.free() # Key 3 answers the third option (Pilot). diff --git a/tests/test_plain_display.gd b/tests/test_plain_display.gd index 6bd72d5..35319c2 100644 --- a/tests/test_plain_display.gd +++ b/tests/test_plain_display.gd @@ -184,7 +184,7 @@ func _test_why_sentences() -> void: _eq(Describe.why(other, b), "Took Learn from it because no condition was true", "otherwise fact") _eq(Describe.why(case_f, b), "Case 1 didn't match because Strength was 9 (needs 10 or more)", "case fact") _eq(Describe.why(eff, b), "Luck went from 2 to 1", "effect fact") - _eq(Describe.why(inp, b), "Tier was 3 (from the pipe)", "input fact") + _eq(Describe.why(inp, b), "Tier was 3 (from the thread)", "input fact") _check(Describe.why(when_f, b, false).contains("@luck >= 2"), "text mode keeps the rule as written") # A step's reasons: the parent's pipe choices aimed at it, the parent's # effects on the values they read, then its own facts. @@ -241,35 +241,35 @@ func _test_switch() -> void: await process_frame var beyond := main.card_for("beyond") _check(_chips(beyond).has("@luck -= 1"), "Text view: the chip shows the stored statement") - _check(_has(main.card_for("rounds"), "while @luck > 0"), "Text view: the loop rule as written") + _check(_has(main.card_for("rounds"), "while @luck > 0"), "Text view: the repeat rule as written") _check(_has(main.card_for("learn"), "Options from @skill_* · where option_value >= 1"), "Text view: the options source as written") _check(_has(main.card_for("loot"), "input tier · default 1"), "Text view: inputs by name") main.board.pipes._process(0.0) - _check(main.board.pipes._drawn_state.back() == false, "the pipe layer redraws for the Text view") + _check(main.board.pipes._drawn_state.back() == false, "the thread layer redraws for the Text view") _set_plain(true) await process_frame _check(_chips(main.card_for("beyond")).has("Luck −1"), "switching back refreshes the chips") main.board.pipes._process(0.0) - _check(main.board.pipes._drawn_state.back() == true, "and the pipes") + _check(main.board.pipes._drawn_state.back() == true, "and the threads") func _test_pipe_labels() -> void: var b := main.data var vault := b.get_table("beyond").entries[1] - _eq(RulesView.pipe_label(vault, "loot", b, true), "Tier 3 · only if Luck is 2 or more", "plain pipe label") + _eq(RulesView.pipe_label(vault, "loot", b, true), "Tier 3 · only if Luck is 2 or more", "plain thread label") _eq(RulesView.pipe_label(vault, "learn", b, true), "otherwise", "otherwise label") - _eq(RulesView.pipe_label(vault, "loot", b, false), "tier=3 if @luck >= 2", "text pipe label") - _eq(RulesView.pipe_label(b.get_table("gate").entries[0], "beyond", b, true), "", "a plain pipe has no label") + _eq(RulesView.pipe_label(vault, "loot", b, false), "tier=3 if @luck >= 2", "text thread label") + _eq(RulesView.pipe_label(b.get_table("gate").entries[0], "beyond", b, true), "", "a plain thread has no label") func _test_router_and_choice() -> void: var climb := main.card_for("climb") - _check(_has(climb, "if Strength is 10 or more"), "a router case reads in words") + _check(_has(climb, "if Strength is 10 or more"), "a branch case reads in words") _check(_has(climb, "Otherwise"), "the last case reads Otherwise") var learn := main.card_for("learn") _check(_has(learn, "Options: your Skills, level 1 or more"), "a choice's options source reads in words") _check(_has(learn, "only if Luck is at most 1"), "show_if reads only if …") - _check(_chips(learn).has("Chosen skill +1"), "the Chosen row's effect names the collection's member") + _check(_chips(learn).has("Chosen skill +1"), "the Chosen row's effect names the spread's member") func _test_check_card() -> void: @@ -280,7 +280,7 @@ func _test_check_card() -> void: _check(_has(gate, "8+") and _has(gate, "≤7"), "outlet ranges") await process_frame for eid in ["ok", "no"]: - _check(not gate.anchor_for(eid).is_empty(), "the %s outlet has a pipe anchor" % eid) + _check(not gate.anchor_for(eid).is_empty(), "the %s outlet has a thread anchor" % eid) var ok_y: float = gate.anchor_for("ok").get("pos", Vector2.ZERO).y var no_y: float = gate.anchor_for("no").get("pos", Vector2.ZERO).y _check(no_y > ok_y, "Failure sits below Success") @@ -297,7 +297,7 @@ func _test_collection_and_inputs() -> void: names.append(str(m.get_meta("member"))) _eq(names, ["@skill_athletics", "@skill_mechanic", "@skill_recon"], "members: set ones by label, then ones the rules name") _check(_has(skills, "Mechanic") and _has(skills, "2") and _has(skills, "—"), "members show live values") - _check(_has(skills, "Collection · kept between rolls"), "the collection's kind line") + _check(_has(skills, "Collection · kept between rolls"), "the spread's kind line") main.persistent_vars["skill_mechanic"] = {"value": 3, "source": ""} main.refresh_live() _check(_has(skills, "3"), "values refresh live") @@ -382,7 +382,7 @@ func _test_build_rows() -> void: _check(not _has(beyond, "ƒ") and not _has(beyond, "Details"), "the inline effects / details editors are gone") _check(_with_meta(beyond, "effects_chip").size() == 1, "one chip for the one entry with effects") var climb := main.card_for("climb") - _check(not _with_meta(climb, "case_line").is_empty() and _has(climb, "if Strength is 10 or more"), "a Build router case shows its condition in words") + _check(not _with_meta(climb, "case_line").is_empty() and _has(climb, "if Strength is 10 or more"), "a Build branch case shows its condition in words") var row: Control = beyond.rows["e2"] var ev := InputEventMouseButton.new() ev.button_index = MOUSE_BUTTON_LEFT @@ -399,7 +399,7 @@ func _test_build_rows() -> void: gate.set_selected_entry("no") _eq(gate.selected_entry(), "no", "the inspector can set the selection directly") var adds := _with_meta(main.card_for("skills"), "collection_add") - _check(adds.size() == 1 and (adds[0] as Button).text == "+ Add skill", "the collection card has + Add skill in Build") + _check(adds.size() == 1 and (adds[0] as Button).text == "+ Add skill", "the spread card has + Add skill in Build") if adds.size() == 1: (adds[0] as Button).emit_signal("pressed") _eq(main.get("picked").back(), ["card", "skills"], "+ Add selects the card for the inspector") diff --git a/tests/test_roller.gd b/tests/test_roller.gd index 72b8195..97792bf 100644 --- a/tests/test_roller.gd +++ b/tests/test_roller.gd @@ -25,7 +25,7 @@ func _init() -> void: _check(wild.range_problems() == "", "wilderness ranges have no gaps or overlaps") _check(wild.num_label(wild.entries[5], 5) == "96–00", "last range reads 96–00") for e in wild.entries: - _check(e.pipes.size() == 1, "range %s has exactly one pipe" % e.text) + _check(e.pipes.size() == 1, "range %s has exactly one thread" % e.text) # Range weighting: 01–30 should come up about 30% of the time. var counts := {} @@ -69,19 +69,19 @@ func _init() -> void: _check(stops > 50 and stops < 150, "rolls into a gap stop with a message (%d/200)" % stops) # A self-pipe stops at the action limit (docs/LOGIC.md §7) instead of looping forever. - var loop := RollTable.new("loop", "Loop") + var loop := RollTable.new("loop", "Repeat") var again := TableEntry.new("e1", "Again") again.pipes.append("loop") loop.entries.append(again) var b3 := TowerBoard.new() b3.tables.append(loop) var steps := Roller.flatten(Roller.roll(b3, "loop", rng), []) - _check(steps.size() == Roller.MAX_ACTIONS + 1 and str(steps[steps.size() - 1]["text"]) == Roller.limit_text(), "self-pipe stops at the action limit (%d steps)" % steps.size()) + _check(steps.size() == Roller.MAX_ACTIONS + 1 and str(steps[steps.size() - 1]["text"]) == Roller.limit_text(), "self-thread stops at the action limit (%d steps)" % steps.size()) # JSON round trip keeps everything. var copy := TowerBoard.new() - _check(copy.load_json(board.to_json()), "board JSON loads back") - _check(copy.to_json() == board.to_json(), "board JSON round-trips unchanged") + _check(copy.load_json(board.to_json()), "spread JSON loads back") + _check(copy.to_json() == board.to_json(), "spread JSON round-trips unchanged") _check(copy.get_table("trinkets").collapsed, "collapsed state is saved") # Removing a table removes pipes into it. @@ -91,7 +91,7 @@ func _init() -> void: for e in t.entries: if e.pipes.has("loot"): dangling = true - _check(not dangling and copy.get_table("loot") == null, "removing a table removes pipes into it") + _check(not dangling and copy.get_table("loot") == null, "removing a table removes threads into it") print("%s: %d failure(s)" % ["PASS" if _failures == 0 else "FAIL", _failures]) quit(1 if _failures else 0) diff --git a/tests/test_router.gd b/tests/test_router.gd index 53fe3af..640afdc 100644 --- a/tests/test_router.gd +++ b/tests/test_router.gd @@ -93,13 +93,13 @@ func _branch_board(str_value: int) -> TowerBoard: func _test_when_otherwise() -> void: - _eq(_ids(_roll(_branch_board(10), "start")), ["start", "strong", "after"], "a true condition runs its pipe; otherwise is skipped") + _eq(_ids(_roll(_branch_board(10), "start")), ["start", "strong", "after"], "a true condition runs its thread; otherwise is skipped") _eq(_ids(_roll(_branch_board(2), "start")), ["start", "weak", "after"], "the second condition can be the true one") - _eq(_ids(_roll(_branch_board(6), "start")), ["start", "plain", "after"], "no condition true: the otherwise pipe runs") + _eq(_ids(_roll(_branch_board(6), "start")), ["start", "plain", "after"], "no condition true: the otherwise thread runs") # Two true conditions both run (pipes aren't else-if; use a router for that). var b := _branch_board(10) b.get_table("start").entries[0].set_pipe_when("weak", "@str > 1") - _eq(_ids(_roll(b, "start")), ["start", "strong", "weak", "after"], "every true condition runs, in pipe order") + _eq(_ids(_roll(b, "start")), ["start", "strong", "weak", "after"], "every true condition runs, in thread order") # A condition clears otherwise, and otherwise can't be set while there's a condition. var e := TableEntry.new("e1", "x") e.add_pipe("y") @@ -115,8 +115,8 @@ func _test_when_otherwise() -> void: var lit_e := {} var lit_p := {} Roller.collect_lit(_roll(_branch_board(10), "start"), lit_e, lit_p) - _check(lit_p.has(Roller.pipe_key("start", "e1", "strong")) and lit_p.has(Roller.pipe_key("start", "e1", "after")), "taken pipes light") - _check(not lit_p.has(Roller.pipe_key("start", "e1", "weak")) and not lit_p.has(Roller.pipe_key("start", "e1", "plain")), "skipped pipes stay dark") + _check(lit_p.has(Roller.pipe_key("start", "e1", "strong")) and lit_p.has(Roller.pipe_key("start", "e1", "after")), "taken threads light") + _check(not lit_p.has(Roller.pipe_key("start", "e1", "weak")) and not lit_p.has(Roller.pipe_key("start", "e1", "plain")), "skipped threads stay dark") # ---------------------------------------------------------------- snapshot @@ -139,7 +139,7 @@ func _test_snapshot() -> void: var vars := {} var ids := _ids(_roll(b, "start", vars)) _eq(ids, ["start", "first", "second", "third"], "conditions and counts come from the snapshot, not the changed variables") - _eq(_var(vars, "x"), 1, "the first pipe's subtree did change @x") + _eq(_var(vars, "x"), 1, "the first thread's subtree did change @x") # An otherwise pipe doesn't fire because a when pipe's subtree made the # conditions false afterwards. _check(not ids.has("fallback"), "otherwise reads the snapshot too") @@ -149,7 +149,7 @@ func _test_snapshot() -> void: link.entries[0].add_pipe("link") link.entries[0].set_pipe_when("link", "@k < 5") var v2 := {} - _eq(_ids(_roll(_board([link]), "link", v2)).size(), 5, "a conditional self-pipe stops when its condition turns false") + _eq(_ids(_roll(_board([link]), "link", v2)).size(), 5, "a conditional self-thread stops when its condition turns false") _eq(_var(v2, "k"), 5, "it ran five times") @@ -165,7 +165,7 @@ func _test_errors() -> void: var tree := _roll(_board([start, _one("bad", "Bad"), _one("other", "Other")]), "start") _eq(_ids(tree), ["start", "other"], "a condition that errors counts as false (so otherwise runs)") var errs := _errors(tree) - _check(errs.size() == 1 and str(errs[0]).begins_with("Pipe condition @x + * 2"), "the error shows as an error line on the node: %s" % str(errs)) + _check(errs.size() == 1 and str(errs[0]).begins_with("Thread condition @x + * 2"), "the error shows as an error line on the node: %s" % str(errs)) var step: Dictionary = Roller.flatten(tree)[0] _check((step.get("effects", []) as Array).size() == 1, "the error line is in the step's effects") @@ -186,9 +186,9 @@ func _router_board() -> TowerBoard: func _test_router() -> void: - var t := RollTable.create(RollTable.KIND_ROUTER, "r", "Router") - _eq(t.kind, "router", "create makes a router") - _eq(t.entries.size(), 2, "a new router has two cases") + var t := RollTable.create(RollTable.KIND_ROUTER, "r", "Branch") + _eq(t.kind, "router", "create makes a branch") + _eq(t.entries.size(), 2, "a new branch has two cases") _eq(t.entries[0].text, "if …", "its first case") _check(t.entries[0].when != "" and Expr.check(t.entries[0].when) == "", "the first case has a valid condition") _check(t.entries[1].text == "Otherwise" and t.entries[1].when == "", "the second is Otherwise") @@ -197,7 +197,7 @@ func _test_router() -> void: var vars := {"species": {"value": "Aslan", "source": ""}, "str": {"value": 10, "source": ""}} var tree := _roll(b, "route", vars) _eq(_ids(tree), ["route", "aslan"], "the first true case wins, even when a later one is true too") - _eq(str(tree.get("kind", "")), "router", "the node's kind is router") + _eq(str(tree.get("kind", "")), "router", "the node's kind is branch") _eq(tree.get("case"), 0, "the node's case index") _eq(_var(vars, "took"), "aslan", "the case's effects ran") _eq(Formatter.strip_tags(str(tree["summary"])), "Aslan path", "the case's text is the summary") @@ -209,13 +209,13 @@ func _test_router() -> void: # One action per router. var ctx := Roller.new_context(b, _rng(), {}) Roller.roll(b, "route", ctx.rng, 0, {}, ctx) - _eq(ctx.actions, 2, "a router is one action (plus the table it pipes to)") + _eq(ctx.actions, 2, "a branch is one action (plus the table it threads to)") # A case condition with an error counts as false and is reported. b.get_table("route").entries[0].when = "@species = = 3 +" var t3 := _roll(b, "route", {}) _eq(_ids(t3), ["route", "plain"], "an erroring case is skipped") var errs := _errors(t3) - _check(errs.size() == 1 and str(errs[0]).begins_with("Case "), "the case error is on the router node: %s" % str(errs)) + _check(errs.size() == 1 and str(errs[0]).begins_with("Case "), "the case error is on the branch node: %s" % str(errs)) # Lighting: the matched case is lit. var le := {} var lp := {} @@ -229,13 +229,13 @@ func _test_no_case() -> void: r.entries.remove_at(2) # no Otherwise var tree := _roll(b, "route", {}) _check(tree.has("stop") and str(tree["summary"]) == Roller.NO_CASE, "nothing matched: the node stops with \"No case matched\"") - _eq(str(tree.get("kind", "")), "router", "the stop node is a router node") + _eq(str(tree.get("kind", "")), "router", "the stop node is a branch node") _eq(_ids(tree), ["route"], "nothing follows") var step: Dictionary = Roller.flatten(tree)[0] _check(step.get("stop", false) and str(step["text"]) == "No case matched", "the step shows it") # A router with no cases at all. r.entries.clear() - _check(_roll(b, "route", {}).has("stop"), "an empty router stops") + _check(_roll(b, "route", {}).has("stop"), "an empty branch stops") # ---------------------------------------------------------------- file format @@ -253,9 +253,9 @@ func _test_json() -> void: _eq(str(ed.get("when", "")), "@str >= 8", "an entry's when is written") _check(not (d["entries"][2] as Dictionary).has("when"), "the Otherwise case has no when") var pipes: Array = ed["pipes"] - _eq(pipes[1], {"table": "aslan", "count": 2, "save_as": "who", "when": "@str > 9"}, "a pipe's when is written with its other options") - _eq(pipes[2], {"table": "plain", "otherwise": true}, "an otherwise pipe") - _eq(pipes[0], "strong", "a plain pipe stays a bare id") + _eq(pipes[1], {"table": "aslan", "count": 2, "save_as": "who", "when": "@str > 9"}, "a thread's when is written with its other options") + _eq(pipes[2], {"table": "plain", "otherwise": true}, "an otherwise thread") + _eq(pipes[0], "strong", "a plain thread stays a bare id") var back := RollTable.from_dict(d) var be := back.entries[1] _check(back.kind == "router" and be.when == "@str >= 8" and be.when_for("aslan") == "@str > 9" and be.is_otherwise("plain") and be.count_for("aslan") == 2 and be.save_for("aslan") == "who", "the table round-trips") @@ -266,10 +266,10 @@ func _test_json() -> void: {"id": "b", "text": "B", "when": ""}]}]} var c := JsonIO.canonical(raw) var ce: Dictionary = c["tables"][0]["entries"][0] - _eq(str(c["tables"][0].get("kind", "")), "router", "canonical keeps kind router") + _eq(str(c["tables"][0].get("kind", "")), "router", "canonical keeps kind branch") _eq(str(ce.get("when", "")), "@a = 1", "canonical keeps (trimmed) entry when") _check(not (c["tables"][0]["entries"][1] as Dictionary).has("when"), "canonical drops an empty when") - _eq(ce["pipes"], [{"table": "y", "when": "@b"}, {"table": "z", "otherwise": true}, {"table": "w"}, {"table": "v"}], "canonical pipe conditions") + _eq(ce["pipes"], [{"table": "y", "when": "@b"}, {"table": "z", "otherwise": true}, {"table": "w"}, {"table": "v"}], "canonical thread conditions") var text := JsonIO.export_json(b.to_dict()) var imp := JsonIO.import_json(text) _check(imp["ok"], "the export imports") @@ -277,14 +277,14 @@ func _test_json() -> void: b2.load_dict(imp["collection"]) var e2 := b2.get_table("route").entries[1] _check(e2.when == "@str >= 8" and e2.when_for("aslan") == "@str > 9" and e2.is_otherwise("plain"), "a JSON export round-trips conditions") - _eq(JsonIO.pipe_label(JsonIO.pipe_info({"table": "y", "when": "@str >= 8", "count": 2, "save_as": "w"})), "if @str >= 8 ×2 → w", "edge label for a conditional pipe") - _eq(JsonIO.pipe_label(JsonIO.pipe_info({"table": "y", "otherwise": true})), "otherwise", "edge label for an otherwise pipe") + _eq(JsonIO.pipe_label(JsonIO.pipe_info({"table": "y", "when": "@str >= 8", "count": 2, "save_as": "w"})), "if @str >= 8 ×2 → w", "edge label for a conditional thread") + _eq(JsonIO.pipe_label(JsonIO.pipe_info({"table": "y", "otherwise": true})), "otherwise", "edge label for an otherwise thread") # ---------------------------------------------------------------- lint func _test_lint() -> void: - _eq(Roller.lint_pipes(_router_board()), [] as Array[Dictionary], "a clean board has no lint") + _eq(Roller.lint_pipes(_router_board()), [] as Array[Dictionary], "a clean spread has no lint") var b := _router_board() var r := b.get_table("route") # Otherwise first: the cases after it can't be chosen. @@ -311,9 +311,9 @@ func _test_lint() -> void: msgs["%s:%s" % [item["table_id"], item["entry_id"]]] = str(msgs.get("%s:%s" % [item["table_id"], item["entry_id"]], "")) + str(item["message"]) + "|" _check(str(msgs.get("route:c3", "")).contains("Otherwise case isn't last"), "Otherwise case not last: %s" % str(lint)) _check(str(msgs.get("route:c1", "")).begins_with("Case @str >= = 8"), "a bad case condition: %s" % str(lint)) - _check(str(msgs.get("start:e1", "")).contains("Pipe condition (((") and str(msgs.get("start:e1", "")).contains("comes before a conditional pipe"), "a bad pipe condition, and otherwise before when: %s" % str(lint)) - _check(str(msgs.get("lonely:e1", "")).contains("always runs"), "otherwise with no conditional pipe: %s" % str(lint)) - _check(str(msgs.get("empty:", "")).contains("no cases"), "a router with no cases: %s" % str(lint)) + _check(str(msgs.get("start:e1", "")).contains("Thread condition (((") and str(msgs.get("start:e1", "")).contains("comes before a conditional thread"), "a bad thread condition, and otherwise before when: %s" % str(lint)) + _check(str(msgs.get("lonely:e1", "")).contains("always runs"), "otherwise with no conditional thread: %s" % str(lint)) + _check(str(msgs.get("empty:", "")).contains("no cases"), "a branch with no cases: %s" % str(lint)) _eq(lint.size(), 6, "six lint items") @@ -322,12 +322,12 @@ func _test_cycles() -> void: var link := _one("link", "Link", "@k += 1") link.entries[0].add_pipe("link") link.entries[0].set_pipe_when("link", "@k < 3") - _eq(Roller.endless_cycles(_board([link])), [] as Array[String], "a conditional self-pipe is not an endless cycle") + _eq(Roller.endless_cycles(_board([link])), [] as Array[String], "a conditional self-thread is not an endless cycle") var r := RollTable.create(RollTable.KIND_ROUTER, "r", "R") r.entries[0].add_pipe("r") - _eq(Roller.endless_cycles(_board([r])), [] as Array[String], "a router with a case that finishes is fine") + _eq(Roller.endless_cycles(_board([r])), [] as Array[String], "a branch with a case that finishes is fine") r.entries[1].add_pipe("r") - _eq(Roller.endless_cycles(_board([r])), ["r"] as Array[String], "a router whose every case loops back is endless") + _eq(Roller.endless_cycles(_board([r])), ["r"] as Array[String], "a branch whose every case loops back is endless") # ---------------------------------------------------------------- mini board @@ -390,9 +390,9 @@ func _test_mini_board() -> void: _eq(_var(vars, "path"), "aslan" if pick == 0 else "human", "%s: @path" % label) _check(_errors(tree).is_empty(), "%s: no errors" % label) if use_router: - _check(ids.has("route") and ids.has("sheet"), "%s: through the router to the sheet" % label) + _check(ids.has("route") and ids.has("sheet"), "%s: through the branch to the sheet" % label) # The router version lints clean and has no cycles. - _eq(Roller.lint_pipes(_species_board(true)), [] as Array[Dictionary], "the router board lints clean") + _eq(Roller.lint_pipes(_species_board(true)), [] as Array[Dictionary], "the branch spread lints clean") # ---------------------------------------------------------------- UI helpers @@ -407,9 +407,9 @@ func _test_ui_helpers() -> void: var bad := TableSettingsDialog.apply_settings(r, {"name": "R", "cases": ["@a = = 1", ""]}) _check(not bad["ok"] and str(bad["error"]).begins_with("Case 1"), "settings refuse a bad case: %s" % str(bad)) var ok := TableSettingsDialog.apply_settings(r, {"name": "R", "cases": ["@a = 1", ""], "card_mode": true, "ranged": true}) - _check(ok["ok"] and r.entries[0].when == "@a = 1" and not r.card_mode and not r.is_ranged(), "settings set case conditions; no card mode or ranges: %s" % str(ok)) - _check(TableSettingsRules.router_hint(["", "@a"]) != "" and TableSettingsRules.router_hint(["@a", ""]) == "", "router order hint") - _eq(TablePreview.kind_line(r), "Router · if / else if / otherwise", "preview kind line") + _check(ok["ok"] and r.entries[0].when == "@a = 1" and not r.card_mode and not r.is_ranged(), "settings set case conditions; no deck mode or ranges: %s" % str(ok)) + _check(TableSettingsRules.router_hint(["", "@a"]) != "" and TableSettingsRules.router_hint(["@a", ""]) == "", "branch order hint") + _eq(TablePreview.kind_line(r), "Branch · if / else if / otherwise", "preview kind line") # ---------------------------------------------------------------- checks diff --git a/tests/test_shell.gd b/tests/test_shell.gd index 3301e26..2fc6397 100644 --- a/tests/test_shell.gd +++ b/tests/test_shell.gd @@ -34,8 +34,8 @@ func _test_settings() -> void: _check(r["ok"], "plain settings apply") _check(t.name == "Gems" and t.details == "[b]x[/b]", "name trimmed, details kept") _check(t.tags == ["a", "b"], "tags split and de-duplicated") - _check(t.card_mode and t.deck_empty == "stop", "card mode and deck_empty set") - _check(r["deck_reset"], "card mode change resets the deck") + _check(t.card_mode and t.deck_empty == "stop", "deck mode and deck_empty set") + _check(r["deck_reset"], "deck mode change resets the deck") var bad := TableSettingsDialog.apply_settings(t, {"ranged": true, "dice": "banana", "name": "Changed"}) _check(not bad["ok"] and t.name == "Gems" and not t.is_ranged(), "invalid dice changes nothing") @@ -79,7 +79,7 @@ func _test_ranges() -> void: z.entries[1].weight = 0 z.entries[0].pipes = ["a", "b"] as Array[String] TableSettingsRules.assign_ranges(z) - _check(not z.entries[1].has_range and z.entries[0].pipes.size() == 1, "weight 0 skipped, extra pipe dropped") + _check(not z.entries[1].has_range and z.entries[0].pipes.size() == 1, "weight 0 skipped, extra thread dropped") _check(z.entries[2].range_hi == 100, "last live entry reaches the top") @@ -96,10 +96,10 @@ func _test_collections() -> void: var a := CollectionSwitcher.create_collection(lib, null, "Alpha") a.tables.append(_plain_table()) var b := CollectionSwitcher.create_collection(lib, a, "Beta") - _check(lib.list().size() == 2, "two collections after create") - _check(lib.load_collection(a.id).tables.size() == 1, "creating saves the current collection first") + _check(lib.list().size() == 2, "two spreads after create") + _check(lib.load_collection(a.id).tables.size() == 1, "creating saves the current spread first") var back := CollectionSwitcher.switch_collection(lib, b, a.id) - _check(back != null and back.id == a.id and back.tables.size() == 1, "switch loads the other collection") + _check(back != null and back.id == a.id and back.tables.size() == 1, "switch loads the other spread") _check(CollectionSwitcher.switch_collection(lib, a, "missing") == null, "switch to a missing id is null") _check(not CollectionSwitcher.rename_collection(lib, a, " "), "blank rename refused") _check(CollectionSwitcher.rename_collection(lib, a, "Alpha Prime"), "rename works") @@ -108,12 +108,12 @@ func _test_collections() -> void: _check(copy != null and copy.id != a.id and copy.tables.size() == 1, "duplicate copies the tables") state.set_variable(a.id, "x", "1") var next := CollectionSwitcher.delete_collection(lib, copy) - _check(next != null and next.id != copy.id and not lib.exists(copy.id), "delete returns another collection") - _check(state.get_variables(a.id).has("x"), "delete leaves other collections' state") + _check(next != null and next.id != copy.id and not lib.exists(copy.id), "delete returns another spread") + _check(state.get_variables(a.id).has("x"), "delete leaves other spreads' state") for e in lib.list(): var c := lib.load_collection(str(e["id"])) CollectionSwitcher.delete_collection(lib, c) - _check(lib.list().size() == 1, "deleting the last collection leaves a fresh empty one") + _check(lib.list().size() == 1, "deleting the last spread leaves a fresh empty one") func _test_import() -> void: @@ -130,7 +130,7 @@ func _test_import() -> void: var r := IoMenu.import_as_collection(lib, canvas, "loot.canvas") _check(r["ok"], "canvas import ok: %s" % str(r["errors"])) var b: TowerBoard = r["board"] - _check(b != null and lib.list().size() == before + 1 and lib.exists(b.id), "import adds a new collection") + _check(b != null and lib.list().size() == before + 1 and lib.exists(b.id), "import adds a new spread") var all := "" for t in b.tables: all += t.name + "|" @@ -139,7 +139,7 @@ func _test_import() -> void: _check(not all.contains("[url") and not all.contains("[img") and not all.contains("res://"), "import is sanitized: " + all) _check(all.contains("[b]bold[/b]") and all.contains("[color=red]gem[/color]"), "safe tags survive: " + all) var r2 := IoMenu.import_as_collection(lib, canvas, "loot.canvas") - _check(r2["ok"] and r2["board"].id != b.id, "importing twice makes two collections") + _check(r2["ok"] and r2["board"].id != b.id, "importing twice makes two spreads") var bad := IoMenu.import_as_collection(lib, "{not json", "x.json") _check(not bad["ok"] and not (bad["errors"] as Array).is_empty() and lib.list().size() == before + 2, "bad file adds nothing") _check(IoMenu.detect_format("a.canvas", "") == "canvas" and IoMenu.detect_format("a", "") == "graphml", "format detection") diff --git a/tests/test_simulate.gd b/tests/test_simulate.gd index 8194dca..164d84a 100644 --- a/tests/test_simulate.gd +++ b/tests/test_simulate.gd @@ -36,7 +36,7 @@ func _init() -> void: # A preference picks the matching option every time. var r2: Dictionary = await BoardTester.simulate(b, "start", {"runs": 20, "seed": 4, "prefer": "^Mine$"}) _check((r2["unchosen"] as Dictionary).has("pick"), "--prefer always picks the matching option") - _check(int((r2["table_hits"] as Dictionary).get("mine", 0)) == 20 * 3, "the preferred option's pipe ran on every pass") + _check(int((r2["table_hits"] as Dictionary).get("mine", 0)) == 20 * 3, "the preferred option's thread ran on every pass") # The action limit is reported as a halt reason. var r3: Dictionary = await BoardTester.simulate(b, "start", {"runs": 5, "seed": 5, "max_actions": 4}) _eq((r3["halted"] as Dictionary).get("Action limit", 0), 5, "the action limit is a halt reason") diff --git a/tests/test_storage.gd b/tests/test_storage.gd index f9adfe4..838cfbd 100644 --- a/tests/test_storage.gd +++ b/tests/test_storage.gd @@ -85,7 +85,7 @@ func _test_library() -> void: _check(lib.state.get_history("fantasy-loot").is_empty() and lib.state.get_history().size() == 1, "delete drops only its history") _check(lib.state.get_setting("last_collection") == null, "delete clears last_collection if it pointed there") _check(not lib.delete("fantasy-loot"), "deleting twice returns false") - _check(lib.load_collection("fantasy-loot") == null, "loading a missing collection returns null") + _check(lib.load_collection("fantasy-loot") == null, "loading a missing spread returns null") func _test_migration() -> void: @@ -98,7 +98,7 @@ func _test_migration() -> void: f.close() var lib := LibraryStore.new(root) var b := lib.migrate_legacy() - _check(b != null and b.name == "My Tables" and b.id == "my-tables", "legacy board imported as My Tables") + _check(b != null and b.name == "My Tables" and b.id == "my-tables", "legacy spread imported as My Tables") _check(lib.load_collection("my-tables").tables.size() == sample.tables.size(), "imported tables are saved") _check(not FileAccess.file_exists(legacy) and FileAccess.file_exists(legacy + ".bak"), "old file renamed to .bak") _check(lib.migrate_legacy() == null, "migration is a no-op once done") @@ -107,7 +107,7 @@ func _test_migration() -> void: var f2 := FileAccess.open(legacy, FileAccess.WRITE) f2.store_string(JSON.stringify({"format_version": 1, "tables": sample.to_dict()["tables"]})) f2.close() - _check(lib.migrate_legacy() == null and FileAccess.file_exists(legacy), "no migration when collections exist") + _check(lib.migrate_legacy() == null and FileAccess.file_exists(legacy), "no migration when spreads exist") func _test_corrupt() -> void: @@ -120,7 +120,7 @@ func _test_corrupt() -> void: var f2 := FileAccess.open(lib.path_for("wrongshape"), FileAccess.WRITE) f2.store_string("[1, 2, 3]") f2.close() - _check(lib.load_collection("broken") == null, "corrupt collection loads as null") + _check(lib.load_collection("broken") == null, "corrupt spread loads as null") var ids: Array = [] for e in lib.list(): ids.append(e["id"]) diff --git a/tests/test_templates.gd b/tests/test_templates.gd index 2b0eb5e..37359b9 100644 --- a/tests/test_templates.gd +++ b/tests/test_templates.gd @@ -61,8 +61,8 @@ func _test_make() -> void: var t0: Dictionary = tpl["tables"][0] var t1: Dictionary = tpl["tables"][1] _check(t0["x"] == 0 and t0["y"] == 0 and t1["x"] == 300 and t1["y"] == 60, "positions are relative to the top-left: %s %s" % [str(t0["x"]), str(t1["x"])]) - _check(t0["entries"][1]["pipes"] == [{"table": "outcome", "count": "{$n}", "save_as": "{$skill}_result"}], "internal pipes keep their target and options: %s" % str(t0["entries"][1]["pipes"])) - _check(t0["entries"][0]["pipes"] == [{"table": "Wounds", "outside": true}], "an outside pipe is recorded by name: %s" % str(t0["entries"][0]["pipes"])) + _check(t0["entries"][1]["pipes"] == [{"table": "outcome", "count": "{$n}", "save_as": "{$skill}_result"}], "internal threads keep their target and options: %s" % str(t0["entries"][1]["pipes"])) + _check(t0["entries"][0]["pipes"] == [{"table": "Wounds", "outside": true}], "an outside thread is recorded by name: %s" % str(t0["entries"][0]["pipes"])) _check(not JSON.stringify(tpl).contains("\"wounds\""), "the outside table itself isn't in the template") _check(TemplateKit.summary(tpl) == "2 cards: roll, choice", "summary: %s" % TemplateKit.summary(tpl)) # A group template keeps its group, relative to the frame's corner. @@ -94,16 +94,16 @@ func _test_insert() -> void: _check(chk.id != "chk" and oc.id != "outcome" and chk.id != oc.id, "fresh table ids") _check(chk.entries[0].id != "e1" and chk.entries[0].id != chk.entries[1].id, "fresh entry ids") _check(chk.position == Vector2(1000, 500) and oc.position == Vector2(1300, 560), "placed at the origin, keeping the layout") - _check(chk.entries[1].pipes == [oc.id] and chk.entries[1].count_expr(oc.id) == "" and chk.entries[1].count_for(oc.id) == 2, "internal pipes follow the new ids, with their count") + _check(chk.entries[1].pipes == [oc.id] and chk.entries[1].count_expr(oc.id) == "" and chk.entries[1].count_for(oc.id) == 2, "internal threads follow the new ids, with their count") _check(chk.entries[1].save_for(oc.id) == "pilot_result", "and their save_as, substituted") - _check(chk.entries[0].pipes == ["w1"] and oc.entries[1].pipes == ["w1"], "outside pipes relink to the table with that name (any case)") - _check((r["relinked"] as Array).size() == 2 and (r["dropped"] as Array).is_empty(), "relinked pipes are reported: %s" % str(r["relinked"])) + _check(chk.entries[0].pipes == ["w1"] and oc.entries[1].pipes == ["w1"], "outside threads relink to the table with that name (any case)") + _check((r["relinked"] as Array).size() == 2 and (r["dropped"] as Array).is_empty(), "relinked threads are reported: %s" % str(r["relinked"])) var again := TemplateKit.insert(tpl, {}, b, Vector2.ZERO) _check((again["tables"][0] as RollTable).id != chk.id, "a second insert gets new ids again") _check((again["tables"][0] as RollTable).name == "{$skill} check", "missing values without a default stay as typed") var empty := TowerBoard.new() var r2 := TemplateKit.insert(tpl, {"skill": "a", "target": "1", "n": "1"}, empty, Vector2.ZERO) - _check((r2["dropped"] as Array).size() == 2 and (r2["tables"][0] as RollTable).entries[0].pipes.is_empty(), "outside pipes with no table of that name are dropped and listed: %s" % str(r2["dropped"])) + _check((r2["dropped"] as Array).size() == 2 and (r2["tables"][0] as RollTable).entries[0].pipes.is_empty(), "outside threads with no table of that name are dropped and listed: %s" % str(r2["dropped"])) # Group templates make the group. var gsrc := _board() var g := gsrc.add_group("{$skill} block", ["chk", "outcome"]) @@ -182,7 +182,7 @@ func _test_builtins() -> void: var r := TemplateKit.insert(tpl, {}, b, Vector2(50, 50)) var text := b.to_json() _check(not text.contains("{$"), "%s: defaults fill every placeholder" % row["id"]) - _check((r["dropped"] as Array).is_empty(), "%s: no pipes lead outside" % row["id"]) + _check((r["dropped"] as Array).is_empty(), "%s: no threads lead outside" % row["id"]) var declared := TemplateKit.detect_params(tpl) for p: Dictionary in tpl["params"]: _check(declared.has(str(p["name"])), "%s: param %s is used" % [row["id"], p["name"]]) @@ -263,14 +263,14 @@ func _test_app() -> void: for t in main.data.tables: if t.kind == RollTable.KIND_VARIABLE and t.var_name == "counter": var_card = t - _check(var_card != null and main.card_for(var_card.id) != null, "its variable card is on the board") + _check(var_card != null and main.card_for(var_card.id) != null, "its variable card is on the spread") # Insert with values and an outside pipe that relinks. var tpl := TemplateKit.make(_board(), ["chk", "outcome"], "selection", "Check") var r := main.templating.insert_template(tpl, {"skill": "stealth", "target": "9", "n": "1"}) await process_frame var chk: RollTable = r["tables"][0] _check(main.card_for(chk.id) != null and chk.name == "stealth check", "the inserted cards appear") - _check(chk.entries[0].pipes == ["wounds"], "an outside pipe relinks to Wounds on this board") + _check(chk.entries[0].pipes == ["wounds"], "an outside thread relinks to Wounds on this spread") var center := main.board.screen_to_world(main.board.size / 2.0) var ext := TemplateKit.extent(tpl) _check(chk.position.distance_to((center - ext / 2.0).round().max(Vector2(20, 20 + TableGroup.TITLE_H))) < 2.0, "placed around the view centre") @@ -284,7 +284,7 @@ func _test_app() -> void: main.templating.insert_template(tpl, {"skill": "x", "target": "1", "n": "1"}) await process_frame var rep := _top_modal() - _check(rep != null and rep.title_label.text.begins_with("Inserted"), "pipes that can't relink are listed in a report") + _check(rep != null and rep.title_label.text.begins_with("Inserted"), "threads that can't relink are listed in a report") if rep: rep.close() # The card settings dialog offers Save as template. diff --git a/tests/test_top_bar.gd b/tests/test_top_bar.gd index af48743..371f989 100644 --- a/tests/test_top_bar.gd +++ b/tests/test_top_bar.gd @@ -40,7 +40,7 @@ func _test_bar() -> void: texts.append((n as Button).text) _check(not texts.has("Arrange ▾"), "Arrange ▾ is gone from the Build tools: %s" % str(texts)) var pm := bar._board_menu.get_popup() - _check(pm.get_item_index(IoMenu.ID_PACK) >= 0, "Board ▾ has Pack collapsed groups") + _check(pm.get_item_index(IoMenu.ID_PACK) >= 0, "Spread ▾ has Pack collapsed groups") _check(main.nav._search_button.text == "", "Search is an icon button") @@ -54,7 +54,7 @@ func _test_zoom() -> void: await _frames() _eq(z.menu.text, "50% ▾", "and follows zoom changes from elsewhere") z.activate(ZoomControl.ID_FIT) - _check(main.board.zoom != 0.5, "Fit board changes the zoom") + _check(main.board.zoom != 0.5, "Fit spread changes the zoom") func _test_view_menu() -> void: @@ -132,7 +132,7 @@ func _test_card_menu() -> void: func _test_help() -> void: var titles := HelpDialog.titles() - _check(titles.size() >= 10 and titles.has("Card mode") and titles.has("Roll modifiers"), "help has its topics: %s" % str(titles)) + _check(titles.size() >= 10 and titles.has("Deck mode") and titles.has("Roll modifiers"), "help has its topics: %s" % str(titles)) var src := FileAccess.get_file_as_string(HelpDialog.PATH) var re := RegEx.create_from_string("\\[topic\\](.+?)\\[/topic\\]") for m in re.search_all(src): @@ -141,9 +141,9 @@ func _test_help() -> void: _check(str(t["body"]).length() > 80, "“%s” has text" % t["title"]) _check(HelpDialog._inline("`[[Loot]]`").contains("[lb][lb]Loot[rb][rb]"), "code spans keep their brackets") - var d := main.top_bar.help_menu.open("card MODE") + var d := main.top_bar.help_menu.open("deck MODE") await _frames() - _eq(d.current, "Card mode", "Help opens at the asked topic, any case") + _eq(d.current, "Deck mode", "Help opens at the asked topic, any case") d._on_meta("topic:Roll modifiers") _eq(d.current, "Roll modifiers", "a topic link switches topics") _check(d.text.get_parsed_text().contains("Luck"), "and shows its text") diff --git a/tests/test_undo.gd b/tests/test_undo.gd index f36f866..bbffd85 100644 --- a/tests/test_undo.gd +++ b/tests/test_undo.gd @@ -250,20 +250,20 @@ func _test_results_and_tables() -> void: _check(_label() == "Delete table Gems" and _t("a").entries[0].pipes.is_empty(), "deleting a table: %s" % _label()) main.undo_redo.undo() await _frames() - _check(_t("b") != null and main.card_for("b") != null and _t("a").entries[0].pipes == ["b"], "undo brings the table, its card and the pipe into it back") + _check(_t("b") != null and main.card_for("b") != null and _t("a").entries[0].pipes == ["b"], "undo brings the table, its card and the thread into it back") func _test_pipes() -> void: - print("Pipes") + print("Threads") main.undo_redo._begin_edit() _t("a").entries[1].pipes.append("c") main.mark_dirty() await _frames() - _check(_label() == "Add pipe Loot → Weapons", "laying a pipe: %s" % _label()) + _check(_label() == "Add thread Loot → Weapons", "laying a thread: %s" % _label()) main.undo_redo.undo() - _check(_t("a").entries[1].pipes.is_empty(), "undo takes the pipe away") + _check(_t("a").entries[1].pipes.is_empty(), "undo takes the thread away") main.remove_pipe("a:e1>b") - _check(_label() == "Delete pipe Loot → Gems" and main.top_bar._toast_undo.visible, "removing a pipe, with an undo toast: %s" % _label()) + _check(_label() == "Delete thread Loot → Gems" and main.top_bar._toast_undo.visible, "removing a thread, with an undo toast: %s" % _label()) main.undo_redo.undo() _check(_t("a").entries[0].pipes == ["b"], "undo lays it again") var e := _t("a").entries[0] @@ -275,7 +275,7 @@ func _test_pipes() -> void: e.set_pipe_count("b", 4) main.mark_dirty() await _frames() - _check(_steps() == n0 + 1 and _label() == "Edit pipe Loot → Gems", "nudging a pipe's count twice is one step: %s" % _label()) + _check(_steps() == n0 + 1 and _label() == "Edit thread Loot → Gems", "nudging a thread's count twice is one step: %s" % _label()) await create_timer(EditHistory.COALESCE_SECS + 0.1).timeout e.set_pipe_save("b", "gem") main.mark_dirty() @@ -394,7 +394,7 @@ func _test_template_and_reset() -> void: _check(_label() == "Reset sample" and _t("a") == null, "Reset sample is a step: %s" % _label()) main.undo_redo.undo() await _frames() - _check(_t("a") != null and _t("a").name == "Loot" and main.data.get_group("g1") != null, "undo brings the board back") + _check(_t("a") != null and _t("a").name == "Loot" and main.data.get_group("g1") != null, "undo brings the spread back") func _test_pack() -> void: @@ -558,7 +558,7 @@ func _test_play_mode() -> void: func _test_collections() -> void: - print("Per-collection history") + print("Per-spread history") main.add_entry("a") var first := main.data var h := main.undo_redo.edits @@ -566,7 +566,7 @@ func _test_collections() -> void: other.load_dict({"format_version": 2, "id": "other", "name": "Other", "tables": [ {"id": "x", "name": "X", "x": 0, "y": 0, "entries": [{"id": "e1", "text": "x"}]}]}) await main.collections._show_collection(other) - _check(main.undo_redo.edits != h and not main.undo_redo.edits.can_undo(), "another collection has its own, empty history") + _check(main.undo_redo.edits != h and not main.undo_redo.edits.can_undo(), "another spread has its own, empty history") main.add_entry("x") _check(main.undo_redo.edits.undo_label() == "Add result to X", "edits there go to its history") await main.collections._show_collection(first) @@ -577,12 +577,12 @@ func _test_collections() -> void: func _test_big_board() -> void: - print("Big board") + print("Big spread") var d: Dictionary = {} var path := "" for a in OS.get_cmdline_user_args(): - if a.begins_with("--big-board="): - path = a.trim_prefix("--big-board=") + if a.begins_with("--big-spread="): + path = a.trim_prefix("--big-spread=") if path != "" and FileAccess.file_exists(path): d = JSON.parse_string(FileAccess.get_file_as_string(path)) else: @@ -630,13 +630,13 @@ func _test_big_board() -> void: var t5 := Time.get_ticks_usec() main.undo_redo.undo() var undo_del_ms := (Time.get_ticks_usec() - t5) / 1000.0 - _check(_t(u.id) != null, "undoing a deletion on the big board brings the card back") - print(" TIMING %d cards: one committed edit %.1f ms (snapshot %.1f ms); keystroke %.2f ms, of which mark_dirty's existing refresh %.2f ms; undo of an edit %.1f ms (board update %.1f ms); undo of a deletion %.1f ms; board %d chars, later step %d bytes" % [ + _check(_t(u.id) != null, "undoing a deletion on the big spread brings the card back") + print(" TIMING %d cards: one committed edit %.1f ms (snapshot %.1f ms); keystroke %.2f ms, of which mark_dirty's existing refresh %.2f ms; undo of an edit %.1f ms (spread update %.1f ms); undo of a deletion %.1f ms; spread %d chars, later step %d bytes" % [ n, commit_ms, cap_ms, key_ms, base_ms, undo_ms, undo_one_ms, undo_del_ms, full, step_bytes]) _check(commit_ms < 250.0, "committing one edit stays quick: %.1f ms" % commit_ms) - _check(key_ms - base_ms < 1.0, "a keystroke doesn't snapshot the board: %.2f ms over %.2f ms" % [key_ms, base_ms]) + _check(key_ms - base_ms < 1.0, "a keystroke doesn't snapshot the spread: %.2f ms over %.2f ms" % [key_ms, base_ms]) _check(step_bytes < full / 10, "a later step stores only the changed cards: %d of %d" % [step_bytes, full]) - _check(_t(t.id).name.ends_with("(edited)") and not _t(t.id).name.ends_with("x"), "undo works on the big board") + _check(_t(t.id).name.ends_with("(edited)") and not _t(t.id).name.ends_with("x"), "undo works on the big spread") func _synthetic_board(n: int) -> Dictionary: diff --git a/ui/builtin_themes.gd b/ui/builtin_themes.gd index 9ef24fe..f8942ba 100644 --- a/ui/builtin_themes.gd +++ b/ui/builtin_themes.gd @@ -34,7 +34,7 @@ const TAROT := { ## The original green felt and copper look, kept as a second set. const FELT := { "id": "felt", "name": "Felt", "builtin": true, - "pattern": "dots", "logo": "none", "card_frame": "plain", + "pattern": "dots", "logo": "tower", "card_frame": "plain", "font_body": "atkinson", "font_display": "rokkitt", "background": {"kind": "radial", "colors": ["#2a5c47", "#1f4a39"], "center": [0.35, 0.3]}, "panel": {"kind": "solid", "colors": ["#12301f"]}, diff --git a/ui/choice_dialog.gd b/ui/choice_dialog.gd index 584d51c..a564d0b 100644 --- a/ui/choice_dialog.gd +++ b/ui/choice_dialog.gd @@ -115,7 +115,7 @@ func _build_pick() -> void: var row := _option_row(k, o) list.add_child(row) _options.append(row) - var hint := note("Press 1–%d to choose, R for Random, M to look at the board, Esc to cancel." % mini(9, maxi(1, opts.size()))) + var hint := note("Press 1–%d to choose, R for Random, M to look at the spread, Esc to cancel." % mini(9, maxi(1, opts.size()))) hint.add_theme_font_size_override("font_size", 13) body.add_child(hint) add_button("Cancel", "plain", func() -> void: answer(null)) @@ -431,7 +431,7 @@ func _build_chrome() -> void: add_child(preview_panel) var min_btn := add_button("Minimize", "plain", minimize) - min_btn.tooltip_text = "Hide this question to look at the board (M or Tab)" + min_btn.tooltip_text = "Hide this question to look at the spread (M or Tab)" footer.move_child(min_btn, 0) var spacer := Control.new() spacer.size_flags_horizontal = Control.SIZE_EXPAND_FILL @@ -629,7 +629,7 @@ func preview_for_option(k: int) -> Control: box.add_child(_rule()) var how := Describe.pipe(e, tid, board) if plain else PipeLayer._pipe_tag(e, tid) if how != "": - var hl := Style.make_label(("Then: " if plain else "pipe: ") + how, Style.body_bold(), 12, Style.TRIM_DARK) + var hl := Style.make_label(("Then: " if plain else "thread: ") + how, Style.body_bold(), 12, Style.TRIM_DARK) hl.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART hl.mouse_filter = Control.MOUSE_FILTER_IGNORE hl.set_meta("pipe_line", true) diff --git a/ui/collection_switcher.gd b/ui/collection_switcher.gd index 326eeb8..752e0f5 100644 --- a/ui/collection_switcher.gd +++ b/ui/collection_switcher.gd @@ -30,7 +30,7 @@ func setup(p_main: Main) -> void: func refresh() -> void: var n := main.data.name if main.data.name != "" else "Untitled" text = "%s ▾" % (n if n.length() <= MAX_LABEL else n.substr(0, MAX_LABEL - 1) + "…") - tooltip_text = "Collection: %s" % n + tooltip_text = "Spread: %s" % n func _fill() -> void: @@ -49,7 +49,7 @@ func _fill() -> void: pm.set_item_disabled(0, true) _ids.append(main.data.id) pm.add_separator() - pm.add_item("New collection…", ID_NEW) + pm.add_item("New spread…", ID_NEW) pm.add_item("Rename…", ID_RENAME) pm.add_item("Duplicate", ID_DUPLICATE) pm.add_item("Delete…", ID_DELETE) diff --git a/ui/details_popup.gd b/ui/details_popup.gd index cd58226..9e26d85 100644 --- a/ui/details_popup.gd +++ b/ui/details_popup.gd @@ -250,7 +250,7 @@ func show_meta(owner: Control, meta: String) -> void: "missing": show_for(owner, "Missing table", "There's no table called [b]%s[/b]. Check the spelling, or add a table with that name." % RichText.plain(arg)) "unset": - show_for(owner, "{%s} isn't set" % arg, "Nothing has saved this variable yet. Save it earlier in the roll with [lb][lb]Table -> %s]] or a pipe's [i]Save as[/i]." % RichText.plain(arg)) + show_for(owner, "{%s} isn't set" % arg, "Nothing has saved this variable yet. Save it earlier in the roll with [lb][lb]Table -> %s]] or a thread's [i]Save as[/i]." % RichText.plain(arg)) "deep": show_for(owner, "Chain too deep", "The roll stopped after %d levels so a loop can't run forever." % Roller.MAX_DEPTH) "error": @@ -277,7 +277,7 @@ func _show_var(owner: Control, name: String) -> void: source = str(v.get("source", "")) else: value = (main.current.get("chain_vars", {}) as Dictionary).get(name) - var sub := "Saved for this collection" if persistent else "Saved for this roll" + var sub := "Saved for this spread" if persistent else "Saved for this roll" var st := main.data.get_table(source) if source != "" else null if st: sub += " · from %s" % Formatter.strip_tags(st.name) @@ -292,7 +292,7 @@ func table_summary(t: RollTable) -> String: var sub := "Choice · " + Describe.choice_label(t.choice).to_lower() return sub + " · %d options" % t.entries.size() if t.choice == "pick" else sub RollTable.KIND_LOOP: - return "Loop · " + RulesView.loop_rule(t, main.data, RulesView.plain(main)) + return "Repeat · " + RulesView.loop_rule(t, main.data, RulesView.plain(main)) RollTable.KIND_VARIABLE: if RulesView.plain(main): return "Collection · kept between rolls" if t.is_collection() else "%s · kept between rolls" % t.var_type.capitalize() @@ -302,7 +302,7 @@ func table_summary(t: RollTable) -> String: RollTable.KIND_SHEET: return "Sheet" RollTable.KIND_ROUTER: - return "Router · %d cases · the first true case is taken" % t.entries.size() + return "Branch · %d cases · the first true case is taken" % t.entries.size() var dl := t.dice_label() if t.clamps(): dl = RulesView.roll_line(t, main.data, RulesView.plain(main)) diff --git a/ui/edit_history.gd b/ui/edit_history.gd index 24107b4..23b694d 100644 --- a/ui/edit_history.gd +++ b/ui/edit_history.gd @@ -492,11 +492,11 @@ static func _table_label(ta: Dictionary, tb: Dictionary, b: Dictionary) -> Strin return "Delete result “%s” from %s" % [_short(Formatter.strip_tags(str(e["removed"][0].get("text", "")))), tname] return "Delete %d results from %s" % [e["removed"].size(), tname] if not e["pipes_added"].is_empty(): - return "Add pipe %s → %s" % [tname, _name(b, "ids", "tables", e["pipes_added"][0])] + return "Add thread %s → %s" % [tname, _name(b, "ids", "tables", e["pipes_added"][0])] if not e["pipes_removed"].is_empty(): - return "Delete pipe %s → %s" % [tname, _name(b, "ids", "tables", e["pipes_removed"][0])] + return "Delete thread %s → %s" % [tname, _name(b, "ids", "tables", e["pipes_removed"][0])] if not e["pipes_changed"].is_empty(): - return "Edit pipe %s → %s" % [tname, _name(b, "ids", "tables", e["pipes_changed"][0])] + return "Edit thread %s → %s" % [tname, _name(b, "ids", "tables", e["pipes_changed"][0])] if ta.get("name") != tb.get("name"): var rest_a := ta.duplicate() var rest_b := tb.duplicate() diff --git a/ui/help_menu.gd b/ui/help_menu.gd index b39724f..84ce2db 100644 --- a/ui/help_menu.gd +++ b/ui/help_menu.gd @@ -9,7 +9,7 @@ var m: Main func setup(p_main: Main) -> void: m = p_main Style.menu_button("Help ▾", false, self) - tooltip_text = "How to use TableTower (F1)" + tooltip_text = "How to use Table Tarot (F1)" var pm := get_popup() ModalCard.style_popup(pm) var titles := HelpDialog.titles() diff --git a/ui/inspector.gd b/ui/inspector.gd index af47392..8549367 100644 --- a/ui/inspector.gd +++ b/ui/inspector.gd @@ -461,8 +461,8 @@ func _refresh_title() -> void: func _empty() -> void: _content.add_child(_head("Inspector", "Nothing selected")) - _content.add_child(InspectorKit.note("Select a card, a result or a pipe to edit it.", Style.MUTED, 15)) - _content.add_child(InspectorKit.note("Click a card's title for the card, a result's text for the result, or a pipe on the felt for its options.", Style.MUTED, 13)) + _content.add_child(InspectorKit.note("Select a card, a result or a thread to edit it.", Style.MUTED, 15)) + _content.add_child(InspectorKit.note("Click a card's title for the card, a result's text for the result, or a thread on the felt for its options.", Style.MUTED, 13)) static func _title_of(s: String, fallback: String) -> String: @@ -512,7 +512,7 @@ func _result_section(t: RollTable, e: TableEntry) -> void: var go := InspectorKit.vbox(8) if e.pipes.is_empty(): - go.add_child(InspectorKit.note("No pipes yet. Drag from the ● at the end of this result to a card.", Style.MUTED, 14)) + go.add_child(InspectorKit.note("No threads yet. Drag from the ● at the end of this result to a card.", Style.MUTED, 14)) for p in e.pipes: go.add_child(_pipe_box(t, e, p)) _content.add_child(InspectorKit.field("Then go to", go)) @@ -524,8 +524,8 @@ func _pipe_section(t: RollTable, e: TableEntry, to: String) -> void: _result_section(t, e) return var target := main.data.get_table(to) - _content.add_child(_head("Selected pipe", "%s → %s" % [_title_of(e.text, "(no text)"), _title_of(target.name, to) if target else to])) - var back := InspectorKit.link("Edit the whole result", "Show the result this pipe leaves from") + _content.add_child(_head("Selected thread", "%s → %s" % [_title_of(e.text, "(no text)"), _title_of(target.name, to) if target else to])) + var back := InspectorKit.link("Edit the whole result", "Show the result this thread leaves from") back.add_theme_color_override("font_color", Style.MUTED) back.pressed.connect(func() -> void: select({"kind": "result", "tid": t.id, "eid": e.id})) _content.add_child(back) @@ -620,7 +620,7 @@ func _pipe_box(t: RollTable, e: TableEntry, to: String) -> Control: when_box.add_child(cond) v.add_child(when_box) var other := InspectorKit.check_box("Otherwise", e.is_otherwise(to)) - other.tooltip_text = "Runs only when none of this result's \"Only if\" pipes is true" + other.tooltip_text = "Runs only when none of this result's \"Only if\" threads is true" other.toggled.connect(func(on: bool) -> void: set_pipe_otherwise(to, on)) parts["otherwise"] = other v.add_child(other) @@ -629,7 +629,7 @@ func _pipe_box(t: RollTable, e: TableEntry, to: String) -> Control: var cr := InspectorKit.flow() cr.add_child(InspectorKit.word("Rolls")) var count := InspectorKit.amount(e.count_text(to), "1") - count.tooltip_text = "A number, or an expression such as @terms, answer or 1d3 (worked out when the pipe runs)" + count.tooltip_text = "A number, or an expression such as @terms, answer or 1d3 (worked out when the thread runs)" InspectorKit.tag(count, "pipe.%s.count" % to) var cerr := InspectorKit.error_label() count.text_changed.connect(func(s: String) -> void: @@ -658,7 +658,7 @@ func _pipe_box(t: RollTable, e: TableEntry, to: String) -> Control: v.add_child(sr) v.add_child(cerr) - var rm := InspectorKit.link("Delete pipe", "Delete this pipe") + var rm := InspectorKit.link("Delete thread", "Delete this thread") rm.add_theme_color_override("font_color", Style.DANGER_INK) rm.add_theme_color_override("font_hover_color", Style.DANGER_INK) rm.pressed.connect(func() -> void: remove_pipe(to)) @@ -678,8 +678,8 @@ func _refresh_otherwise(to: String) -> void: var has_when := e.when_for(to) != "" cb.disabled = has_when cb.set_pressed_no_signal(e.is_otherwise(to)) - cb.tooltip_text = "Turn off \"Only if\" first: a pipe with a condition isn't an otherwise pipe" if has_when \ - else "Runs only when none of this result's \"Only if\" pipes is true" + cb.tooltip_text = "Turn off \"Only if\" first: a thread with a condition isn't an otherwise thread" if has_when \ + else "Runs only when none of this result's \"Only if\" threads is true" static func _chip(text: String, fg: Color, bg: Color) -> Control: diff --git a/ui/inspector_card.gd b/ui/inspector_card.gd index 5034533..afaeef7 100644 --- a/ui/inspector_card.gd +++ b/ui/inspector_card.gd @@ -57,7 +57,7 @@ static func build(insp: Inspector, box: VBoxContainer, t: RollTable) -> void: if t.kind != RollTable.KIND_VARIABLE: box.add_child(_inputs(insp, t)) - var more := InspectorKit.link("More settings…", "Card mode, colours and the other settings") + var more := InspectorKit.link("More settings…", "Deck mode, colours and the other settings") more.pressed.connect(func() -> void: insp.main.open_table_settings(t.id)) box.add_child(more) @@ -67,7 +67,7 @@ static func build(insp: Inspector, box: VBoxContainer, t: RollTable) -> void: static func _inputs(insp: Inspector, t: RollTable) -> Control: var v := InspectorKit.vbox(5) v.add_child(InspectorKit.flabel("Inputs")) - v.add_child(InspectorKit.note("Values a pipe into this card can pass, like a Tier. Each one has a starting value.", Style.MUTED, 13)) + v.add_child(InspectorKit.note("Values a thread into this card can pass, like a Tier. Each one has a starting value.", Style.MUTED, 13)) var rows: Array = [] for inp: Dictionary in t.inputs: rows.append(inp.duplicate()) @@ -174,7 +174,7 @@ static func _check(insp: Inspector, box: VBoxContainer, t: RollTable, plain: boo r3.add_child(cmp) box.add_child(InspectorKit.field("Target", r3)) box.add_child(errs) - box.add_child(InspectorKit.note("Success and Failure are the card's two results; select one to give it changes and pipes.", Style.MUTED, 13)) + box.add_child(InspectorKit.note("Success and Failure are the card's two results; select one to give it changes and threads.", Style.MUTED, 13)) refresh.call() @@ -524,7 +524,7 @@ static func _collection(insp: Inspector, box: VBoxContainer, t: RollTable) -> vo var add := InspectorKit.link("+ Add member") add.pressed.connect(func() -> void: add_member(insp, t)) v.add_child(add) - v.add_child(InspectorKit.note("Members are saved values of this board, like the Variables panel shows; they aren't part of undo.", Style.MUTED, 12)) + v.add_child(InspectorKit.note("Members are saved values of this spread, like the Variables panel shows; they aren't part of undo.", Style.MUTED, 12)) box.add_child(InspectorKit.field("Members", v)) box.add_child(err) diff --git a/ui/io_menu.gd b/ui/io_menu.gd index c2eb5de..8c6c4db 100644 --- a/ui/io_menu.gd +++ b/ui/io_menu.gd @@ -11,7 +11,7 @@ const ID_EXPORT := 100 ## Export formats: label, file extension, FileDialog filter. const EXPORTS := [ - {"key": "json", "label": "TableTower JSON", "ext": "json", "filter": "*.json ; TableTower JSON"}, + {"key": "json", "label": "Table Tarot JSON", "ext": "json", "filter": "*.json ; Table Tarot JSON"}, {"key": "canvas", "label": "JSON Canvas", "ext": "canvas", "filter": "*.canvas ; JSON Canvas"}, {"key": "mermaid", "label": "Mermaid diagram (.mmd)", "ext": "mmd", "filter": "*.mmd ; Mermaid"}, {"key": "mermaid_md", "label": "Mermaid in Markdown (.md)", "ext": "md", "filter": "*.md ; Markdown"}, @@ -20,8 +20,8 @@ const EXPORTS := [ ] const IMPORT_FILTERS: Array[String] = [ - "*.json, *.canvas, *.graphml, *.xml ; TableTower, JSON Canvas or GraphML", - "*.json ; TableTower JSON", + "*.json, *.canvas, *.graphml, *.xml ; Table Tarot, JSON Canvas or GraphML", + "*.json ; Table Tarot JSON", "*.canvas ; JSON Canvas", "*.graphml, *.xml ; GraphML", ] @@ -34,19 +34,19 @@ signal pack_requested func setup(can_reset: bool, can_import: bool) -> void: - Style.menu_button("Board ▾", false, self) - tooltip_text = "Test, arrange, import and export the board" + Style.menu_button("Spread ▾", false, self) + tooltip_text = "Test, arrange, import and export the spread" var pm := get_popup() ModalCard.style_popup(pm) - pm.add_item("Test board…", ID_TEST) + pm.add_item("Test spread…", ID_TEST) pm.add_item("Reset sample", ID_RESET) pm.add_separator("Arrange") pm.add_item("Pack collapsed groups", ID_PACK) pm.set_item_tooltip(pm.get_item_index(ID_PACK), "Move collapsed groups and the cards between them together, closing the gaps, in reading order") pm.add_separator("Import") - pm.add_item("Import as new collection…", ID_IMPORT) + pm.add_item("Import as new spread…", ID_IMPORT) pm.set_item_disabled(pm.get_item_index(ID_IMPORT), not can_import) - pm.add_separator("Export this collection") + pm.add_separator("Export this spread") for i in EXPORTS.size(): pm.add_item("Export as " + str(EXPORTS[i]["label"]) + "…", ID_EXPORT + i) pm.id_pressed.connect(func(id: int) -> void: @@ -128,10 +128,10 @@ static func import_as_collection(library: LibraryStore, text: String, file_name: if b.name.strip_edges() == "": b.name = file_name.get_file().get_basename() if b.name.strip_edges() == "": - b.name = "Imported collection" + b.name = "Imported spread" b.id = library.unique_id(LibraryStore.slugify(b.name)) if not library.save(b): - (out["errors"] as Array).append("Couldn't save the imported collection.") + (out["errors"] as Array).append("Couldn't save the imported spread.") return out out["ok"] = true out["board"] = b diff --git a/ui/main.gd b/ui/main.gd index 14141f2..22b2c13 100644 --- a/ui/main.gd +++ b/ui/main.gd @@ -17,7 +17,7 @@ const HISTORY_SIZE := 6 const SAVE_DELAY := 0.6 const HINTS := { Mode.PLAY: "Click a die to roll. Shift-click skips straight to the result.", - Mode.BUILD: "Click a card, a result or a pipe to edit it in the inspector. Drag from a ● to another card to lay a pipe.", + Mode.BUILD: "Click a card, a result or a thread to edit it in the inspector. Drag from a ● to another card to lay a thread.", } var data: TowerBoard @@ -90,6 +90,9 @@ func _init() -> void: func _ready() -> void: rng.randomize() + # The project keeps its old internal name so the user:// folder (saved + # spreads) doesn't move; the window shows the app's name. + get_window().title = "Table Tarot" var args := OS.get_cmdline_user_args() if args.has("--sample") or MainCli._arg_value(args, "--screenshot") != "": _saving_enabled = false diff --git a/ui/main_collections.gd b/ui/main_collections.gd index 051512a..1810dda 100644 --- a/ui/main_collections.gd +++ b/ui/main_collections.gd @@ -51,7 +51,7 @@ func switch_collection(id: String) -> void: m._save_timer.stop() var b := CollectionSwitcher.switch_collection(m.library, m.data, id) if b == null: - m.toast("Couldn't open that collection") + m.toast("Couldn't open that spread") return _show_collection(b) @@ -85,7 +85,7 @@ func _show_collection(b: TowerBoard) -> void: func new_collection() -> void: if not collections_enabled(): return - m._add_modal(ModalCard.ask_text("New collection", "Name", "", "Create", func(n: String) -> void: + m._add_modal(ModalCard.ask_text("New spread", "Name", "", "Create", func(n: String) -> void: _show_collection(CollectionSwitcher.create_collection(m.library, m.data, n)) m.toast("Created “%s”" % m.data.name) )) @@ -94,7 +94,7 @@ func new_collection() -> void: func rename_collection() -> void: if not collections_enabled(): return - m._add_modal(ModalCard.ask_text("Rename collection", "Name", m.data.name, "Rename", func(n: String) -> void: + m._add_modal(ModalCard.ask_text("Rename spread", "Name", m.data.name, "Rename", func(n: String) -> void: if CollectionSwitcher.rename_collection(m.library, m.data, n): m.top_bar._switcher.refresh() )) @@ -105,7 +105,7 @@ func duplicate_collection() -> void: return var copy := CollectionSwitcher.duplicate_collection(m.library, m.data, m.data.name + " copy") if copy == null: - m.toast("Couldn't duplicate the collection") + m.toast("Couldn't duplicate the spread") return _show_collection(copy) m.toast("Duplicated as “%s”" % copy.name) @@ -115,7 +115,7 @@ func delete_collection() -> void: if not collections_enabled(): return var msg := "Delete “%s” and its saved decks, variables and history? This can't be undone." % m.data.name - m._add_modal(ModalCard.confirm("Delete collection", msg, "Delete", func() -> void: + m._add_modal(ModalCard.confirm("Delete spread", msg, "Delete", func() -> void: var gone := m.data.name var gone_id := m.data.id var next := CollectionSwitcher.delete_collection(m.library, m.data) @@ -136,7 +136,7 @@ func export_collection(format: Dictionary) -> void: func import_collection() -> void: if not collections_enabled(): return - m.file_dialog("Import as a new collection", IoMenu.IMPORT_FILTERS, FileDialog.FILE_MODE_OPEN_FILE, _import_file) + m.file_dialog("Import as a new spread", IoMenu.IMPORT_FILTERS, FileDialog.FILE_MODE_OPEN_FILE, _import_file) func _import_file(path: String) -> void: @@ -153,7 +153,7 @@ func _import_file(path: String) -> void: m._add_modal(IoMenu.report_dialog( "Imported “%s”" % r["board"].name if r["ok"] else "Couldn't import %s" % path.get_file(), r)) elif r["ok"]: - m.toast("Imported “%s” as a new collection" % r["board"].name) + m.toast("Imported “%s” as a new spread" % r["board"].name) # ----- Test board ----- diff --git a/ui/main_editing.gd b/ui/main_editing.gd index 770acc1..3fd203c 100644 --- a/ui/main_editing.gd +++ b/ui/main_editing.gd @@ -18,8 +18,8 @@ const ADD_KINDS := [ ["Choice: which option", RollTable.KIND_CHOICE, "pick", "New choice"], ["Choice: how many", RollTable.KIND_CHOICE, "number", "How many?"], ["Choice: open ended", RollTable.KIND_CHOICE, "text", "What is it?"], - ["Loop", RollTable.KIND_LOOP, "times", "Repeat"], - ["Router: if / else if / otherwise", RollTable.KIND_ROUTER, "", "Router"], + ["Repeat", RollTable.KIND_LOOP, "times", "Repeat"], + ["Branch: if / else if / otherwise", RollTable.KIND_ROUTER, "", "Branch"], ["Variable", RollTable.KIND_VARIABLE, "number", "New variable"], ["Collection (Skills, Contacts…)", RollTable.KIND_VARIABLE, RollTable.VAR_COLLECTION, "Skills"], ["Sheet", RollTable.KIND_SHEET, "", "Sheet"], @@ -147,7 +147,7 @@ func reset_sample() -> void: await m.get_tree().process_frame await m.get_tree().process_frame m.board.fit() - m.toast("Board reset to the sample tables", true) + m.toast("Spread reset to the sample tables", true) func add_entry(tid: String) -> void: @@ -221,7 +221,7 @@ func remove_pipe(key: String) -> void: if card: card.rebuild() m.undo_redo._end_edit() - m.toast("Deleted pipe from “%s” to %s" % [e.text, target.name if target else to], true) + m.toast("Deleted thread from “%s” to %s" % [e.text, target.name if target else to], true) func start_link(tid: String, eid: String) -> void: @@ -252,7 +252,7 @@ func finish_link() -> void: if e == null or e.pipes.has(over.table.id): return if over.table.kind == RollTable.KIND_VARIABLE: - m.toast("Variable cards aren't rolled, so pipes can't lead into them. Use a change such as @%s += 1." % over.table.var_name) + m.toast("Variable cards aren't rolled, so threads can't lead into them. Use a change such as @%s += 1." % over.table.var_name) return m.undo_redo._begin_edit() # A result may pipe into several cards (fan-out); a new pipe adds to the others. diff --git a/ui/main_groups.gd b/ui/main_groups.gd index 3871801..c302cc8 100644 --- a/ui/main_groups.gd +++ b/ui/main_groups.gd @@ -213,7 +213,7 @@ func confirm_delete_group(gid: String) -> void: return var n := g.members.size() m._add_modal(ModalCard.confirm("Delete group", - "Delete “%s” and the %d %s in it? Pipes from other cards into them are removed too. You can undo this from the message that follows." % [Formatter.strip_tags(g.name), n, "card" if n == 1 else "cards"], + "Delete “%s” and the %d %s in it? Threads from other cards into them are removed too. You can undo this from the message that follows." % [Formatter.strip_tags(g.name), n, "card" if n == 1 else "cards"], "Delete group and cards", func() -> void: delete_group(gid), true)) diff --git a/ui/main_navigation.gd b/ui/main_navigation.gd index ddbe864..00ee7c8 100644 --- a/ui/main_navigation.gd +++ b/ui/main_navigation.gd @@ -250,7 +250,7 @@ func pack_collapsed_groups() -> int: m.toast("Already packed") return 0 m.undo_redo._end_edit("Pack collapsed groups") - m.toast("Packed the board: moved %d %s" % [moved, "block" if moved == 1 else "blocks"], true) + m.toast("Packed the spread: moved %d %s" % [moved, "block" if moved == 1 else "blocks"], true) await m.get_tree().process_frame await m.get_tree().process_frame m.board.fit() diff --git a/ui/main_templates.gd b/ui/main_templates.gd index 3c80835..320df4d 100644 --- a/ui/main_templates.gd +++ b/ui/main_templates.gd @@ -4,7 +4,7 @@ extends RefCounted ## Saved in user://templates (TemplateLibrary), shared by every collection. ## --sample runs keep them in memory only. -const TEMPLATE_FILTER := "*.json ; TableTower template" +const TEMPLATE_FILTER := "*.json ; Table Tarot template" var m: Main @@ -106,7 +106,7 @@ func insert_template(tpl: Dictionary, values: Dictionary) -> Dictionary: else: m.toast(msg + " · %d left out" % dropped.size(), true) var d := ModalCard.new("Inserted “%s”" % str(tpl.get("name", "template")), 540.0) - d.body.add_child(ModalCard.note("These pipes led to cards outside the template, and this collection has no card with that name, so they were left out. Lay them again by hand, or rename a card and insert again.", Style.INK)) + d.body.add_child(ModalCard.note("These threads led to cards outside the template, and this spread has no card with that name, so they were left out. Lay them again by hand, or rename a card and insert again.", Style.INK)) d.body.add_child(ModalCard.section("Left out (%d)" % dropped.size())) for what: String in dropped: d.body.add_child(ModalCard.note("• " + what, Style.INK)) diff --git a/ui/main_top_bar.gd b/ui/main_top_bar.gd index 6cc29c9..6dee605 100644 --- a/ui/main_top_bar.gd +++ b/ui/main_top_bar.gd @@ -30,6 +30,28 @@ func _init(p_main: Main) -> void: m = p_main +## The theme's logo (Style.LOGO): the fortune-teller mascot, the old tower +## mark, or none. +func _logo() -> Control: + match Style.LOGO: + "fortune_teller": + var tr := TextureRect.new() + tr.texture = preload("res://assets/art/fortune_teller_logo.svg") + tr.expand_mode = TextureRect.EXPAND_IGNORE_SIZE + tr.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED + tr.texture_filter = CanvasItem.TEXTURE_FILTER_LINEAR_WITH_MIPMAPS + tr.custom_minimum_size = Vector2(46, 46) + tr.size_flags_vertical = Control.SIZE_SHRINK_CENTER + return tr + "tower": + var mark := Control.new() + mark.custom_minimum_size = Vector2(20, 24) + mark.size_flags_vertical = Control.SIZE_SHRINK_CENTER + mark.draw.connect(func() -> void: Icons.draw_tower(mark, Vector2(0, 0), 20.0 / 22.0, Style.ON_BG, Style.ACCENT)) + return mark + return null + + func _build_top_bar() -> Control: var bar := PanelContainer.new() bar.add_theme_stylebox_override("panel", Style.panel_box([16, 10, 16, 10])) @@ -39,12 +61,10 @@ func _build_top_bar() -> Control: var brand := HBoxContainer.new() brand.add_theme_constant_override("separation", 9) - var mark := Control.new() - mark.custom_minimum_size = Vector2(20, 24) - mark.size_flags_vertical = Control.SIZE_SHRINK_CENTER - mark.draw.connect(func() -> void: Icons.draw_tower(mark, Vector2(0, 0), 20.0 / 22.0, Style.ON_BG, Style.ACCENT)) - brand.add_child(mark) - var title := Style.make_label("TableTower", Style.display(), 23, Style.ON_BG) + var mark := _logo() + if mark: + brand.add_child(mark) + var title := Style.make_label("Table Tarot", Style.display(), 23, Style.ON_BG) title.size_flags_vertical = Control.SIZE_SHRINK_CENTER brand.add_child(title) h.add_child(brand) diff --git a/ui/pipe_popover.gd b/ui/pipe_popover.gd index be15650..56a36a2 100644 --- a/ui/pipe_popover.gd +++ b/ui/pipe_popover.gd @@ -64,7 +64,7 @@ func setup(p_main: Main) -> void: _count.custom_minimum_size = Vector2(64, 0) _count.alignment = HORIZONTAL_ALIGNMENT_CENTER _count.max_length = 60 - _count.tooltip_text = "A number, or an expression such as @terms, answer or 1d3 (worked out when the pipe runs)" + _count.tooltip_text = "A number, or an expression such as @terms, answer or 1d3 (worked out when the thread runs)" _count.add_theme_stylebox_override("normal", field_ok) _count.add_theme_stylebox_override("focus", field_focus) _count.text_changed.connect(func(s: String) -> void: @@ -98,7 +98,7 @@ func setup(p_main: Main) -> void: _when.placeholder_text = "always (or e.g. @str >= 8)" _when.size_flags_horizontal = Control.SIZE_EXPAND_FILL _when.max_length = 200 - _when.tooltip_text = "The pipe runs only when this is true. Every condition on the result is checked once, before any of its pipes run." + _when.tooltip_text = "The thread runs only when this is true. Every condition on the result is checked once, before any of its threads run." _when.add_theme_stylebox_override("normal", field_ok) _when.add_theme_stylebox_override("focus", field_focus) _when.text_changed.connect(func(_s: String) -> void: _check_when()) @@ -121,7 +121,7 @@ func setup(p_main: Main) -> void: other_row.add_child(pad) _otherwise = CheckBox.new() _otherwise.text = "Otherwise" - _otherwise.tooltip_text = "Runs only when none of this result's \"Only if\" pipes is true" + _otherwise.tooltip_text = "Runs only when none of this result's \"Only if\" threads is true" _otherwise.add_theme_font_override("font", Style.body()) _otherwise.add_theme_font_size_override("font_size", 14) _otherwise.add_theme_color_override("font_color", Style.INK) @@ -162,7 +162,7 @@ func setup(p_main: Main) -> void: v.add_child(hint) var remove := Button.new() - remove.text = "Delete pipe" + remove.text = "Delete thread" remove.add_theme_font_size_override("font_size", 14) var rn := Style.bordered(Style.box(Color(0, 0, 0, 0), 6, [10, 4, 10, 4]), 1, Style.DASH) var rh := Style.bordered(Style.box(Style.WARN_BG, 6, [10, 4, 10, 4]), 1, Style.DANGER_INK) diff --git a/ui/result_tray.gd b/ui/result_tray.gd index 719ec2d..256bada 100644 --- a/ui/result_tray.gd +++ b/ui/result_tray.gd @@ -158,7 +158,7 @@ func setup(p_main: Main) -> void: _tab_earlier.pressed.connect(func() -> void: set_side(Side.EARLIER)) tabs.add_child(_tab_earlier) _tab_vars = _tab("VARIABLES") - _tab_vars.tooltip_text = "Saved variables for this collection" + _tab_vars.tooltip_text = "Saved variables for this spread" _tab_vars.pressed.connect(func() -> void: set_side(Side.VARIABLES)) tabs.add_child(_tab_vars) diff --git a/ui/settings_kind_fields.gd b/ui/settings_kind_fields.gd index a5b8af6..6351b62 100644 --- a/ui/settings_kind_fields.gd +++ b/ui/settings_kind_fields.gd @@ -172,7 +172,7 @@ func build() -> void: box.add_child(pbox) RollTable.KIND_ROUTER: box.add_child(ModalCard.section("Cases (if / else if / otherwise)")) - box.add_child(ModalCard.note("Checked top to bottom when the chain arrives; the first true case is chosen, and its effects, text and pipes run like a rolled result. An empty condition is Otherwise: it always matches, so keep it last. Add, remove and reorder cases on the card.")) + box.add_child(ModalCard.note("Checked top to bottom when the chain arrives; the first true case is chosen, and its effects, text and threads run like a rolled result. An empty condition is Otherwise: it always matches, so keep it last. Add, remove and reorder cases on the card.")) for i in table.entries.size(): var e := table.entries[i] var le := LineEdit.new() @@ -184,7 +184,7 @@ func build() -> void: var label := Formatter.strip_tags(e.text).strip_edges() box.add_child(ModalCard.field("Case %d%s" % [i + 1, (" · " + label) if label != "" else ""], le)) if table.entries.is_empty(): - box.add_child(ModalCard.note("This router has no cases yet: add some on the card.")) + box.add_child(ModalCard.note("This branch has no cases yet: add some on the card.")) _case_note = ModalCard.note("", Style.WARN_INK) box.add_child(_case_note) _: @@ -255,7 +255,7 @@ func refresh() -> void: _minmax_row.visible = _choice == "number" var msg := "" if _choice != table.choice and table.choice == "pick": - msg = "Only the first option is kept, as the Answer result (its changes and pipes stay)." + msg = "Only the first option is kept, as the Answer result (its changes and threads stay)." elif _choice != table.choice and _choice == "pick": msg = "The Answer result becomes the first option; two more are added." elif _choice == "pick" and _options_mode == "vars" and table.is_dynamic(): @@ -265,7 +265,7 @@ func refresh() -> void: elif _choice == "pick": msg = "The player picks one of the card's options, or Random." else: - msg = "The answer goes in {answer}; the Answer result's changes and pipes run after it." + msg = "The answer goes in {answer}; the Answer result's changes and threads run after it." _choice_note.text = msg _mark(_save_as, s["save_as"] == "" or TableSettingsRules._re(TableSettingsRules.SAVE_PATTERN).search(TemplateKit.probe(s["save_as"])) != null) var pick := _choice == "pick" diff --git a/ui/table_card_editing.gd b/ui/table_card_editing.gd index e87c70d..e7f6071 100644 --- a/ui/table_card_editing.gd +++ b/ui/table_card_editing.gd @@ -35,7 +35,7 @@ func text_edit(e: TableEntry, index: int, chosen: bool) -> LineEdit: var loop_rows := TableCardRows.LOOP_ROWS if table.kind == RollTable.KIND_LOOP: edit.placeholder_text = loop_rows[clampi(index, 0, 1)] - edit.tooltip_text = "%s: shown each pass ({i} is the pass number)" % loop_rows[0] if index == 0 else "%s: runs once when the loop ends" % loop_rows[1] + edit.tooltip_text = "%s: shown each pass ({i} is the pass number)" % loop_rows[0] if index == 0 else "%s: runs once when the repeat ends" % loop_rows[1] elif table.kind == RollTable.KIND_ROUTER: edit.placeholder_text = "Result text" edit.text_changed.connect(func(s: String) -> void: diff --git a/ui/table_card_header.gd b/ui/table_card_header.gd index dccad3c..026ed7c 100644 --- a/ui/table_card_header.gd +++ b/ui/table_card_header.gd @@ -258,14 +258,14 @@ func _make_kind_header(_build: bool) -> Control: RollTable.KIND_ROUTER: if not _build: return null - var rl := Style.make_label("Router · the first true case is chosen", Style.body(true), 12, Style.MUTED) + var rl := Style.make_label("Branch · the first true case is chosen", Style.body(true), 12, Style.MUTED) rl.mouse_filter = Control.MOUSE_FILTER_IGNORE rl.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART return rl RollTable.KIND_VARIABLE: var txt := "@%s · %s" % [table.var_name, table.var_type] if table.is_collection(): - txt = "Collection · kept between rolls" if plain else "@%s_* (board values)" % table.var_name + txt = "Collection · kept between rolls" if plain else "@%s_* (spread values)" % table.var_name elif plain: txt = "%s · kept between rolls" % table.var_type.capitalize() var l := Style.make_label(txt, Style.body(true), 12, Style.MUTED) @@ -313,7 +313,7 @@ func make_inputs_box() -> Control: var p := PanelContainer.new() p.mouse_filter = Control.MOUSE_FILTER_PASS p.add_theme_stylebox_override("panel", DashedBox.new()) - p.tooltip_text = "Values a pipe into this card can pass (\"with\"); a roll that starts here uses the starting values" + p.tooltip_text = "Values a thread into this card can pass (\"with\"); a roll that starts here uses the starting values" wrap.add_child(p) var v := TableCard.vbox(2) p.add_child(v) diff --git a/ui/table_card_rows.gd b/ui/table_card_rows.gd index 76b0dd4..fac66af 100644 --- a/ui/table_card_rows.gd +++ b/ui/table_card_rows.gd @@ -117,7 +117,7 @@ func make_row(e: TableEntry, index: int, build: bool, ranged: bool, numw: float) al.size_flags_horizontal = Control.SIZE_EXPAND_FILL al.size_flags_vertical = Control.SIZE_SHRINK_CENTER al.mouse_filter = Control.MOUSE_FILTER_PASS - al.tooltip_text = "Its effects and pipes run after the player answers ({answer} holds the answer)" + al.tooltip_text = "Its effects and threads run after the player answers ({answer} holds the answer)" col.add_child(al) else: if chosen: @@ -336,7 +336,7 @@ func make_sheet_row(e: TableEntry, build: bool) -> Control: var tools := TableCard.vbox(2) if e.effects.strip_edges() != "": tools.add_child(_effects_chip(e)) - var pv := Style.make_label("Preview on the board in Play", Style.body_italic(true), 12, Style.MUTED) + var pv := Style.make_label("Preview on the spread in Play", Style.body_italic(true), 12, Style.MUTED) pv.size_flags_vertical = Control.SIZE_SHRINK_CENTER tools.add_child(pv) v.add_child(tools) diff --git a/ui/table_preview.gd b/ui/table_preview.gd index c9d3a87..abc0191 100644 --- a/ui/table_preview.gd +++ b/ui/table_preview.gd @@ -89,13 +89,13 @@ static func kind_line(t: RollTable) -> String: RollTable.KIND_CHOICE: return "Choice card · " + Describe.choice_label(t.choice).to_lower() RollTable.KIND_LOOP: - return "Loop card" + return "Repeat card" RollTable.KIND_VARIABLE: return "Collection card" if t.is_collection() else "Variable card" RollTable.KIND_SHEET: return "Sheet card" RollTable.KIND_ROUTER: - return "Router · if / else if / otherwise" + return "Branch · if / else if / otherwise" RollTable.KIND_CHECK: return "Check card · " + t.check_dice.strip_edges() var s := "Roll table · " + t.dice_label() diff --git a/ui/table_settings_dialog.gd b/ui/table_settings_dialog.gd index b24d845..35b91ea 100644 --- a/ui/table_settings_dialog.gd +++ b/ui/table_settings_dialog.gd @@ -157,7 +157,7 @@ func _build() -> void: var card_box := VBoxContainer.new() card_box.add_theme_constant_override("separation", 6) - card_box.add_child(section("Card mode")) + card_box.add_child(section("Deck mode")) card_box.add_child(segmented(["Off", "On"], 1 if _card_mode else 0, func(i: int) -> void: _card_mode = i == 1 _refresh() @@ -273,7 +273,7 @@ func _refresh() -> void: if _ranged and not table.is_ranged(): msgs.append("Each entry gets a range sized by its weight; adjust them on the card.") if _ranged and TableSettingsRules.extra_pipe_count(table) > 0: - msgs.append("A range takes one pipe, so extra pipes on a result will be dropped.") + msgs.append("A range takes one thread, so extra threads on a result will be dropped.") if not _ranged and table.is_ranged(): msgs.append("Ranges are removed; results become plain picks.") _type_note.text = " ".join(msgs) diff --git a/ui/table_settings_rules.gd b/ui/table_settings_rules.gd index 4df668b..f9cb48b 100644 --- a/ui/table_settings_rules.gd +++ b/ui/table_settings_rules.gd @@ -41,9 +41,9 @@ static func kind_problems(t: RollTable, s: Dictionary) -> PackedStringArray: RollTable.KIND_LOOP: var src := TemplateKit.probe(str(s.get("loop_expr", t.loop_expr)).strip_edges()) if src == "": - out.append("The loop needs a count or a condition.") + out.append("The repeat needs a count or a condition.") elif Expr.check(src) != "": - out.append("Loop rule: " + Expr.check(src)) + out.append("Repeat rule: " + Expr.check(src)) RollTable.KIND_ROUTER: var cases: Array = s.get("cases", []) for i in cases.size(): diff --git a/ui/template_forms.gd b/ui/template_forms.gd index a9ed51f..795c703 100644 --- a/ui/template_forms.gd +++ b/ui/template_forms.gd @@ -41,7 +41,7 @@ static func save_dialog(tpl: Dictionary, on_save: Callable) -> ModalCard: if p is Dictionary and bool((p as Dictionary).get("outside", false)): outside += 1 if outside > 0: - d.body.add_child(ModalCard.note("%d %s to cards outside the template. When it's inserted they relink to a card with the same name, if there is one." % [outside, "pipe leads" if outside == 1 else "pipes lead"])) + d.body.add_child(ModalCard.note("%d %s to cards outside the template. When it's inserted they relink to a card with the same name, if there is one." % [outside, "thread leads" if outside == 1 else "threads lead"])) d.body.add_child(ModalCard.section("Parameters")) var rows: Array = [] diff --git a/ui/template_picker.gd b/ui/template_picker.gd index efa9960..2442067 100644 --- a/ui/template_picker.gd +++ b/ui/template_picker.gd @@ -188,7 +188,7 @@ func _rename(id: String, old: String) -> void: func _delete(id: String, tname: String) -> void: - main._add_modal(ModalCard.confirm("Delete template", "Delete the template “%s”? Cards already inserted from it stay on their boards." % tname, + main._add_modal(ModalCard.confirm("Delete template", "Delete the template “%s”? Cards already inserted from it stay on their spreads." % tname, "Delete", func() -> void: if lib.delete(id): refresh() diff --git a/ui/test_board_dialog.gd b/ui/test_board_dialog.gd index 1c65a61..12e1ce6 100644 --- a/ui/test_board_dialog.gd +++ b/ui/test_board_dialog.gd @@ -41,7 +41,7 @@ var _report_text := "" ## `p_main` is the Main node (it has `data`, `card_for()`, `board` and, when ## present, `focus_table()`). func _init(p_main: Node = null) -> void: - super._init("Test board", 640.0) + super._init("Test spread", 640.0) main = p_main board = p_main.get("data") if p_main != null else null _build() @@ -242,7 +242,7 @@ func _show_report(report: Dictionary, problems: Array) -> void: var items: Array = [] for p: Dictionary in problems: items.append({"table_id": p["table_id"], "entry_id": p["entry_id"], - "text": "%s%s: %s" % [_table_label(p["table_id"]) if board.get_table(p["table_id"]) != null else "Board", + "text": "%s%s: %s" % [_table_label(p["table_id"]) if board.get_table(p["table_id"]) != null else "Spread", "" if str(p["entry_id"]) == "" else ", result " + str(p["entry_id"]), p["text"]]}) _add_section("Problems", "Static checks", items, true) # Errors: effect / expression errors, unset markers and action-limit halts @@ -389,7 +389,7 @@ func report_text() -> String: func _compose_text(report: Dictionary, problems: Array) -> String: var out := PackedStringArray() - out.append("Test board: %s, starting from %s" % [board.name, _table_label(str(report.get("start", "")))]) + out.append("Test spread: %s, starting from %s" % [board.name, _table_label(str(report.get("start", "")))]) out.append(summary.text) out.append("") out.append("\n".join(BoardTester.format_problems(problems, 1000))) diff --git a/ui/theme_store.gd b/ui/theme_store.gd index 852b69e..6684155 100644 --- a/ui/theme_store.gd +++ b/ui/theme_store.gd @@ -55,7 +55,7 @@ const TOKENS := [ ["VALUE_BORDER", "Value box border", false], ] const PATTERNS := [["none", "None"], ["dots", "Dots"], ["stars", "Stars"]] -const LOGOS := [["fortune_teller", "Fortune teller"], ["none", "None"]] +const LOGOS := [["fortune_teller", "Fortune teller"], ["tower", "Tower"], ["none", "None"]] const CARD_FRAMES := [["ornate", "Beaded"], ["plain", "Plain"]] ## The open spread, handed across the scene reload that applies a theme. diff --git a/ui/value_picker.gd b/ui/value_picker.gd index 570904a..ce9276d 100644 --- a/ui/value_picker.gd +++ b/ui/value_picker.gd @@ -277,7 +277,7 @@ func _ask_new(initial: String) -> void: le.placeholder_text = "e.g. Luck" ModalCard.style_line_edit(le) d.body.add_child(ModalCard.field("Name", le)) - var cb := InspectorKit.check_box("Show on the board", true) + var cb := InspectorKit.check_box("Show on the spread", true) cb.tooltip_text = "Adds a variable card, so the value has a label and a starting value, and shows while you play" d.body.add_child(cb) var hint := ModalCard.note("") diff --git a/ui/variables_panel.gd b/ui/variables_panel.gd index b1f3ce5..02ae872 100644 --- a/ui/variables_panel.gd +++ b/ui/variables_panel.gd @@ -62,7 +62,7 @@ func render() -> void: var names := main.variable_names() _reset_all.disabled = names.is_empty() if names.is_empty(): - var empty := RichText.label("No saved variables yet. A pipe that saves as [color=#%s]@name[/color], a change such as [color=#%s]@hp = 10[/color], or [lb][lb]Table -> @name]] in a result, keeps its value here." % [Style.ACCENT.to_html(false), Style.ACCENT.to_html(false)], + var empty := RichText.label("No saved variables yet. A thread that saves as [color=#%s]@name[/color], a change such as [color=#%s]@hp = 10[/color], or [lb][lb]Table -> @name]] in a result, keeps its value here." % [Style.ACCENT.to_html(false), Style.ACCENT.to_html(false)], 14, Style.ON_BG_MUTED, false) _list.add_child(empty) for n in names: diff --git a/ui/zoom_control.gd b/ui/zoom_control.gd index 5c834d8..7d03609 100644 --- a/ui/zoom_control.gd +++ b/ui/zoom_control.gd @@ -20,10 +20,10 @@ func setup(p_main: Main) -> void: var zout := _step_button("−", "Zoom out", 1.0 / STEP) add_child(zout) menu = ModalCard.bar_menu_button("100% ▾") - menu.tooltip_text = "Zoom: fit the board, 100% or the minimap" + menu.tooltip_text = "Zoom: fit the spread, 100% or the minimap" menu.custom_minimum_size.x = 86 var pm := menu.get_popup() - pm.add_item("Fit board", ID_FIT) + pm.add_item("Fit spread", ID_FIT) pm.set_item_tooltip(pm.get_item_index(ID_FIT), "Show every table") pm.add_item("Zoom to 100%", ID_ACTUAL) pm.add_separator()