Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
|
|
|
class_name Style
|
|
|
|
|
extends RefCounted
|
Theme system: runtime colour tokens, theme sets and a Theme dialog
Style's colours become static vars named by role (BG, PANEL, CARD, THREAD,
ACCENT, TRIM, GLOW…) instead of materials (felt, copper, brass), so a theme
can replace them. Stray hard-coded colours moved into tokens.
ThemeStore applies built-in sets (Tarot, the new default: jewel-purple
cloth with a shine; Felt, the old look) and the user's own sets from
user://themes/. Fills for the background and panels can be gradients; the
background pattern (dots, stars, none) and logo are per set. View ▾ →
Theme… edits a set; changes to a built-in save as a new set. Using a theme
reloads the UI and keeps the open spread.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:10:16 -06:00
|
|
|
## Palette tokens, fonts and stylebox helpers. A theme (ThemeStore) sets the tokens.
|
|
|
|
|
|
|
|
|
|
# Colour tokens. They're static vars, not consts, so a theme can replace them at
|
|
|
|
|
# runtime (ThemeStore.apply). The values here are the built-in fallback ("Felt");
|
|
|
|
|
# the token list with editor labels lives in ThemeStore.TOKENS.
|
|
|
|
|
static var BG := Color("#1f4a39")
|
|
|
|
|
static var BG_DEEP := Color("#12301f")
|
|
|
|
|
static var BG_HOVER := Color("#276048")
|
|
|
|
|
## The top bar, tray and other docked panels.
|
|
|
|
|
static var PANEL := Color("#12301f")
|
|
|
|
|
static var ON_BG := Color("#e9efe9")
|
|
|
|
|
static var ON_BG_MUTED := Color("#a8bdb1")
|
|
|
|
|
static var CARD := Color("#efece2")
|
|
|
|
|
static var CARD_SOFT := Color("#f7f5ee")
|
|
|
|
|
static var CARD_HOVER := Color("#e6dfcd")
|
|
|
|
|
static var CARD_SHADE := Color("#d9d3c2")
|
|
|
|
|
static var INK := Color("#1c2520")
|
|
|
|
|
static var MUTED := Color("#69726b")
|
|
|
|
|
static var FAINT := Color("#9a9483")
|
|
|
|
|
static var RULE := Color("#d8d3c3")
|
|
|
|
|
static var DASH := Color("#bdb6a2")
|
|
|
|
|
static var HOVER_ROW := Color("#e9e4d6")
|
UI pass: striped rows, View/Help menus, zoom control, card ⋯ menu, fuller sample
- Striped result rows (parchment tint, on by default, `striped_rows` setting).
- Top bar: View ▾ (Plain words / Rule text, Collapse/Expand all, Striped rows,
Minimap) and a "− 90% ▾ +" zoom control replace the Plain|Text switch,
Collapse all, −/Fit/+ and Map. Arrange ▾ folds into Board ▾; Search is an icon.
- Help ▾ and F1 open a Help window; the 17 topics live in help/topics.txt.
- Build cards get a ⋯ menu (settings, template, collapse, delete) instead of
the gear and footer Delete, sharing Style.overflow_button with group cards.
Row × buttons show only on hover, focus or selection.
- Sample: Luck value card, Make Camp (pick card) and Search the Ruins
(1d6 + Luck, with results only a modifier reaches).
- New test suite test_top_bar; Canvas/GraphML round-trip tests compare plain
tables only, since logic keys are JSON-only.
- DESIGN.md: open items, including the Card Mode UI redesign.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 10:36:38 -06:00
|
|
|
## Every second result row on a card ("parchment" zebra stripe).
|
Theme system: runtime colour tokens, theme sets and a Theme dialog
Style's colours become static vars named by role (BG, PANEL, CARD, THREAD,
ACCENT, TRIM, GLOW…) instead of materials (felt, copper, brass), so a theme
can replace them. Stray hard-coded colours moved into tokens.
ThemeStore applies built-in sets (Tarot, the new default: jewel-purple
cloth with a shine; Felt, the old look) and the user's own sets from
user://themes/. Fills for the background and panels can be gradients; the
background pattern (dots, stars, none) and logo are per set. View ▾ →
Theme… edits a set; changes to a built-in save as a new set. Using a theme
reloads the UI and keeps the open spread.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:10:16 -06:00
|
|
|
static var STRIPE := Color(0.11, 0.145, 0.125, 0.055)
|
|
|
|
|
## Secondary accent for headings, focus borders and ports.
|
|
|
|
|
static var TRIM := Color("#b8703a")
|
|
|
|
|
static var TRIM_DARK := Color("#4f2b12")
|
|
|
|
|
## Threads between cards (code: pipes).
|
|
|
|
|
static var THREAD := Color("#b8703a")
|
|
|
|
|
static var THREAD_DARK := Color("#4f2b12")
|
|
|
|
|
## Lit and selected things.
|
|
|
|
|
static var ACCENT := Color("#f3c450")
|
|
|
|
|
static var ACCENT_DARK := Color("#6e5410")
|
|
|
|
|
static var LIT := Color("#f8e4a2")
|
|
|
|
|
static var FLICK := Color(0.953, 0.769, 0.314, 0.35)
|
|
|
|
|
static var PULSE := Color("#fff6d2")
|
|
|
|
|
## Magic sparkle colour for glows and particles.
|
|
|
|
|
static var GLOW := Color("#f3c450")
|
|
|
|
|
static var DANGER := Color("#e0574a")
|
|
|
|
|
static var DANGER_INK := Color("#a33a2c")
|
|
|
|
|
static var BAD_INK_ON_BG := Color("#ffb1a3")
|
|
|
|
|
static var WARN_BG := Color("#f4dacb")
|
|
|
|
|
static var WARN_INK := Color("#8a2f1d")
|
Plain Build display: plain rules on cards, pipes and tray, Why this?, check/collection/inputs visuals
- RulesView (ui/rules_view.gd): plain-or-text helpers over Describe, reading
Main.rules_plain() when present (else StateStore, else plain; --rules=text
for screenshots) and refreshing on Main.rules_view_changed.
- Cards: effect chips, router cases, option sources, show_if, loop rules,
expression dice and variable kinds read in plain words. Build cards drop the
inline effects / show_if / condition / details editors for plain chips;
result text and names stay inline. Row clicks call main.select_result();
the selected row gets a copper bar (set_selected_entry / inspector_selection).
- Check cards: 2D badge, the rule as a sentence, Success / Failure outlets.
Collection cards: live members and "+ Add" (main.select_card). Inputs:
a dashed "Input Tier · starts at 1" box.
- Pipe labels via Describe.pipe, nudged apart and cut to the gap.
- Tray: plain captions (inputs, checks, cases), effect lines from why facts,
and a "Why this?" button opening a WhyPopover; hovers show the same reasons.
- Previews and the choice pop-up read conditions, effects and option sources
in plain words. Style.rules_switch() for the Plain words / Text switch.
- Describe: empty text reads "empty" ("Loot is not empty").
- tests/test_plain_display.gd; option and choice tests pin the Text view
where they check stored text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 21:30:55 -06:00
|
|
|
## A check card's Success and Failure outlets.
|
Theme system: runtime colour tokens, theme sets and a Theme dialog
Style's colours become static vars named by role (BG, PANEL, CARD, THREAD,
ACCENT, TRIM, GLOW…) instead of materials (felt, copper, brass), so a theme
can replace them. Stray hard-coded colours moved into tokens.
ThemeStore applies built-in sets (Tarot, the new default: jewel-purple
cloth with a shine; Felt, the old look) and the user's own sets from
user://themes/. Fills for the background and panels can be gradients; the
background pattern (dots, stars, none) and logo are per set. View ▾ →
Theme… edits a set; changes to a built-in save as a new set. Using a theme
reloads the UI and keeps the open spread.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:10:16 -06:00
|
|
|
static var OK_INK := Color("#2f6b3f")
|
|
|
|
|
static var NO_INK := Color("#8a2f1d")
|
|
|
|
|
## [[Table]] reference chips and {value} markers, on cards and on the board.
|
|
|
|
|
static var REF_INK := Color("#1d6656")
|
|
|
|
|
static var REF_BG := Color("#d6e9e2")
|
|
|
|
|
static var REF_INK_ON_BG := Color("#9fdcc9")
|
|
|
|
|
static var VALUE_INK := Color("#7d5a0c")
|
|
|
|
|
static var VALUE_INK_ON_BG := Color("#f3c450")
|
|
|
|
|
static var VALUE_BG := Color("#fdf6dc")
|
|
|
|
|
static var VALUE_BORDER := Color("#e3c97a")
|
|
|
|
|
## Large-area fills: {kind: "solid"|"linear"|"radial", colors: [...], angle, center}.
|
|
|
|
|
## Empty means flat BG / PANEL. See fill_texture().
|
|
|
|
|
static var BG_FILL: Dictionary = {}
|
|
|
|
|
static var PANEL_FILL: Dictionary = {}
|
|
|
|
|
## The board's background pattern: "none", "dots" or "stars".
|
|
|
|
|
static var PATTERN := "dots"
|
|
|
|
|
## The logo shown in the top bar ("none" for none).
|
|
|
|
|
static var LOGO := "none"
|
2026-11-10 18:20:46 -06:00
|
|
|
## Card border art: "ornate" (CardFrame) or "plain".
|
|
|
|
|
static var CARD_FRAME := "plain"
|
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
|
|
|
|
Theme fonts: 13 bundled families and text/title pickers in the theme editor
Standard (Inter, Source Sans 3, Lora, Rokkitt), easy to read (Atkinson
Hyperlegible, Lexend, Andika, OpenDyslexic) and themed title faces (Cinzel,
IM Fell English, Uncial Antiqua, Orbitron, Special Elite). All OFL except
Special Elite (Apache 2.0); licence files sit beside the fonts. FontCatalog
builds faces, synthesising missing bold/italic.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 08:16:39 -06:00
|
|
|
## The theme's font families (FontCatalog ids).
|
|
|
|
|
static var BODY_FONT := FontCatalog.DEFAULT_BODY
|
|
|
|
|
static var DISPLAY_FONT := FontCatalog.DEFAULT_DISPLAY
|
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
|
|
|
|
|
|
|
|
static var _fonts: Dictionary = {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ---------- Fonts ----------
|
Theme fonts: 13 bundled families and text/title pickers in the theme editor
Standard (Inter, Source Sans 3, Lora, Rokkitt), easy to read (Atkinson
Hyperlegible, Lexend, Andika, OpenDyslexic) and themed title faces (Cinzel,
IM Fell English, Uncial Antiqua, Orbitron, Special Elite). All OFL except
Special Elite (Apache 2.0); licence files sit beside the fonts. FontCatalog
builds faces, synthesising missing bold/italic.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 08:16:39 -06:00
|
|
|
# Cards live on the zoomable board, so their fonts stay sharp at any scale
|
|
|
|
|
# (FontCatalog picks MSDF or oversampling per family).
|
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
|
|
|
|
Theme fonts: 13 bundled families and text/title pickers in the theme editor
Standard (Inter, Source Sans 3, Lora, Rokkitt), easy to read (Atkinson
Hyperlegible, Lexend, Andika, OpenDyslexic) and themed title faces (Cinzel,
IM Fell English, Uncial Antiqua, Orbitron, Special Elite). All OFL except
Special Elite (Apache 2.0); licence files sit beside the fonts. FontCatalog
builds faces, synthesising missing bold/italic.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 08:16:39 -06:00
|
|
|
## Sets the theme's families and drops cached faces.
|
|
|
|
|
static func set_fonts(body_id: String, display_id: String) -> void:
|
|
|
|
|
BODY_FONT = FontCatalog.resolve(body_id, "body")
|
|
|
|
|
DISPLAY_FONT = FontCatalog.resolve(display_id, "display")
|
|
|
|
|
_fonts.clear()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static func _face(family: String, weight: int, italic: bool, zoomable: bool) -> Font:
|
|
|
|
|
var key := "%s|%d|%s|%s" % [family, weight, italic, zoomable]
|
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
|
|
|
if not _fonts.has(key):
|
Theme fonts: 13 bundled families and text/title pickers in the theme editor
Standard (Inter, Source Sans 3, Lora, Rokkitt), easy to read (Atkinson
Hyperlegible, Lexend, Andika, OpenDyslexic) and themed title faces (Cinzel,
IM Fell English, Uncial Antiqua, Orbitron, Special Elite). All OFL except
Special Elite (Apache 2.0); licence files sit beside the fonts. FontCatalog
builds faces, synthesising missing bold/italic.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 08:16:39 -06:00
|
|
|
_fonts[key] = FontCatalog.face(family, weight, italic, zoomable)
|
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
|
|
|
return _fonts[key]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static func body(msdf: bool = false) -> Font:
|
Theme fonts: 13 bundled families and text/title pickers in the theme editor
Standard (Inter, Source Sans 3, Lora, Rokkitt), easy to read (Atkinson
Hyperlegible, Lexend, Andika, OpenDyslexic) and themed title faces (Cinzel,
IM Fell English, Uncial Antiqua, Orbitron, Special Elite). All OFL except
Special Elite (Apache 2.0); licence files sit beside the fonts. FontCatalog
builds faces, synthesising missing bold/italic.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 08:16:39 -06:00
|
|
|
return _face(BODY_FONT, 400, false, msdf)
|
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
static func body_bold(msdf: bool = false) -> Font:
|
Theme fonts: 13 bundled families and text/title pickers in the theme editor
Standard (Inter, Source Sans 3, Lora, Rokkitt), easy to read (Atkinson
Hyperlegible, Lexend, Andika, OpenDyslexic) and themed title faces (Cinzel,
IM Fell English, Uncial Antiqua, Orbitron, Special Elite). All OFL except
Special Elite (Apache 2.0); licence files sit beside the fonts. FontCatalog
builds faces, synthesising missing bold/italic.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 08:16:39 -06:00
|
|
|
return _face(BODY_FONT, 700, false, msdf)
|
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
static func body_italic(msdf: bool = false) -> Font:
|
Theme fonts: 13 bundled families and text/title pickers in the theme editor
Standard (Inter, Source Sans 3, Lora, Rokkitt), easy to read (Atkinson
Hyperlegible, Lexend, Andika, OpenDyslexic) and themed title faces (Cinzel,
IM Fell English, Uncial Antiqua, Orbitron, Special Elite). All OFL except
Special Elite (Apache 2.0); licence files sit beside the fonts. FontCatalog
builds faces, synthesising missing bold/italic.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 08:16:39 -06:00
|
|
|
return _face(BODY_FONT, 400, true, msdf)
|
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
|
|
|
|
|
|
|
|
|
Theme fonts: 13 bundled families and text/title pickers in the theme editor
Standard (Inter, Source Sans 3, Lora, Rokkitt), easy to read (Atkinson
Hyperlegible, Lexend, Andika, OpenDyslexic) and themed title faces (Cinzel,
IM Fell English, Uncial Antiqua, Orbitron, Special Elite). All OFL except
Special Elite (Apache 2.0); licence files sit beside the fonts. FontCatalog
builds faces, synthesising missing bold/italic.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 08:16:39 -06:00
|
|
|
## The display (title) face, by default the Rokkitt slab.
|
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
|
|
|
static func display(zoomable: bool = false, weight: int = 700) -> Font:
|
Theme fonts: 13 bundled families and text/title pickers in the theme editor
Standard (Inter, Source Sans 3, Lora, Rokkitt), easy to read (Atkinson
Hyperlegible, Lexend, Andika, OpenDyslexic) and themed title faces (Cinzel,
IM Fell English, Uncial Antiqua, Orbitron, Special Elite). All OFL except
Special Elite (Apache 2.0); licence files sit beside the fonts. FontCatalog
builds faces, synthesising missing bold/italic.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 08:16:39 -06:00
|
|
|
return _face(DISPLAY_FONT, weight, false, zoomable)
|
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
## Bold body face with a little letter-spacing, for small uppercase labels.
|
|
|
|
|
static func caps() -> Font:
|
|
|
|
|
if not _fonts.has("caps"):
|
|
|
|
|
var v := FontVariation.new()
|
|
|
|
|
v.base_font = body_bold()
|
|
|
|
|
v.spacing_glyph = 1
|
|
|
|
|
_fonts["caps"] = v
|
|
|
|
|
return _fonts["caps"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ---------- Styleboxes ----------
|
|
|
|
|
|
|
|
|
|
## margins: [left, top, right, bottom]
|
|
|
|
|
static func box(bg: Color, radius: int = 0, margins: Array = [0, 0, 0, 0]) -> StyleBoxFlat:
|
|
|
|
|
var s := StyleBoxFlat.new()
|
|
|
|
|
s.bg_color = bg
|
|
|
|
|
s.set_corner_radius_all(radius)
|
|
|
|
|
s.content_margin_left = margins[0]
|
|
|
|
|
s.content_margin_top = margins[1]
|
|
|
|
|
s.content_margin_right = margins[2]
|
|
|
|
|
s.content_margin_bottom = margins[3]
|
|
|
|
|
s.anti_aliasing = true
|
|
|
|
|
return s
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static func bordered(s: StyleBoxFlat, width: int, color: Color) -> StyleBoxFlat:
|
|
|
|
|
s.set_border_width_all(width)
|
|
|
|
|
s.border_color = color
|
|
|
|
|
return s
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static func focus_ring(radius: int = 8) -> StyleBoxFlat:
|
|
|
|
|
var s := box(Color(0, 0, 0, 0), radius)
|
|
|
|
|
s.draw_center = false
|
Theme system: runtime colour tokens, theme sets and a Theme dialog
Style's colours become static vars named by role (BG, PANEL, CARD, THREAD,
ACCENT, TRIM, GLOW…) instead of materials (felt, copper, brass), so a theme
can replace them. Stray hard-coded colours moved into tokens.
ThemeStore applies built-in sets (Tarot, the new default: jewel-purple
cloth with a shine; Felt, the old look) and the user's own sets from
user://themes/. Fills for the background and panels can be gradients; the
background pattern (dots, stars, none) and logo are per set. View ▾ →
Theme… edits a set; changes to a built-in save as a new set. Using a theme
reloads the UI and keeps the open spread.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:10:16 -06:00
|
|
|
bordered(s, 2, ACCENT)
|
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
|
|
|
s.set_expand_margin_all(2)
|
|
|
|
|
return s
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static func skin_button(b: Button, normal: StyleBox, hover: StyleBox, pressed: StyleBox,
|
|
|
|
|
fg: Color, fg_hover: Color = Color(0, 0, 0, 0), fg_pressed: Color = Color(0, 0, 0, 0)) -> void:
|
|
|
|
|
if fg_hover.a == 0.0:
|
|
|
|
|
fg_hover = fg
|
|
|
|
|
if fg_pressed.a == 0.0:
|
|
|
|
|
fg_pressed = fg_hover
|
|
|
|
|
b.add_theme_stylebox_override("normal", normal)
|
|
|
|
|
b.add_theme_stylebox_override("hover", hover)
|
|
|
|
|
b.add_theme_stylebox_override("pressed", pressed)
|
|
|
|
|
b.add_theme_stylebox_override("hover_pressed", pressed)
|
|
|
|
|
b.add_theme_stylebox_override("disabled", normal)
|
|
|
|
|
b.add_theme_stylebox_override("focus", focus_ring())
|
|
|
|
|
b.add_theme_color_override("font_color", fg)
|
|
|
|
|
b.add_theme_color_override("font_hover_color", fg_hover)
|
|
|
|
|
b.add_theme_color_override("font_focus_color", fg)
|
|
|
|
|
b.add_theme_color_override("font_pressed_color", fg_pressed)
|
|
|
|
|
b.add_theme_color_override("font_hover_pressed_color", fg_pressed)
|
|
|
|
|
b.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static func make_label(text: String, font: Font, font_size: int, color: Color) -> Label:
|
|
|
|
|
var l := Label.new()
|
|
|
|
|
l.text = text
|
|
|
|
|
l.add_theme_font_override("font", font)
|
|
|
|
|
l.add_theme_font_size_override("font_size", font_size)
|
|
|
|
|
l.add_theme_color_override("font_color", color)
|
|
|
|
|
return l
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## A top-bar button: translucent on felt, or brass when primary.
|
|
|
|
|
static func bar_button(text: String, primary: bool = false) -> Button:
|
|
|
|
|
var b := Button.new()
|
|
|
|
|
b.text = text
|
|
|
|
|
var normal := bordered(box(Color(1, 1, 1, 0.04), 8, [12, 6, 12, 6]), 1, Color(1, 1, 1, 0.16))
|
|
|
|
|
var hover := bordered(box(Color(1, 1, 1, 0.1), 8, [12, 6, 12, 6]), 1, Color(1, 1, 1, 0.16))
|
Theme system: runtime colour tokens, theme sets and a Theme dialog
Style's colours become static vars named by role (BG, PANEL, CARD, THREAD,
ACCENT, TRIM, GLOW…) instead of materials (felt, copper, brass), so a theme
can replace them. Stray hard-coded colours moved into tokens.
ThemeStore applies built-in sets (Tarot, the new default: jewel-purple
cloth with a shine; Felt, the old look) and the user's own sets from
user://themes/. Fills for the background and panels can be gradients; the
background pattern (dots, stars, none) and logo are per set. View ▾ →
Theme… edits a set; changes to a built-in save as a new set. Using a theme
reloads the UI and keeps the open spread.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:10:16 -06:00
|
|
|
var fg := ON_BG
|
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
|
|
|
if primary:
|
Theme system: runtime colour tokens, theme sets and a Theme dialog
Style's colours become static vars named by role (BG, PANEL, CARD, THREAD,
ACCENT, TRIM, GLOW…) instead of materials (felt, copper, brass), so a theme
can replace them. Stray hard-coded colours moved into tokens.
ThemeStore applies built-in sets (Tarot, the new default: jewel-purple
cloth with a shine; Felt, the old look) and the user's own sets from
user://themes/. Fills for the background and panels can be gradients; the
background pattern (dots, stars, none) and logo are per set. View ▾ →
Theme… edits a set; changes to a built-in save as a new set. Using a theme
reloads the UI and keeps the open spread.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:10:16 -06:00
|
|
|
normal = bordered(box(ACCENT, 8, [12, 6, 12, 6]), 1, ACCENT)
|
|
|
|
|
hover = bordered(box(ACCENT.lightened(0.15), 8, [12, 6, 12, 6]), 1, ACCENT.lightened(0.15))
|
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
|
|
|
fg = INK
|
|
|
|
|
b.add_theme_font_override("font", body_bold())
|
|
|
|
|
skin_button(b, normal, hover, hover, fg)
|
|
|
|
|
b.add_theme_font_size_override("font_size", 15)
|
|
|
|
|
return b
|
|
|
|
|
|
|
|
|
|
|
2026-11-09 08:21:26 -06:00
|
|
|
## A MenuButton skinned like bar_button (copies its boxes and colours onto
|
|
|
|
|
## `onto`, or a new MenuButton). The caller styles the popup.
|
|
|
|
|
static func menu_button(text: String, primary: bool = false, onto: MenuButton = null) -> MenuButton:
|
|
|
|
|
var mb := onto if onto else MenuButton.new()
|
|
|
|
|
mb.text = text
|
|
|
|
|
var ref := bar_button(text, primary)
|
|
|
|
|
for n in ["normal", "hover", "pressed", "hover_pressed", "disabled", "focus"]:
|
|
|
|
|
mb.add_theme_stylebox_override(n, ref.get_theme_stylebox(n))
|
|
|
|
|
for c in BUTTON_FONT_COLORS:
|
|
|
|
|
mb.add_theme_color_override(c, ref.get_theme_color(c))
|
|
|
|
|
ref.free()
|
|
|
|
|
if primary:
|
|
|
|
|
mb.add_theme_font_override("font", body_bold())
|
|
|
|
|
mb.add_theme_font_size_override("font_size", 15)
|
|
|
|
|
mb.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND
|
|
|
|
|
mb.flat = false
|
|
|
|
|
return mb
|
|
|
|
|
|
|
|
|
|
|
UI pass: striped rows, View/Help menus, zoom control, card ⋯ menu, fuller sample
- Striped result rows (parchment tint, on by default, `striped_rows` setting).
- Top bar: View ▾ (Plain words / Rule text, Collapse/Expand all, Striped rows,
Minimap) and a "− 90% ▾ +" zoom control replace the Plain|Text switch,
Collapse all, −/Fit/+ and Map. Arrange ▾ folds into Board ▾; Search is an icon.
- Help ▾ and F1 open a Help window; the 17 topics live in help/topics.txt.
- Build cards get a ⋯ menu (settings, template, collapse, delete) instead of
the gear and footer Delete, sharing Style.overflow_button with group cards.
Row × buttons show only on hover, focus or selection.
- Sample: Luck value card, Make Camp (pick card) and Search the Ruins
(1d6 + Luck, with results only a modifier reaches).
- New test suite test_top_bar; Canvas/GraphML round-trip tests compare plain
tables only, since logic keys are JSON-only.
- DESIGN.md: open items, including the Card Mode UI redesign.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 10:36:38 -06:00
|
|
|
## A "⋯" overflow menu button (group cards and Build-mode table cards), with
|
|
|
|
|
## its popup styled. `on_felt` picks the light-on-felt look.
|
|
|
|
|
static func overflow_button(tooltip: String, on_felt: bool = false) -> MenuButton:
|
|
|
|
|
var mb := MenuButton.new()
|
|
|
|
|
mb.text = "⋯"
|
|
|
|
|
mb.flat = false
|
|
|
|
|
mb.tooltip_text = tooltip
|
|
|
|
|
mb.custom_minimum_size = Vector2(30, 26)
|
|
|
|
|
mb.size_flags_vertical = Control.SIZE_SHRINK_CENTER
|
|
|
|
|
mb.add_theme_font_override("font", body_bold(true))
|
|
|
|
|
mb.add_theme_font_size_override("font_size", 16)
|
Theme system: runtime colour tokens, theme sets and a Theme dialog
Style's colours become static vars named by role (BG, PANEL, CARD, THREAD,
ACCENT, TRIM, GLOW…) instead of materials (felt, copper, brass), so a theme
can replace them. Stray hard-coded colours moved into tokens.
ThemeStore applies built-in sets (Tarot, the new default: jewel-purple
cloth with a shine; Felt, the old look) and the user's own sets from
user://themes/. Fills for the background and panels can be gradients; the
background pattern (dots, stars, none) and logo are per set. View ▾ →
Theme… edits a set; changes to a built-in save as a new set. Using a theme
reloads the UI and keeps the open spread.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:10:16 -06:00
|
|
|
var hover := box(Color(1, 1, 1, 0.1) if on_felt else Style.CARD_HOVER, 6)
|
UI pass: striped rows, View/Help menus, zoom control, card ⋯ menu, fuller sample
- Striped result rows (parchment tint, on by default, `striped_rows` setting).
- Top bar: View ▾ (Plain words / Rule text, Collapse/Expand all, Striped rows,
Minimap) and a "− 90% ▾ +" zoom control replace the Plain|Text switch,
Collapse all, −/Fit/+ and Map. Arrange ▾ folds into Board ▾; Search is an icon.
- Help ▾ and F1 open a Help window; the 17 topics live in help/topics.txt.
- Build cards get a ⋯ menu (settings, template, collapse, delete) instead of
the gear and footer Delete, sharing Style.overflow_button with group cards.
Row × buttons show only on hover, focus or selection.
- Sample: Luck value card, Make Camp (pick card) and Search the Ruins
(1d6 + Luck, with results only a modifier reaches).
- New test suite test_top_bar; Canvas/GraphML round-trip tests compare plain
tables only, since logic keys are JSON-only.
- DESIGN.md: open items, including the Card Mode UI redesign.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 10:36:38 -06:00
|
|
|
for n in ["normal", "disabled", "focus"]:
|
|
|
|
|
mb.add_theme_stylebox_override(n, box(Color(0, 0, 0, 0), 6))
|
|
|
|
|
for n in ["hover", "pressed", "hover_pressed"]:
|
|
|
|
|
mb.add_theme_stylebox_override(n, hover)
|
Theme system: runtime colour tokens, theme sets and a Theme dialog
Style's colours become static vars named by role (BG, PANEL, CARD, THREAD,
ACCENT, TRIM, GLOW…) instead of materials (felt, copper, brass), so a theme
can replace them. Stray hard-coded colours moved into tokens.
ThemeStore applies built-in sets (Tarot, the new default: jewel-purple
cloth with a shine; Felt, the old look) and the user's own sets from
user://themes/. Fills for the background and panels can be gradients; the
background pattern (dots, stars, none) and logo are per set. View ▾ →
Theme… edits a set; changes to a built-in save as a new set. Using a theme
reloads the UI and keeps the open spread.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:10:16 -06:00
|
|
|
font_colors(mb, ON_BG if on_felt else MUTED)
|
UI pass: striped rows, View/Help menus, zoom control, card ⋯ menu, fuller sample
- Striped result rows (parchment tint, on by default, `striped_rows` setting).
- Top bar: View ▾ (Plain words / Rule text, Collapse/Expand all, Striped rows,
Minimap) and a "− 90% ▾ +" zoom control replace the Plain|Text switch,
Collapse all, −/Fit/+ and Map. Arrange ▾ folds into Board ▾; Search is an icon.
- Help ▾ and F1 open a Help window; the 17 topics live in help/topics.txt.
- Build cards get a ⋯ menu (settings, template, collapse, delete) instead of
the gear and footer Delete, sharing Style.overflow_button with group cards.
Row × buttons show only on hover, focus or selection.
- Sample: Luck value card, Make Camp (pick card) and Search the Ruins
(1d6 + Luck, with results only a modifier reaches).
- New test suite test_top_bar; Canvas/GraphML round-trip tests compare plain
tables only, since logic keys are JSON-only.
- DESIGN.md: open items, including the Card Mode UI redesign.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 10:36:38 -06:00
|
|
|
mb.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND
|
|
|
|
|
ModalCard.style_popup(mb.get_popup())
|
|
|
|
|
return mb
|
|
|
|
|
|
|
|
|
|
|
2026-11-09 08:21:26 -06:00
|
|
|
const BUTTON_FONT_COLORS: Array[String] = ["font_color", "font_hover_color", "font_focus_color",
|
|
|
|
|
"font_pressed_color", "font_hover_pressed_color"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## One font colour for every state of a button (normal, hover, focus, pressed).
|
|
|
|
|
static func font_colors(c: Control, color: Color) -> void:
|
|
|
|
|
for n in BUTTON_FONT_COLORS:
|
|
|
|
|
c.add_theme_color_override(n, color)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Ink text, caret, brass selection and muted placeholder for a LineEdit or TextEdit.
|
|
|
|
|
static func field_colors(c: Control) -> void:
|
|
|
|
|
c.add_theme_color_override("font_color", INK)
|
|
|
|
|
c.add_theme_color_override("caret_color", INK)
|
Theme system: runtime colour tokens, theme sets and a Theme dialog
Style's colours become static vars named by role (BG, PANEL, CARD, THREAD,
ACCENT, TRIM, GLOW…) instead of materials (felt, copper, brass), so a theme
can replace them. Stray hard-coded colours moved into tokens.
ThemeStore applies built-in sets (Tarot, the new default: jewel-purple
cloth with a shine; Felt, the old look) and the user's own sets from
user://themes/. Fills for the background and panels can be gradients; the
background pattern (dots, stars, none) and logo are per set. View ▾ →
Theme… edits a set; changes to a built-in save as a new set. Using a theme
reloads the UI and keeps the open spread.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:10:16 -06:00
|
|
|
c.add_theme_color_override("selection_color", Color(ACCENT, 0.55))
|
2026-11-09 08:21:26 -06:00
|
|
|
c.add_theme_color_override("font_placeholder_color", MUTED)
|
|
|
|
|
|
|
|
|
|
|
Plain Build display: plain rules on cards, pipes and tray, Why this?, check/collection/inputs visuals
- RulesView (ui/rules_view.gd): plain-or-text helpers over Describe, reading
Main.rules_plain() when present (else StateStore, else plain; --rules=text
for screenshots) and refreshing on Main.rules_view_changed.
- Cards: effect chips, router cases, option sources, show_if, loop rules,
expression dice and variable kinds read in plain words. Build cards drop the
inline effects / show_if / condition / details editors for plain chips;
result text and names stay inline. Row clicks call main.select_result();
the selected row gets a copper bar (set_selected_entry / inspector_selection).
- Check cards: 2D badge, the rule as a sentence, Success / Failure outlets.
Collection cards: live members and "+ Add" (main.select_card). Inputs:
a dashed "Input Tier · starts at 1" box.
- Pipe labels via Describe.pipe, nudged apart and cut to the gap.
- Tray: plain captions (inputs, checks, cases), effect lines from why facts,
and a "Why this?" button opening a WhyPopover; hovers show the same reasons.
- Previews and the choice pop-up read conditions, effects and option sources
in plain words. Style.rules_switch() for the Plain words / Text switch.
- Describe: empty text reads "empty" ("Loot is not empty").
- tests/test_plain_display.gd; option and choice tests pin the Text view
where they check stored text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 21:30:55 -06:00
|
|
|
## The Plain words / Text switch's look (docs/PLAIN.md §5; the switch itself
|
|
|
|
|
## is Main's): two segment buttons on the felt, the chosen one card-coloured.
|
|
|
|
|
## Adds them to `into` and returns [plain_button, text_button]; `on_change`
|
|
|
|
|
## gets true for Plain words.
|
|
|
|
|
static func rules_switch(into: HBoxContainer, is_plain: bool, on_change: Callable) -> Array[Button]:
|
|
|
|
|
var group := ButtonGroup.new()
|
|
|
|
|
var out: Array[Button] = []
|
|
|
|
|
for k in 2:
|
|
|
|
|
var b := Button.new()
|
|
|
|
|
b.text = "Plain words" if k == 0 else "Text"
|
|
|
|
|
b.toggle_mode = true
|
|
|
|
|
b.button_group = group
|
|
|
|
|
b.button_pressed = (k == 0) == is_plain
|
|
|
|
|
b.tooltip_text = "Show rules in plain words" if k == 0 else "Show rules as their stored text"
|
|
|
|
|
var n := box(Color(0, 0, 0, 0), 7, [11, 4, 11, 5])
|
|
|
|
|
var h := box(Color(1, 1, 1, 0.08), 7, [11, 4, 11, 5])
|
|
|
|
|
var on := box(CARD, 7, [11, 4, 11, 5])
|
Theme system: runtime colour tokens, theme sets and a Theme dialog
Style's colours become static vars named by role (BG, PANEL, CARD, THREAD,
ACCENT, TRIM, GLOW…) instead of materials (felt, copper, brass), so a theme
can replace them. Stray hard-coded colours moved into tokens.
ThemeStore applies built-in sets (Tarot, the new default: jewel-purple
cloth with a shine; Felt, the old look) and the user's own sets from
user://themes/. Fills for the background and panels can be gradients; the
background pattern (dots, stars, none) and logo are per set. View ▾ →
Theme… edits a set; changes to a built-in save as a new set. Using a theme
reloads the UI and keeps the open spread.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:10:16 -06:00
|
|
|
skin_button(b, n, h, on, ON_BG_MUTED, ON_BG, INK)
|
Plain Build display: plain rules on cards, pipes and tray, Why this?, check/collection/inputs visuals
- RulesView (ui/rules_view.gd): plain-or-text helpers over Describe, reading
Main.rules_plain() when present (else StateStore, else plain; --rules=text
for screenshots) and refreshing on Main.rules_view_changed.
- Cards: effect chips, router cases, option sources, show_if, loop rules,
expression dice and variable kinds read in plain words. Build cards drop the
inline effects / show_if / condition / details editors for plain chips;
result text and names stay inline. Row clicks call main.select_result();
the selected row gets a copper bar (set_selected_entry / inspector_selection).
- Check cards: 2D badge, the rule as a sentence, Success / Failure outlets.
Collection cards: live members and "+ Add" (main.select_card). Inputs:
a dashed "Input Tier · starts at 1" box.
- Pipe labels via Describe.pipe, nudged apart and cut to the gap.
- Tray: plain captions (inputs, checks, cases), effect lines from why facts,
and a "Why this?" button opening a WhyPopover; hovers show the same reasons.
- Previews and the choice pop-up read conditions, effects and option sources
in plain words. Style.rules_switch() for the Plain words / Text switch.
- Describe: empty text reads "empty" ("Loot is not empty").
- tests/test_plain_display.gd; option and choice tests pin the Text view
where they check stored text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 21:30:55 -06:00
|
|
|
b.add_theme_font_override("font", body_bold())
|
|
|
|
|
b.add_theme_font_size_override("font_size", 13)
|
|
|
|
|
var want := k == 0
|
|
|
|
|
b.pressed.connect(func() -> void: on_change.call(want))
|
|
|
|
|
into.add_child(b)
|
|
|
|
|
out.append(b)
|
|
|
|
|
return out
|
|
|
|
|
|
|
|
|
|
|
Theme system: runtime colour tokens, theme sets and a Theme dialog
Style's colours become static vars named by role (BG, PANEL, CARD, THREAD,
ACCENT, TRIM, GLOW…) instead of materials (felt, copper, brass), so a theme
can replace them. Stray hard-coded colours moved into tokens.
ThemeStore applies built-in sets (Tarot, the new default: jewel-purple
cloth with a shine; Felt, the old look) and the user's own sets from
user://themes/. Fills for the background and panels can be gradients; the
background pattern (dots, stars, none) and logo are per set. View ▾ →
Theme… edits a set; changes to a built-in save as a new set. Using a theme
reloads the UI and keeps the open spread.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:10:16 -06:00
|
|
|
# ---------- Fills ----------
|
|
|
|
|
|
|
|
|
|
## A texture for a gradient fill spec, or null when the spec is flat (fewer
|
|
|
|
|
## than two colours, or kind "solid").
|
|
|
|
|
static func fill_texture(fill: Dictionary) -> GradientTexture2D:
|
|
|
|
|
var cols: Array = fill.get("colors", [])
|
|
|
|
|
if cols.size() < 2 or str(fill.get("kind", "solid")) == "solid":
|
|
|
|
|
return null
|
|
|
|
|
var g := Gradient.new()
|
|
|
|
|
g.offsets = PackedFloat32Array()
|
|
|
|
|
g.colors = PackedColorArray()
|
|
|
|
|
for i in cols.size():
|
|
|
|
|
g.add_point(float(i) / float(cols.size() - 1), Color.from_string(str(cols[i]), Color.BLACK))
|
|
|
|
|
var t := GradientTexture2D.new()
|
|
|
|
|
t.gradient = g
|
|
|
|
|
t.width = 256
|
|
|
|
|
t.height = 256
|
|
|
|
|
if str(fill["kind"]) == "radial":
|
|
|
|
|
var c: Array = fill.get("center", [0.5, 0.5])
|
|
|
|
|
t.fill = GradientTexture2D.FILL_RADIAL
|
|
|
|
|
t.fill_from = Vector2(float(c[0]), float(c[1]))
|
|
|
|
|
t.fill_to = t.fill_from + Vector2(0.75, 0.0)
|
|
|
|
|
else:
|
|
|
|
|
var a := deg_to_rad(float(fill.get("angle", 90)))
|
|
|
|
|
var dir := Vector2(cos(a), sin(a)) * 0.5
|
|
|
|
|
t.fill_from = Vector2(0.5, 0.5) - dir
|
|
|
|
|
t.fill_to = Vector2(0.5, 0.5) + dir
|
|
|
|
|
return t
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## The background for docked panels: the theme's panel gradient, or flat PANEL.
|
|
|
|
|
static func panel_box(margins: Array = [0, 0, 0, 0]) -> StyleBox:
|
|
|
|
|
var tex := fill_texture(PANEL_FILL)
|
|
|
|
|
if tex == null:
|
|
|
|
|
return box(PANEL, 0, margins)
|
|
|
|
|
var sb := StyleBoxTexture.new()
|
|
|
|
|
sb.texture = tex
|
|
|
|
|
sb.content_margin_left = margins[0]
|
|
|
|
|
sb.content_margin_top = margins[1]
|
|
|
|
|
sb.content_margin_right = margins[2]
|
|
|
|
|
sb.content_margin_bottom = margins[3]
|
|
|
|
|
return sb
|
|
|
|
|
|
|
|
|
|
|
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
|
|
|
# ---------- Themes ----------
|
|
|
|
|
|
|
|
|
|
static func app_theme() -> Theme:
|
|
|
|
|
var th := Theme.new()
|
|
|
|
|
th.default_font = body()
|
|
|
|
|
th.default_font_size = 16
|
Theme system: runtime colour tokens, theme sets and a Theme dialog
Style's colours become static vars named by role (BG, PANEL, CARD, THREAD,
ACCENT, TRIM, GLOW…) instead of materials (felt, copper, brass), so a theme
can replace them. Stray hard-coded colours moved into tokens.
ThemeStore applies built-in sets (Tarot, the new default: jewel-purple
cloth with a shine; Felt, the old look) and the user's own sets from
user://themes/. Fills for the background and panels can be gradients; the
background pattern (dots, stars, none) and logo are per set. View ▾ →
Theme… edits a set; changes to a built-in save as a new set. Using a theme
reloads the UI and keeps the open spread.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:10:16 -06:00
|
|
|
th.set_color("font_color", "Label", ON_BG)
|
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
|
|
|
th.set_stylebox("panel", "TooltipPanel", box(CARD, 6, [8, 5, 8, 5]))
|
|
|
|
|
th.set_color("font_color", "TooltipLabel", INK)
|
|
|
|
|
return th
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static func card_theme() -> Theme:
|
|
|
|
|
var th := Theme.new()
|
|
|
|
|
th.default_font = body(true)
|
|
|
|
|
th.default_font_size = 16
|
|
|
|
|
th.set_color("font_color", "Label", INK)
|
|
|
|
|
var normal := bordered(box(Color(1, 1, 1, 0), 5, [6, 3, 6, 3]), 1, Color(1, 1, 1, 0))
|
Theme system: runtime colour tokens, theme sets and a Theme dialog
Style's colours become static vars named by role (BG, PANEL, CARD, THREAD,
ACCENT, TRIM, GLOW…) instead of materials (felt, copper, brass), so a theme
can replace them. Stray hard-coded colours moved into tokens.
ThemeStore applies built-in sets (Tarot, the new default: jewel-purple
cloth with a shine; Felt, the old look) and the user's own sets from
user://themes/. Fills for the background and panels can be gradients; the
background pattern (dots, stars, none) and logo are per set. View ▾ →
Theme… edits a set; changes to a built-in save as a new set. Using a theme
reloads the UI and keeps the open spread.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:10:16 -06:00
|
|
|
var focus := bordered(box(Color.WHITE, 5, [6, 3, 6, 3]), 1, TRIM)
|
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
|
|
|
th.set_stylebox("normal", "LineEdit", normal)
|
|
|
|
|
th.set_stylebox("focus", "LineEdit", focus)
|
|
|
|
|
th.set_stylebox("read_only", "LineEdit", normal)
|
|
|
|
|
th.set_color("font_color", "LineEdit", INK)
|
|
|
|
|
th.set_color("caret_color", "LineEdit", INK)
|
Theme system: runtime colour tokens, theme sets and a Theme dialog
Style's colours become static vars named by role (BG, PANEL, CARD, THREAD,
ACCENT, TRIM, GLOW…) instead of materials (felt, copper, brass), so a theme
can replace them. Stray hard-coded colours moved into tokens.
ThemeStore applies built-in sets (Tarot, the new default: jewel-purple
cloth with a shine; Felt, the old look) and the user's own sets from
user://themes/. Fills for the background and panels can be gradients; the
background pattern (dots, stars, none) and logo are per set. View ▾ →
Theme… edits a set; changes to a built-in save as a new set. Using a theme
reloads the UI and keeps the open spread.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:10:16 -06:00
|
|
|
th.set_color("selection_color", "LineEdit", Color(ACCENT, 0.55))
|
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
|
|
|
th.set_color("font_placeholder_color", "LineEdit", MUTED)
|
|
|
|
|
# Card fields are sized by their containers, not by a minimum character count.
|
|
|
|
|
th.set_constant("minimum_character_width", "LineEdit", 0)
|
|
|
|
|
return th
|