回合结算自动存档,新游戏自动创建存档组

This commit is contained in:
2026-08-13 23:46:58 +08:00
parent b8e42d3104
commit dc11cab7aa
5 changed files with 11 additions and 8 deletions
+4 -1
View File
@@ -2,6 +2,9 @@ extends Node
func _on_top_bar_hud_sign_return_mainmenu() -> void: func _on_top_bar_hud_sign_return_mainmenu() -> void:
# SaveSystem.save_auto(GameState.profile_id) if GameState.mode == GameState.GameMode.NEW_GAME:
if GameState.profile_id == 0:
GameState.profile_id = SaveSystem.create_profile()
SaveSystem.save(GameState.profile_id) # 进游戏立即存首档,防开局就丢
get_tree().change_scene_to_file("res://src/UI/Panels/MainMenu/MainMenu.tscn") get_tree().change_scene_to_file("res://src/UI/Panels/MainMenu/MainMenu.tscn")
pass # Replace with function body. pass # Replace with function body.
-4
View File
@@ -2,7 +2,6 @@
[ext_resource type="Script" uid="uid://cr4by5k8vgkcq" path="res://src/Core/MainGame.gd" id="1_8bu23"] [ext_resource type="Script" uid="uid://cr4by5k8vgkcq" path="res://src/Core/MainGame.gd" id="1_8bu23"]
[ext_resource type="PackedScene" uid="uid://d3njijtx7ws1m" path="res://src/UI/HUD/MainSceneHud.tscn" id="2_8bu23"] [ext_resource type="PackedScene" uid="uid://d3njijtx7ws1m" path="res://src/UI/HUD/MainSceneHud.tscn" id="2_8bu23"]
[ext_resource type="PackedScene" uid="uid://xecv3j1wfxmv" path="res://src/UI/HUD/MainGameButtomHud.tscn" id="3_oyqkd"]
[node name="MainGame" type="Node" unique_id=42551660] [node name="MainGame" type="Node" unique_id=42551660]
script = ExtResource("1_8bu23") script = ExtResource("1_8bu23")
@@ -11,7 +10,4 @@ script = ExtResource("1_8bu23")
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
[node name="MainGameButtomHud" parent="." unique_id=12078477 instance=ExtResource("3_oyqkd")]
visible = false
[connection signal="sign_return_mainmenu" from="MainHud" to="." method="_on_top_bar_hud_sign_return_mainmenu"] [connection signal="sign_return_mainmenu" from="MainHud" to="." method="_on_top_bar_hud_sign_return_mainmenu"]
+4
View File
@@ -65,6 +65,10 @@ func advance_month() -> void:
if curr_season != prev_season: if curr_season != prev_season:
season_changed.emit(new_year, curr_season) season_changed.emit(new_year, curr_season)
# 6. 回合结算自动存档
if GameState.profile_id != 0:
SaveSystem.save(GameState.profile_id)
_in_turn = false _in_turn = false
## 日期显示文本,如 "第3年 5月"。 ## 日期显示文本,如 "第3年 5月"。
+1 -1
View File
@@ -136,7 +136,7 @@ size_flags_stretch_ratio = 5.0
[node name="ButtonContinue" type="Button" parent="VBoxContainer/HBoxContainer3" unique_id=472091035] [node name="ButtonContinue" type="Button" parent="VBoxContainer/HBoxContainer3" unique_id=472091035]
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
text = "继续" text = "下一回合"
[connection signal="button_up" from="VBoxContainer/HBoxContainer/Button_Esc" to="." method="_on_ButtonEsc_ButtonUp"] [connection signal="button_up" from="VBoxContainer/HBoxContainer/Button_Esc" to="." method="_on_ButtonEsc_ButtonUp"]
[connection signal="button_up" from="VBoxContainer/HBoxContainer3/ButtonContinue" to="." method="_on_button_continue_button_up"] [connection signal="button_up" from="VBoxContainer/HBoxContainer3/ButtonContinue" to="." method="_on_button_continue_button_up"]
+2 -2
View File
@@ -8,8 +8,8 @@ func _draw() -> void:
pass pass
func _on_MainMenu_NewGame_ButtonUp() -> void: func _on_MainMenu_NewGame_ButtonUp() -> void:
#var pid := SaveSystem.create_profile() var pid := SaveSystem.create_profile()
#GameState.request_new_game(pid) GameState.request_new_game(pid)
get_tree().change_scene_to_file("res://src/Core/MainGame.tscn") get_tree().change_scene_to_file("res://src/Core/MainGame.tscn")
pass # Replace with function body. pass # Replace with function body.