feat: 两级存档系统——无限组/槽,建组建槽/自动档/两级浏览/读档还原/删除组与槽/游戏内加载(D8 完成)
This commit is contained in:
+25
-8
@@ -7,16 +7,29 @@ func _ready() -> void:
|
||||
add_to_group("game_scene")
|
||||
# 应用用户设置中的默认流速
|
||||
TimeSystem.apply_default_speed()
|
||||
# 开局招募:清空旧数据 → 生成 5 名候选 → 暂停时间等待选择(读档流程接入后由存档还原)
|
||||
DiscipleManager.start_new_game()
|
||||
# 开局建筑:清空旧建筑(读档流程接入后由存档还原)
|
||||
BuildingManager.reset()
|
||||
# 开局赠送资源(数量来自配置;读档流程接入后由存档还原)
|
||||
SectManager.add_spirit_stones(GameConfig.starting_spirit_stones)
|
||||
SectManager.add_food(GameConfig.starting_food)
|
||||
match GameState.mode:
|
||||
GameState.GameMode.NEW_GAME:
|
||||
_start_new_game()
|
||||
GameState.GameMode.LOAD_GAME:
|
||||
# 读档还原(含日期/资源/名录/建筑);失败回退新游戏
|
||||
if not SaveSystem.load_game(GameState.profile_id, GameState.save_slot):
|
||||
push_warning("读档失败,回退新游戏")
|
||||
_start_new_game()
|
||||
|
||||
## 顶部 HUD 的返回主菜单请求。
|
||||
## 新游戏初始化:清空旧数据 → 开局招募弹窗(暂停)→ 设定开局资源。
|
||||
func _start_new_game() -> void:
|
||||
# 开局招募:清空旧数据 → 生成 5 名候选 → 暂停时间等待选择
|
||||
DiscipleManager.start_new_game()
|
||||
# 开局建筑:清空旧建筑
|
||||
BuildingManager.reset()
|
||||
# 开局资源:直接设定(set 而非 add,避免与上次会话残留混淆)
|
||||
SectManager.set_spirit_stones(GameConfig.starting_spirit_stones)
|
||||
SectManager.set_food(GameConfig.starting_food)
|
||||
SectManager.set_reputation(0)
|
||||
|
||||
## 顶部 HUD 的返回主菜单请求(先写自动存档)。
|
||||
func _on_top_bar_hud_sign_return_mainmenu() -> void:
|
||||
SaveSystem.save_auto(GameState.profile_id)
|
||||
get_tree().change_scene_to_file("res://src/UI/Panels/MainMenu/MainMenu.tscn")
|
||||
|
||||
## 顶部 HUD 的"管理"按钮请求:打开弟子名录面板。
|
||||
@@ -26,3 +39,7 @@ func _on_top_bar_hud_sign_open_disciples() -> void:
|
||||
## 顶部 HUD 的"资源"按钮请求:打开建筑面板。
|
||||
func _on_top_bar_hud_sign_open_buildings() -> void:
|
||||
$BuildingsPanel.show_panel()
|
||||
|
||||
## 顶部 HUD 的"存档"按钮请求:打开存档面板(存档模式)。
|
||||
func _on_top_bar_hud_sign_open_save() -> void:
|
||||
$SavePanel.open_save()
|
||||
|
||||
Reference in New Issue
Block a user