61ee81a974
- scenes/avatar_customization.tscn: script_extense -> script (typo meant the customization UI script was never actually attached to the scene) - scripts/avatar/avatar_loadout.gd: add missing class_name AvatarLoadout (avatar_system.gd references the type everywhere; only this file among the avatar scripts lacked its class_name) - scripts/main_menu.gd: _ready() referenced _customize_button/_settings_button/ _quit_button but the @onready vars are named without the leading underscore
63 lines
1.7 KiB
GDScript
63 lines
1.7 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()
|