forked from interstellar_development/freettrpg
12 lines
322 B
GDScript
12 lines
322 B
GDScript
extends Node
|
|
|
|
func saveJSON(savePath, saveData):
|
|
var jsonString = JSON.stringify(saveData)
|
|
|
|
var fileAccess = FileAccess.open(savePath, FileAccess.WRITE)
|
|
if not fileAccess:
|
|
print("An error happened while saving data: ", FileAccess.get_open_error())
|
|
return 1
|
|
|
|
fileAccess.store_line(jsonString)
|
|
fileAccess.close()
|