TableTower/ui/help_menu.gd
RobinFiredrake b1616373be Help: topics for every new feature, a cheat sheet, and Try a demo spreads
Twelve new Help topics (menus, selecting and resizing, nested groups,
themes, List view, the Book, rolling more than once, pausing, costs,
one table adjusting another, sheets and saving, pictures, phones), and a
Keyboard shortcuts topic split into keys, mouse and touch. Topics with
[demo]key[/demo] get a 'Try a demo spread' link: DemoSpreads builds a
small example, DemoMode shows it unsaved and unlisted with Keep a copy
and Back to my spread. --demo=KEY opens one from the command line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 19:24:57 -06:00

26 lines
788 B
GDScript

class_name HelpMenu
extends MenuButton
## The top bar's "Help ▾" menu: one item per help topic, each opening the
## Help window at that topic. F1 opens it at the first topic.
var m: Main
func setup(p_main: Main) -> void:
m = p_main
Style.menu_button("Help ▾", false, self)
tooltip_text = "How to use Table Tarot (F1)"
var pm := get_popup()
ModalCard.style_popup(pm)
var titles := HelpDialog.titles()
for i in titles.size():
pm.add_item(titles[i], i)
pm.id_pressed.connect(func(id: int) -> void: open(titles[id]))
## Opens the Help window at `topic` (the first topic when blank) and returns it.
func open(topic: String = "") -> HelpDialog:
var d := HelpDialog.new(topic)
d.demo_requested.connect(func(key: String) -> void: m.demo.open(key))
m._add_modal(d)
return d