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
class_name ViewMenu
extends MenuButton
## The top bar's "View ▾" menu: how rules read (plain words or rule text),
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
## collapsing or expanding every table, striped result rows, the minimap and the theme.
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
## These are view preferences, so they live in one menu instead of the bar.
const ID_PLAIN : = 0
const ID_TEXT : = 1
const ID_COLLAPSE : = 2
const ID_STRIPES : = 3
const ID_MINIMAP : = 4
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
const ID_THEME : = 5
2026-11-10 18:50:32 -06:00
const ID_LIST : = 6
2026-11-10 19:02:46 -06:00
const ID_BOOK : = 7
2026-11-14 14:26:39 -06:00
const ID_SOUND : = 8
2026-11-14 14:28:59 -06:00
const ID_CONFIRM_DELETE : = 9
2026-11-15 12:25:08 -06:00
const ID_SKIP_ANIM : = 10
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
var m : Main
func setup ( p_main : Main ) - > void :
m = p_main
Style . menu_button ( " View ▾ " , false , self )
tooltip_text = " How rules read, collapsing tables, striped rows and the minimap "
var pm : = get_popup ( )
ModalCard . style_popup ( pm )
pm . add_separator ( " Rules " )
pm . add_radio_check_item ( " Plain words " , ID_PLAIN )
pm . set_item_tooltip ( pm . get_item_index ( ID_PLAIN ) , " Show rules in plain words: “Subtract 1 from Luck” " )
pm . add_radio_check_item ( " Rule text " , ID_TEXT )
pm . set_item_tooltip ( pm . get_item_index ( ID_TEXT ) , " Show rules as the text they ' re stored as: @luck -= 1 " )
pm . add_separator ( " Tables " )
pm . add_item ( " Collapse all tables " , ID_COLLAPSE )
pm . add_separator ( " Show " )
pm . add_check_item ( " Striped rows " , ID_STRIPES )
pm . add_check_item ( " Minimap (M) " , ID_MINIMAP )
2026-11-10 18:50:32 -06:00
pm . add_check_item ( " List view " , ID_LIST )
2026-11-15 12:46:05 -06:00
pm . add_check_item ( " Lore Index " , ID_BOOK )
2026-11-14 14:28:59 -06:00
pm . add_check_item ( " Ask before deleting " , ID_CONFIRM_DELETE )
pm . set_item_tooltip ( pm . get_item_index ( ID_CONFIRM_DELETE ) , " The Delete key asks “Are you sure?” first " )
2026-11-15 12:25:08 -06:00
pm . add_check_item ( " Skip animations " , ID_SKIP_ANIM )
pm . set_item_tooltip ( pm . get_item_index ( ID_SKIP_ANIM ) , " Rolls show their result at once, with no flicker, beads or pop-up motion. \n Shift-click a die to skip them for one roll. " )
2026-11-15 12:46:05 -06:00
pm . set_item_tooltip ( pm . get_item_index ( ID_BOOK ) , " Reusable results (Lore Entries) to drag onto tables " )
2026-11-14 19:19:47 -06:00
pm . set_item_tooltip ( pm . get_item_index ( ID_LIST ) , " The cards as a list with their groups, beside the spread " )
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
pm . add_separator ( )
pm . add_item ( " Theme… " , ID_THEME )
pm . set_item_tooltip ( pm . get_item_index ( ID_THEME ) , " Colours, background, fonts and logo; save your own theme " )
2026-11-14 14:26:39 -06:00
pm . add_item ( " Sound… " , ID_SOUND )
pm . set_item_tooltip ( pm . get_item_index ( ID_SOUND ) , " How loud the theme ' s sounds are " )
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
pm . about_to_popup . connect ( sync )
pm . id_pressed . connect ( activate )
## Brings the checks and the Collapse/Expand label up to date.
func sync ( ) - > void :
var pm : = get_popup ( )
pm . set_item_checked ( pm . get_item_index ( ID_PLAIN ) , m . rules_plain ( ) )
pm . set_item_checked ( pm . get_item_index ( ID_TEXT ) , not m . rules_plain ( ) )
pm . set_item_text ( pm . get_item_index ( ID_COLLAPSE ) , collapse_label ( ) )
pm . set_item_checked ( pm . get_item_index ( ID_STRIPES ) , m . local_state . striped_rows ( ) )
pm . set_item_checked ( pm . get_item_index ( ID_MINIMAP ) , m . board . minimap . visible )
2026-11-10 18:50:32 -06:00
pm . set_item_checked ( pm . get_item_index ( ID_LIST ) , m . list_view . visible )
2026-11-10 19:02:46 -06:00
pm . set_item_checked ( pm . get_item_index ( ID_BOOK ) , m . book . visible )
2026-11-14 14:28:59 -06:00
pm . set_item_checked ( pm . get_item_index ( ID_CONFIRM_DELETE ) , DeleteKey . asks ( m ) )
2026-11-15 12:25:08 -06:00
pm . set_item_checked ( pm . get_item_index ( ID_SKIP_ANIM ) , SkipAnimations . on ( m ) )
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
func collapse_label ( ) - > String :
return " Collapse all tables " if m . _any_expanded ( ) else " Expand all tables "
func activate ( id : int ) - > void :
match id :
ID_PLAIN :
m . set_rules_view ( " plain " )
ID_TEXT :
m . set_rules_view ( " text " )
ID_COLLAPSE :
m . set_all_collapsed ( m . _any_expanded ( ) )
ID_STRIPES :
m . local_state . set_striped_rows ( not m . local_state . striped_rows ( ) )
ID_MINIMAP :
m . nav . set_minimap_visible ( not m . board . minimap . visible , true )
2026-11-10 18:50:32 -06:00
ID_LIST :
m . list_view . toggle ( )
2026-11-10 19:02:46 -06:00
ID_BOOK :
m . book . toggle ( )
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
ID_THEME :
m . add_child ( ThemeDialog . new ( m ) )
2026-11-14 14:28:59 -06:00
ID_CONFIRM_DELETE :
DeleteKey . set_asks ( m , not DeleteKey . asks ( m ) )
2026-11-15 12:25:08 -06:00
ID_SKIP_ANIM :
SkipAnimations . set_on ( m , not SkipAnimations . on ( m ) )
2026-11-14 14:26:39 -06:00
ID_SOUND :
SoundPanel . open ( m , get_global_rect ( ) . position + Vector2 ( 0 , size . y + 4 ) )