TableTower/ui/help_menu.gd
RobinFiredrake ea1e7a6492 Rename to Table Tarot in the UI: spreads, threads, deck mode, branch, repeat
User-facing text only; code names, JSON keys and the project's internal
name (and so the user:// folder) are unchanged. The Collection card kind
keeps its name until a new one is chosen. The window title says Table
Tarot; the top bar shows the theme's logo (the fortune teller, drawn from a
copy of the art without its background square); the app icon is the
mascot.

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

25 lines
717 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)
m._add_modal(d)
return d