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:
+4
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user