63 lines
1.8 KiB
GDScript
63 lines
1.8 KiB
GDScript
## MainMenu - Main menu scene with navigation to avatar customization.
|
|
##
|
|
## Provides buttons for:
|
|
## - Start Game
|
|
## - Customize Avatar (opens avatar customization UI)
|
|
## - Settings
|
|
## - Quit
|
|
|
|
extends Control
|
|
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# UI References
|
|
# ---------------------------------------------------------------------------
|
|
|
|
@onready var customize_button: Button = $VBoxContainer/CustomizeAvatar
|
|
@onready var settings_button: Button = $VBoxContainer/Settings
|
|
@onready var quit_button: Button = $VBoxContainer/Quit
|
|
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Signals
|
|
# ---------------------------------------------------------------------------
|
|
|
|
## Emitted when the player requests to customize their avatar.
|
|
signal open_customization
|
|
|
|
## Emitted when the player requests to start the game.
|
|
signal start_game
|
|
|
|
## Emitted when the player requests to open settings.
|
|
signal open_settings
|
|
|
|
## Emitted when the player requests to quit.
|
|
signal quit_requested
|
|
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Lifecycle
|
|
# ---------------------------------------------------------------------------
|
|
|
|
func _ready() -> void:
|
|
_customize_button.pressed.connect(_on_customize_pressed)
|
|
_settings_button.pressed.connect(_on_settings_pressed)
|
|
_quit_button.pressed.connect(_on_quit_pressed)
|
|
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Button Handlers
|
|
# ---------------------------------------------------------------------------
|
|
|
|
func _on_customize_pressed() -> void:
|
|
open_customization.emit()
|
|
|
|
|
|
func _on_settings_pressed() -> void:
|
|
open_settings.emit()
|
|
|
|
|
|
func _on_quit_pressed() -> void:
|
|
quit_requested.emit()
|
|
get_tree().quit()
|