P24-03: 選択と保存の受入

This commit is contained in:
Agent Control Runner
2026-10-13 00:57:32 +09:00
parent 286730f88c
commit 9c711860a8
10 changed files with 408 additions and 3 deletions
+7 -2
View File
@@ -2354,13 +2354,18 @@ func _apply_loaded_interface(result: Dictionary) -> void:
_update_pause_and_speed()
func _valid_interface_selection_version(value: Variant) -> bool:
# JSON numbers may be decoded as floats; booleans are never versions.
return typeof(value) in [TYPE_INT, TYPE_FLOAT] and value == 1
func _restore_interface_selection(manifest: Variant) -> void:
# Presentation metadata is optional. It must never invalidate gameplay,
# and recovery must use the manifest of the actually loaded candidate.
if not manifest is Dictionary:
return
var selection: Variant = manifest.get("interface_selection", {})
if not selection is Dictionary or selection.get("version", 0) != 1:
if not selection is Dictionary or not _valid_interface_selection_version(selection.get("version", 0)):
return
var kind_value: Variant = selection.get("kind", "")
var id_value: Variant = selection.get("id", "")
@@ -2403,7 +2408,7 @@ func _restore_actor_interface_selection(manifest: Variant) -> void:
if not manifest is Dictionary:
return
var selection: Variant = manifest.get("interface_selection", {})
if not selection is Dictionary or selection.get("version", 0) != 1:
if not selection is Dictionary or not _valid_interface_selection_version(selection.get("version", 0)):
return
var staff_id: Variant = selection.get("staff_id", "")
if staff_id is String and not staff_id.is_empty() and staff_id.length() <= 256 and _service(&"staff_service").has_staff(StringName(staff_id)):