class_name SheetLoreDock extends PanelContainer ## The Lore Index inside the sheet editor (Play and Build): the shared ## LoreList, with the "Inspector | Lore Index" tabs on top in Build (as on the ## spread). Drag a Lore Entry onto a box: SheetLoreDrop adds it there. ## Shown with SheetEditor.set_lore_shown (top bar "Lore Index", the tab). const WIDTH := 340.0 var ed: SheetEditor var lore: LoreList var _tabs: HBoxContainer func setup(p_editor: SheetEditor) -> void: ed = p_editor custom_minimum_size.x = WIDTH add_theme_stylebox_override("panel", Style.panel_box([10, 10, 10, 10])) var col := VBoxContainer.new() col.add_theme_constant_override("separation", 8) add_child(col) _tabs = SideTabs.tab_row([[SheetInspector.INSPECTOR, "Inspector"], [SheetInspector.LORE, "Lore Index"]], SheetInspector.LORE, func(which: String) -> void: ed.set_lore_shown(which == SheetInspector.LORE)) col.add_child(_tabs) lore = LoreList.new() lore.name = "LoreList" lore.size_flags_vertical = SIZE_EXPAND_FILL lore.setup(ed.m, func() -> void: ed.set_lore_shown(false)) lore.dropped.connect(func(page: BookPage, level: LoreLevel, at: Vector2) -> void: SheetLoreDrop.drop(ed, page, level, at, Input.is_key_pressed(KEY_SHIFT))) lore.open_sheet = func(id: String) -> void: ed.nav.open(id) col.add_child(lore) visible = false ## Build shows the tabs in place of the title, as on the spread. func sync() -> void: _tabs.visible = ed.building() SideTabs.press(_tabs, SheetInspector.LORE) lore.title.visible = not ed.building()