Refresh data management dialogs

This commit is contained in:
Alexander Sellite 2026-09-02 07:19:25 -04:00
parent 3a61056ce5
commit cab313d69d
7 changed files with 720 additions and 103 deletions

View file

@ -78,6 +78,7 @@ func _initialize() -> void:
failures,
true,
)
_expect_temporary_persistent_root_rejected(failures)
if failures.is_empty():
print("PlayerDataRoot path validation: PASS")
quit(0)
@ -90,14 +91,37 @@ func _initialize() -> void:
func _create_validation_root(path: String) -> void:
var data_root := PlayerDataRoot.new()
get_root().add_child(data_root)
if data_root.select_new_root(path):
var created: Dictionary = data_root.create_unbound_root(path)
if (
bool(created.get("ok", false))
and data_root.activate_process_root(path)
):
print("PlayerDataRoot validation root created: ", data_root.root_path)
quit(0)
return
push_error(data_root.error_message)
push_error(str(created.get("message", data_root.error_message)))
quit(1)
func _expect_temporary_persistent_root_rejected(
failures: PackedStringArray,
) -> void:
var data_root := PlayerDataRoot.new()
get_root().add_child(data_root)
var temporary_path: String = OS.get_temp_dir().path_join(
"straywild-persistent-root"
)
if data_root.select_new_root(temporary_path):
failures.append(
"temporary directory was accepted as persistent player data"
)
elif not data_root.error_message.contains("Temporary folders"):
failures.append(
"temporary directory rejection did not explain the safety requirement"
)
data_root.queue_free()
func _expect(
label: String,
candidate: String,