feat(runtime): integrate settings service boundary

Co-Authored-By: Codex <noreply@anthropic.com>
This commit is contained in:
2026-08-25 10:20:18 +08:00
co-authored by Codex
parent 60614149db
commit 8a8fb33c19
3 changed files with 261 additions and 19 deletions
+43
View File
@@ -0,0 +1,43 @@
class_name ABGSettingsService
extends RefCounted
const StoreScript = preload("res://entry/settings_store.gd")
const SETTINGS_VERSION := StoreScript.SETTINGS_VERSION
const TEXT_SCALES := StoreScript.TEXT_SCALES
const SAFE_AREA_PRESETS := StoreScript.SAFE_AREA_PRESETS
## Application-facing Settings boundary. The existing JSON schema, migration,
## validation and atomic file protocol remain owned by the proven backend; new
## pages depend on this boundary rather than opening a settings file directly.
var backend
var path: String:
get:
return String(backend.path)
set(value):
backend.path = value
func _init(existing_backend = null) -> void:
backend = existing_backend if existing_backend != null else StoreScript.new()
func defaults() -> Dictionary:
return backend.defaults()
func load_settings() -> Dictionary:
return backend.load_settings()
func save_settings(value: Dictionary) -> Dictionary:
return backend.save_settings(value)
func validate(value: Dictionary) -> Dictionary:
return backend.validate(value)
func backend_type_name() -> String:
return backend.get_script().resource_path.get_file()