Files
SectSimulator/src/UI/Panels/MainMenu/MainMenu.gd
T

27 lines
810 B
GDScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## 主菜单场景(挂载于 MainMenu.tscn)。
extends Control
## 点击"新游戏":创建新存档组 → 重置 GameState 后进入游戏世界。
func MainMenu_NewGame_ButtonUp() -> void:
var pid := SaveSystem.create_profile()
GameState.request_new_game(pid)
get_tree().change_scene_to_file("res://src/Core/MainGame.tscn")
## 点击"读取存档":隐藏主按钮组并打开存档面板(读档模式)。
func MainMenu_LoadGame_ButtonUp() -> void:
$ButtonGroup.hide()
$SavePanel.open_load()
## 点击"设置"TODO:接入设置面板)。
func MainMenu_Settings_ButtonUp() -> void:
pass
## 点击"退出"。
func MainMenu_Quit_ButtonUp() -> void:
get_tree().quit()
## 存档面板请求返回。
func _on_save_panel_back_pressed() -> void:
$SavePanel.hide()
$ButtonGroup.show()