mirror of
https://github.com/CrispyPin/ovr-utils.git
synced 2024-11-21 23:20:25 +01:00
compare hash of settings instead of string
This commit is contained in:
parent
e0c7def52d
commit
d05880187a
1 changed files with 4 additions and 4 deletions
|
@ -10,7 +10,7 @@ const SETTINGS_DEF = preload("res://addons/settings-manager/settings_definition.
|
|||
|
||||
var has_loaded := false
|
||||
var s := {}
|
||||
var _saved_str: String
|
||||
var _saved_hash: int
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
|
@ -20,9 +20,9 @@ func _ready() -> void:
|
|||
|
||||
|
||||
func _on_SaveTimer_timeout() -> void:
|
||||
var new_s = str(s)
|
||||
if new_s != _saved_str:
|
||||
_saved_str = new_s
|
||||
var new_h: int = s.hash()
|
||||
if new_h != _saved_hash:
|
||||
_saved_hash = new_h
|
||||
print("Saving to ", SETTINGS_PATH)
|
||||
force_save()
|
||||
|
||||
|
|
Loading…
Reference in a new issue