feat: 新增 TimeSystem 时间系统并注册 Autoload
- project.godot 注册 GameState/TimeSystem 单例 - 存档面板新增快速存档按钮组 - 新增 export_presets.cfg 导出配置
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
extends Node
|
||||
|
||||
signal day_passed(year, month, day)
|
||||
|
||||
const DAY_LENGTH := 5.0
|
||||
var speed := 1.0
|
||||
var _elapsed := 0.0
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
_elapsed += delta * speed
|
||||
if _elapsed >= DAY_LENGTH:
|
||||
_elapsed -= DAY_LENGTH
|
||||
_advance()
|
||||
|
||||
func _advance() -> void:
|
||||
# GameState.year, GameState.month, GameState.day 推进
|
||||
GameState.day = GameState.day + 1;
|
||||
day_passed.emit()
|
||||
@@ -0,0 +1 @@
|
||||
uid://c13ljuiktgrgw
|
||||
@@ -36,11 +36,26 @@ layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
size_flags_stretch_ratio = 9.0
|
||||
|
||||
[node name="SlotList" type="VBoxContainer" parent="VBoxContainer/ScrollContainer" unique_id=674823582]
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/ScrollContainer" unique_id=596966633]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/ScrollContainer/HBoxContainer" unique_id=844163531]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="SaveSlot" parent="VBoxContainer/ScrollContainer/SlotList" unique_id=214547620 instance=ExtResource("2_uloko")]
|
||||
[node name="SaveGroup" type="Button" parent="VBoxContainer/ScrollContainer/HBoxContainer/VBoxContainer" unique_id=150349711]
|
||||
layout_mode = 2
|
||||
text = "存档1"
|
||||
|
||||
[node name="SlotList" type="VBoxContainer" parent="VBoxContainer/ScrollContainer/HBoxContainer" unique_id=674823582]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 5.0
|
||||
|
||||
[node name="SaveSlot" parent="VBoxContainer/ScrollContainer/HBoxContainer/SlotList" unique_id=214547620 instance=ExtResource("2_uloko")]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 1
|
||||
|
||||
[connection signal="button_up" from="VBoxContainer/Header/Button_Esc" to="." method="_on_button_esc_button_up"]
|
||||
|
||||
Reference in New Issue
Block a user