feat: HUD 增加时间流速控制,新增 Settings 持久化
- 顶栏改为暂停/1x/5x/20x 按钮组,当前档位高亮 - TimeSystem 支持暂停与档位切换 - 新增 Settings 单例,存档默认流速并开机应用 - GameState 补充年月日,支持 12x30 历法推进
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
extends Node
|
||||
|
||||
const SAVE_PATH := "user://settings.cfg"
|
||||
var default_speed_index := 1 # 默认 5x
|
||||
|
||||
func load_settings() -> void:
|
||||
var cfg := ConfigFile.new()
|
||||
if cfg.load(SAVE_PATH) == OK:
|
||||
default_speed_index = cfg.get_value("time", "speed_index", 1)
|
||||
|
||||
func save_settings() -> void:
|
||||
var cfg := ConfigFile.new()
|
||||
cfg.set_value("time", "speed_index", default_speed_index)
|
||||
cfg.save(SAVE_PATH)
|
||||
Reference in New Issue
Block a user