debug / chapters / chapters.tscn

Diagram

Diagram

Overridden virtual functions

_ready

func _ready() -> void:
	Current.account = full_resource
	reload()
	dump_json()
$Chapters
func _ready() -> void:
	if get_parent() == get_tree().root:
		%AnimationPlayer.play('opening')
	FocusHelper.set_neighbors_h(%ChaptersContainer.get_children())
	for chapter in %ChaptersContainer.get_children():
		chapter.focus_entered.connect(_on_chapater_focused.bind(chapter))
	load_focused_chapter_to_menu()

_input

$Chapters
func _input(event: InputEvent) -> void:
	if not (shown && current_plate == Plate.ROOT): return
	if event.is_action_pressed("ui_back"):
		go_back()
	elif event.is_action_pressed("ui_accept"):
		go_foward()

Instantiators

Caution
No other scene instantiate this scene.

Scene Tree

Signal Connections

$Chapters:[ui_backed]⇒$.
func _on_chapters_ui_backed() -> void:
	reload()
$ReloadButton:[pressed]⇒$.
func _on_reload_button_pressed() -> void:
	reload()

Properties

Table 1. Root properties
Name Value

layout_mode

3

anchors_preset

15

anchor_right

1.0

anchor_bottom

1.0

grow_horizontal

2

grow_vertical

2

theme

script

full_resource

Table 2. $Chapters properties
Name Value

unique_name_in_owner

true

layout_mode

1

Table 3. $ReloadButton properties
Name Value

layout_mode

0

offset_left

128.0

offset_top

796.0

offset_right

335.0

offset_bottom

887.0

text

Reload

chapters.gd

extends Control

@export var full_resource : AccountResource


func _ready() -> void:
	Current.account = full_resource
	reload()
	dump_json()


func reload() -> void:
	%Chapters.setup_from_account_resource()
	%Chapters.play_opening = true


func dump_json() -> void:
	var json = ResourceHelper.json(Current.account)
	var res  = JSON.parse_string(json)
	true


func _on_reload_button_pressed() -> void:
	reload()


func _on_chapters_ui_backed() -> void:
	reload()