src / beginning / menu / menu.tscn
Diagram
Overridden virtual functions
_ready
func _ready() -> void:
%ClimbButton.grab_focus()
FocusHelper.set_neighbors_v([
%ClimbButton, %OptionsButton, %CreditsButton, %QuitButton])
func _ready() -> void:
if get_parent() == get_tree().root:
grab_focus_first = true
else:
load_accounts()
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()
_process
func _process(delta: float) -> void:
if not focused: return
blink_time += delta
add_theme_color_override("font_focus_color", get_focus_color())
if blink_time > BLINK_INTERVAL: blink_time = 0
_input
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
-
Menu Control
-
SubViewportContainer SubViewportContainer
-
SubViewport SubViewport
-
RootContainer MarginContainer
-
MenuContainer VBoxContainer
-
ClimbContainer Node2D
-
LogoContainer CenterContainer
-
Sprite2D Sprite2D
-
-
ButtonContainer BoxContainer
-
ClimbButton res://src/ui/button/button.tscn
-
-
-
OthersContainer Node2D
-
VBoxContainer VBoxContainer
-
OptionsContainer BoxContainer
-
OptionsButton res://src/ui/button/button.tscn
-
-
CreditsContainer BoxContainer
-
CreditsButton res://src/ui/button/button.tscn
-
-
QuitContainer BoxContainer
-
QuitButton res://src/ui/button/button.tscn
-
-
-
-
-
-
AnimationPlayer AnimationPlayer
-
Signal Connections
func _on_climb_button_focus_entered() -> void:
if current_plate == Plate.ROOT:
%AnimationPlayer.play('climb_focused')
func _on_climb_button_focus_exited() -> void:
if current_plate == Plate.ROOT:
%AnimationPlayer.play('climb_unfocused')
func _on_climb_button_pressed() -> void:
if current_plate == Plate.ROOT:
Input.start_joy_vibration(0, 0.4, 0.6, 0.2)
%AnimationPlayer.play('climb_selected')
func _on_quit_button_pressed() -> void:
get_tree().quit()
func _on_accounts_get_started(account: Account) -> void:
%Chapters.setup_from_account_resource()
%AnimationPlayer.play("chapters_show")
func _on_accounts_ui_backed() -> void:
if current_plate == Plate.ACCOUNTS:
%AnimationPlayer.play('climb_unselected')
func _on_chapters_focused(idx: int) -> void:
if current_plate == Plate.CHAPTERS:
%World.focus_chapter(idx)
func _on_chapters_selected(idx: int) -> void:
if current_plate == Plate.CHAPTERS:
%World.zoom_chapter(idx)
func _on_chapters_ui_backed() -> void:
if current_plate == Plate.CHAPTERS || current_plate == Plate.ACCOUNTS:
%AnimationPlayer.play('chapters_hide')
%World.back_to_circular_move()
Animations
Animation_f84do
chapters_hide
chapters_show
climb_focused
climb_selected
climb_unfocused
climb_unselected
opening (autoplay)
Properties
| Name | Value |
|---|---|
layout_mode |
|
anchors_preset |
|
anchor_right |
|
anchor_bottom |
|
grow_horizontal |
|
grow_vertical |
|
theme |
|
script |
| Name | Value |
|---|---|
layout_mode |
|
anchors_preset |
|
anchor_right |
|
anchor_bottom |
|
grow_horizontal |
|
grow_vertical |
|
focus_mode |
|
| Name | Value |
|---|---|
handle_input_locally |
|
gui_disable_input |
|
size |
|
render_target_update_mode |
|
| Name | Value |
|---|---|
unique_name_in_owner |
|
| Name | Value |
|---|---|
layout_mode |
|
anchors_preset |
|
anchor_bottom |
|
offset_right |
|
offset_bottom |
|
grow_vertical |
|
theme_override_constants/margin_left |
|
theme_override_constants/margin_top |
|
theme_override_constants/margin_bottom |
|
| Name | Value |
|---|---|
layout_mode |
|
| Name | Value |
|---|---|
custom_minimum_size |
|
offset_left |
|
offset_right |
|
offset_bottom |
|
size_flags_horizontal |
|
| Name | Value |
|---|---|
texture_filter |
|
texture |
|
offset |
|
| Name | Value |
|---|---|
offset_top |
|
offset_right |
|
offset_bottom |
|
| Name | Value |
|---|---|
unique_name_in_owner |
|
layout_mode |
|
focus_neighbor_left |
|
focus_neighbor_top |
|
focus_neighbor_right |
|
focus_neighbor_bottom |
|
theme_override_font_sizes/font_size |
|
text |
` CLIMB` |
icon |
|
focus_move_direction |
|
| Name | Value |
|---|---|
position |
|
| Name | Value |
|---|---|
offset_right |
|
offset_bottom |
|
| Name | Value |
|---|---|
layout_mode |
|
| Name | Value |
|---|---|
unique_name_in_owner |
|
layout_mode |
|
focus_neighbor_top |
|
focus_neighbor_bottom |
|
text |
` Options` |
| Name | Value |
|---|---|
layout_mode |
|
| Name | Value |
|---|---|
unique_name_in_owner |
|
layout_mode |
|
focus_neighbor_top |
|
focus_neighbor_bottom |
|
text |
` Credits` |
icon |
| Name | Value |
|---|---|
layout_mode |
|
| Name | Value |
|---|---|
unique_name_in_owner |
|
layout_mode |
|
focus_neighbor_top |
|
text |
` Quit` |
icon |
| Name | Value |
|---|---|
unique_name_in_owner |
|
layout_mode |
|
offset_left |
|
offset_right |
|
| Name | Value |
|---|---|
unique_name_in_owner |
|
layout_mode |
|
offset_left |
|
offset_right |
|
| Name | Value |
|---|---|
unique_name_in_owner |
|
libraries |
|
autoplay |
|
menu.gd
extends Control
enum Plate { OPENING, ROOT, ACCOUNTS, CHAPTERS }
@export var current_plate : Plate = Plate.OPENING : set = change_plate
@export var grab_focus_root : bool = false : set = set_grab_focus_root
func _ready() -> void:
%ClimbButton.grab_focus()
FocusHelper.set_neighbors_v([
%ClimbButton, %OptionsButton, %CreditsButton, %QuitButton])
func set_grab_focus_root(val: bool) -> void:
if val: %ClimbButton.grab_focus()
func change_plate(val: Plate) -> void:
current_plate = val
func _on_climb_button_focus_entered() -> void:
if current_plate == Plate.ROOT:
%AnimationPlayer.play('climb_focused')
func _on_climb_button_focus_exited() -> void:
if current_plate == Plate.ROOT:
%AnimationPlayer.play('climb_unfocused')
func _on_climb_button_pressed() -> void:
if current_plate == Plate.ROOT:
Input.start_joy_vibration(0, 0.4, 0.6, 0.2)
%AnimationPlayer.play('climb_selected')
func _on_quit_button_pressed() -> void:
get_tree().quit()
func _on_accounts_ui_backed() -> void:
if current_plate == Plate.ACCOUNTS:
%AnimationPlayer.play('climb_unselected')
func _on_accounts_get_started(account: Account) -> void:
%Chapters.setup_from_account_resource()
%AnimationPlayer.play("chapters_show")
func _on_chapters_ui_backed() -> void:
if current_plate == Plate.CHAPTERS || current_plate == Plate.ACCOUNTS:
%AnimationPlayer.play('chapters_hide')
%World.back_to_circular_move()
func _on_chapters_focused(idx: int) -> void:
if current_plate == Plate.CHAPTERS:
%World.focus_chapter(idx)
func _on_chapters_selected(idx: int) -> void:
if current_plate == Plate.CHAPTERS:
%World.zoom_chapter(idx)