TableTower/ui/lore_level_library.gd
RobinFiredrake 317cac7a78 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

54 lines
1.1 KiB
GDScript

class_name LibraryLoreLevel
extends LoreLevel
## "My library": the shared Lore Entries (LoreLibrary), the same in every
## spread and sheet. Saved at once; there is no undo for it.
func _init(p_main: Main) -> void:
super(p_main)
key = LIBRARY
func title() -> String:
return "My library"
func library() -> LoreLibrary:
return SheetLoreLinks.library(m)
func pages() -> Array[BookPage]:
return library().pages if library() else ([] as Array[BookPage])
func get_page(id: String) -> BookPage:
return library().get_page(id) if library() else null
func edit(change: Callable) -> void:
change.call()
library().save()
func changed(_page: BookPage) -> void:
library().save()
func _add_raw(text: String, details: String) -> BookPage:
return library().add_page(text, details)
func remove_page(id: String) -> void:
library().remove_page(id)
func revision() -> int:
return library().revision if library() else 0
func uses_note(_page: BookPage) -> String:
return "In My library: every spread and sheet can use it. Drag it onto a result to copy it into this spread."
func ref(page: BookPage) -> String:
return SheetLoreLinks.LIBRARY + page.id