Refactor save management; enhance save_data function with verification and plaintext copy options, and update load_data logic for improved error handling

This commit is contained in:
Kirill
2026-09-13 22:57:25 +03:00
parent c22b21a537
commit dea744bc30
7 changed files with 380 additions and 260 deletions
+4 -1
View File
@@ -2,6 +2,9 @@ extends Node
const SPEED_LIMIT: int = 5
# Write a readable diagnostic copy next to the encrypted save. Never used for loading.
var save_plaintext_copy: bool = true
var Settings: Dictionary = {
"filename": "save-0001",
"sound_volume": 1.0,
@@ -39,7 +42,7 @@ func get_description(item_id: String, items: Array = []) -> String:
func format_number(value: float, digits: int = 0) -> String:
if value == 0: return ""
if value < 10_000:
return "%.*f" % [digits, value]
return "%.*f" % [digits, value]
var exp_value = int(floor(log(abs(value)) / log(10.0)))
var mantissa = value / pow(10.0, exp_value)