Sheets phase B: main menu, Sheets list, sheet editor
- Main menu (Spreads, Sheets, Settings, Quit) on the theme background,
with recent spreads and sheets; logo or ☰ returns to it.
- Sheets: data model, store, templates, snapshot undo; New sheet dialog
(blank or a template); editor with folder tabs, snap-grid canvas on the
spread background, field palette, inspector, Play/Build, status strip.
- Field kinds: Number, Text box (BBCode, live {@name}), Heading.
- PaletteList shared by the card and field palettes; shared top bar brand.
- Keys go to the screen that shows; theme reloads keep the screen.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 15:53:56 -06:00
class_name SheetDemo
extends RefCounted
Sheets phase C: every field kind, details panel, canvas panning
- 25 palette items over 23 kinds: basics, trackers (bars, ticks, clocks,
dots, step/usage dice, ladders), formulas and dice buttons (rule
language with sheet @names), lists (rows, mini table, chips, point pool
that may go negative, bonds), slots, conditions, spell slots, XP,
currency, heading, divider, picture.
- Per-kind settings in the inspector; hover excerpts and an in-app
details panel for list entries; live redraw of dependent boxes.
- Canvas: the page stays put after edits (boxes can go anywhere), a
screen of room past the boxes, drag-to-pan and edge scrolling.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 16:28:04 -06:00
## An example sheet (an OSR knight, after the mockup) for screenshots
## (--sheet-demo) and tests: every kind of box on three tabs.
Sheets phase B: main menu, Sheets list, sheet editor
- Main menu (Spreads, Sheets, Settings, Quit) on the theme background,
with recent spreads and sheets; logo or ☰ returns to it.
- Sheets: data model, store, templates, snapshot undo; New sheet dialog
(blank or a template); editor with folder tabs, snap-grid canvas on the
spread background, field palette, inspector, Play/Build, status strip.
- Field kinds: Number, Text box (BBCode, live {@name}), Heading.
- PaletteList shared by the card and field palettes; shared top bar brand.
- Keys go to the screen that shows; theme reloads keep the screen.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 15:53:56 -06:00
static func create ( id : String = " demo-brin " ) - > SheetDoc :
var doc : = SheetDoc . new ( id , " Brin Hollowmere " )
Sheets phase C: every field kind, details panel, canvas panning
- 25 palette items over 23 kinds: basics, trackers (bars, ticks, clocks,
dots, step/usage dice, ladders), formulas and dice buttons (rule
language with sheet @names), lists (rows, mini table, chips, point pool
that may go negative, bonds), slots, conditions, spell slots, XP,
currency, heading, divider, picture.
- Per-kind settings in the inspector; hover excerpts and an in-app
details panel for list entries; live redraw of dependent boxes.
- Canvas: the page stays put after edits (boxes can go anywhere), a
screen of room past the boxes, drag-to-pan and edge scrolling.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 16:28:04 -06:00
var main : Array = doc . tabs [ 0 ] [ " boxes " ]
var title : = _add ( doc , main , " heading " , " Brin Hollowmere " , 1 , 1 , 26 , 4 )
Sheets phase B: main menu, Sheets list, sheet editor
- Main menu (Spreads, Sheets, Settings, Quit) on the theme background,
with recent spreads and sheets; logo or ☰ returns to it.
- Sheets: data model, store, templates, snapshot undo; New sheet dialog
(blank or a template); editor with folder tabs, snap-grid canvas on the
spread background, field palette, inspector, Play/Build, status strip.
- Field kinds: Number, Text box (BBCode, live {@name}), Heading.
- PaletteList shared by the card and field palettes; shared top bar brand.
- Keys go to the screen that shows; theme reloads keep the screen.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 15:53:56 -06:00
title . frameless = true
Sheets phase C: every field kind, details panel, canvas panning
- 25 palette items over 23 kinds: basics, trackers (bars, ticks, clocks,
dots, step/usage dice, ladders), formulas and dice buttons (rule
language with sheet @names), lists (rows, mini table, chips, point pool
that may go negative, bonds), slots, conditions, spell slots, XP,
currency, heading, divider, picture.
- Per-kind settings in the inspector; hover excerpts and an in-app
details panel for list entries; live redraw of dependent boxes.
- Canvas: the page stays put after edits (boxes can go anywhere), a
screen of room past the boxes, drag-to-pan and edge scrolling.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 16:28:04 -06:00
var kit : = _add ( doc , main , " short_text " , " Class " , 28 , 1 , 12 , 4 )
kit . value = " Hedge Knight "
Sheets phase B: main menu, Sheets list, sheet editor
- Main menu (Spreads, Sheets, Settings, Quit) on the theme background,
with recent spreads and sheets; logo or ☰ returns to it.
- Sheets: data model, store, templates, snapshot undo; New sheet dialog
(blank or a template); editor with folder tabs, snap-grid canvas on the
spread background, field palette, inspector, Play/Build, status strip.
- Field kinds: Number, Text box (BBCode, live {@name}), Heading.
- PaletteList shared by the card and field palettes; shared top bar brand.
- Keys go to the screen that shows; theme reloads keep the screen.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 15:53:56 -06:00
var col : = 0
for stat : Array in [ [ " Strength " , " str " , 14 ] , [ " Dexterity " , " dex " , 9 ] , [ " Willpower " , " wil " , 12 ] ] :
Sheets phase C: every field kind, details panel, canvas panning
- 25 palette items over 23 kinds: basics, trackers (bars, ticks, clocks,
dots, step/usage dice, ladders), formulas and dice buttons (rule
language with sheet @names), lists (rows, mini table, chips, point pool
that may go negative, bonds), slots, conditions, spell slots, XP,
currency, heading, divider, picture.
- Per-kind settings in the inspector; hover excerpts and an in-app
details panel for list entries; live redraw of dependent boxes.
- Canvas: the page stays put after edits (boxes can go anywhere), a
screen of room past the boxes, drag-to-pan and edge scrolling.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 16:28:04 -06:00
var b : = _add ( doc , main , " number " , stat [ 0 ] , 1 + col * 9 , 6 , 8 , 5 )
Sheets phase B: main menu, Sheets list, sheet editor
- Main menu (Spreads, Sheets, Settings, Quit) on the theme background,
with recent spreads and sheets; logo or ☰ returns to it.
- Sheets: data model, store, templates, snapshot undo; New sheet dialog
(blank or a template); editor with folder tabs, snap-grid canvas on the
spread background, field palette, inspector, Play/Build, status strip.
- Field kinds: Number, Text box (BBCode, live {@name}), Heading.
- PaletteList shared by the card and field palettes; shared top bar brand.
- Keys go to the screen that shows; theme reloads keep the screen.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 15:53:56 -06:00
b . var_name = stat [ 1 ]
Sheets phase C: every field kind, details panel, canvas panning
- 25 palette items over 23 kinds: basics, trackers (bars, ticks, clocks,
dots, step/usage dice, ladders), formulas and dice buttons (rule
language with sheet @names), lists (rows, mini table, chips, point pool
that may go negative, bonds), slots, conditions, spell slots, XP,
currency, heading, divider, picture.
- Per-kind settings in the inspector; hover excerpts and an in-app
details panel for list entries; live redraw of dependent boxes.
- Canvas: the page stays put after edits (boxes can go anywhere), a
screen of room past the boxes, drag-to-pan and edge scrolling.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 16:28:04 -06:00
b . value = stat [ 2 ]
Sheets phase B: main menu, Sheets list, sheet editor
- Main menu (Spreads, Sheets, Settings, Quit) on the theme background,
with recent spreads and sheets; logo or ☰ returns to it.
- Sheets: data model, store, templates, snapshot undo; New sheet dialog
(blank or a template); editor with folder tabs, snap-grid canvas on the
spread background, field palette, inspector, Play/Build, status strip.
- Field kinds: Number, Text box (BBCode, live {@name}), Heading.
- PaletteList shared by the card and field palettes; shared top bar brand.
- Keys go to the screen that shows; theme reloads keep the screen.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 15:53:56 -06:00
col += 1
Sheets phase C: every field kind, details panel, canvas panning
- 25 palette items over 23 kinds: basics, trackers (bars, ticks, clocks,
dots, step/usage dice, ladders), formulas and dice buttons (rule
language with sheet @names), lists (rows, mini table, chips, point pool
that may go negative, bonds), slots, conditions, spell slots, XP,
currency, heading, divider, picture.
- Per-kind settings in the inspector; hover excerpts and an in-app
details panel for list entries; live redraw of dependent boxes.
- Canvas: the page stays put after edits (boxes can go anywhere), a
screen of room past the boxes, drag-to-pan and edge scrolling.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 16:28:04 -06:00
var mod : = _add ( doc , main , " formula " , " STR mod " , 28 , 6 , 8 , 5 )
mod . config [ " expr " ] = " floor((@str - 10) / 2) "
mod . var_name = " str_mod "
var hp : = _add ( doc , main , " resource " , " Hit points " , 1 , 12 , 17 , 4 )
hp . value = { " cur " : 6 , " max " : 10 }
_add ( doc , main , " ticks " , " Stress " , 19 , 12 , 12 , 4 ) . value = 2
var conditions : = _add ( doc , main , " conditions " , " Conditions " , 1 , 17 , 30 , 5 )
conditions . value = [ " Exhausted " ]
var talents : = _add ( doc , main , " pool " , " Talents " , 1 , 23 , 26 , 12 )
talents . value = [
{ " Name " : " Shield Wall " , " Cost " : 6 , " Effect " : " +2 Armour beside allies " , " details " : " When an ally stands beside you, both of you gain +2 Armour until one of you moves. " } ,
{ " Name " : " Keen Eye " , " Cost " : 4 , " Effect " : " Spot hidden things " , " details " : " You notice traps, secret doors and lies more often than not. Roll twice and keep the better when searching. " } ,
{ " Name " : " Second Wind " , " Cost " : 8 , " Effect " : " Heal once a day " , " details " : " Once a day, catch your breath and regain 1d6 hit points. " } ,
]
var attack : = _add ( doc , main , " dice " , " Longsword " , 28 , 23 , 11 , 6 )
attack . config [ " dice " ] = " 1d20 + @str_mod "
_add ( doc , main , " clock " , " Barrow wakes " , 28 , 29 , 8 , 7 ) . value = 2
_add ( doc , main , " slots " , " Inventory " , 40 , 1 , 17 , 11 )
_add ( doc , main , " xp " , " XP " , 40 , 13 , 17 , 5 ) . value = 2600
var oath : = _add ( doc , main , " text " , " Oath " , 40 , 19 , 17 , 8 )
oath . value = " I swore to carry the crown back to the abbey at Vel. My blows land harder ([b]+{@str_mod}[/b] to damage). "
var spells : = doc . add_tab ( " Spells " )
var magic : Array = spells [ " boxes " ]
_add ( doc , magic , " spell_slots " , " Spell slots " , 1 , 1 , 15 , 8 ) . value = [ 1 , 0 ]
_add ( doc , magic , " step_die " , " Faith " , 17 , 1 , 9 , 5 ) . value = " d8 "
_add ( doc , magic , " usage_die " , " Torches " , 27 , 1 , 10 , 5 )
_add ( doc , magic , " ladder " , " Resolve " , 17 , 7 , 20 , 5 ) . value = 4
_add ( doc , magic , " dots " , " Holy favour " , 1 , 10 , 15 , 4 ) . value = 3
var notes : = doc . add_tab ( " Notes " )
var extra : Array = notes [ " boxes " ]
_add ( doc , extra , " currency " , " Purse " , 1 , 1 , 16 , 8 ) . value = { " gp " : 12 , " sp " : 7 , " cp " : 30 }
_add ( doc , extra , " bonds " , " Bonds " , 18 , 1 , 16 , 9 )
_add ( doc , extra , " chips " , " Aspects " , 1 , 9 , 16 , 6 )
_add ( doc , extra , " checkbox " , " Oath kept " , 18 , 11 , 10 , 4 )
_add ( doc , extra , " dropdown " , " Alignment " , 29 , 11 , 12 , 4 )
_add ( doc , extra , " divider " , " " , 1 , 16 , 40 , 2 )
_add ( doc , extra , " table " , " Gear " , 1 , 18 , 24 , 9 )
Sheets phase B: main menu, Sheets list, sheet editor
- Main menu (Spreads, Sheets, Settings, Quit) on the theme background,
with recent spreads and sheets; logo or ☰ returns to it.
- Sheets: data model, store, templates, snapshot undo; New sheet dialog
(blank or a template); editor with folder tabs, snap-grid canvas on the
spread background, field palette, inspector, Play/Build, status strip.
- Field kinds: Number, Text box (BBCode, live {@name}), Heading.
- PaletteList shared by the card and field palettes; shared top bar brand.
- Keys go to the screen that shows; theme reloads keep the screen.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 15:53:56 -06:00
return doc
Sheets phase C: every field kind, details panel, canvas panning
- 25 palette items over 23 kinds: basics, trackers (bars, ticks, clocks,
dots, step/usage dice, ladders), formulas and dice buttons (rule
language with sheet @names), lists (rows, mini table, chips, point pool
that may go negative, bonds), slots, conditions, spell slots, XP,
currency, heading, divider, picture.
- Per-kind settings in the inspector; hover excerpts and an in-app
details panel for list entries; live redraw of dependent boxes.
- Canvas: the page stays put after edits (boxes can go anywhere), a
screen of room past the boxes, drag-to-pan and edge scrolling.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 16:28:04 -06:00
static func _add ( doc : SheetDoc , boxes : Array , item_id : String , title : String , gx : int , gy : int , gw : int , gh : int ) - > SheetBox :
Sheets phase E: export/import, text toolbar and Lore links, Lore library and items, phone view
- E1: Export ▾ (share file with embedded pictures, print/PDF web page,
PNG of the tab); Import a sheet file from Sheets and New sheet.
- E2: formatting toolbar (FormatMenu) in sheet text boxes; Lore links
([url=lore:ID]) with hover excerpt and the details panel.
- E3: Lore Index in Play and in sheets (shared LoreList); This spread |
My library; item sheets on Lore Entries; drag entries into lists,
slots and notes (copy, Shift keeps linked).
- E4: phone stacked view in phone order, Stacked | Canvas switch, 44 px
touch sizes, bottom panels; sheet CLI flags split out.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 17:25:09 -06:00
return SheetKinds . place ( doc , boxes , item_id , title , Rect2i ( gx , gy , gw , gh ) )