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 DieIcon
|
|
|
|
|
extends Control
|
|
|
|
|
## A three-pip die face. Tumbles while `spinning` is on.
|
|
|
|
|
|
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 color: Color = Style.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
|
|
|
var spinning: bool = false:
|
|
|
|
|
set(value):
|
|
|
|
|
spinning = value
|
|
|
|
|
if not value:
|
|
|
|
|
_angle = 0.0
|
|
|
|
|
set_process(value)
|
|
|
|
|
queue_redraw()
|
|
|
|
|
|
|
|
|
|
var _angle: float = 0.0
|
|
|
|
|
var _frame: StyleBoxFlat
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _init() -> void:
|
|
|
|
|
custom_minimum_size = Vector2(20, 20)
|
|
|
|
|
size = custom_minimum_size
|
|
|
|
|
mouse_filter = MOUSE_FILTER_IGNORE
|
|
|
|
|
_frame = StyleBoxFlat.new()
|
|
|
|
|
_frame.draw_center = false
|
|
|
|
|
_frame.set_border_width_all(2)
|
|
|
|
|
_frame.set_corner_radius_all(3)
|
|
|
|
|
_frame.anti_aliasing = true
|
|
|
|
|
set_process(false)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _ready() -> void:
|
|
|
|
|
# Godot turns processing on for nodes with _process when they become ready.
|
|
|
|
|
set_process(spinning)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _process(delta: float) -> void:
|
|
|
|
|
_angle = fmod(_angle + delta * TAU * 2.0, TAU)
|
|
|
|
|
queue_redraw()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _draw() -> void:
|
|
|
|
|
draw_set_transform(size / 2.0, _angle)
|
|
|
|
|
_frame.border_color = color
|
|
|
|
|
draw_style_box(_frame, Rect2(-7.5, -7.5, 15, 15))
|
|
|
|
|
for p in [Vector2(-3, -3), Vector2(0, 0), Vector2(3, 3)]:
|
|
|
|
|
draw_circle(p, 1.45, color)
|
|
|
|
|
draw_set_transform(Vector2.ZERO)
|