To get the double quotes to show up when pasted from the clipboard, you can encase them with single quotes and use string formatting to put your key inside like so: '"%s"' % str(i)
func _on_CopySaveCode_pressed():
for i in range(1, 83):
dictionary['"%s"' % str(i)] = {
If want the values to also show up with quotes, you can do the same here
"L1": '"%s"' % str(DataImport.player_data_save[str(i)].L1),
"CLVL": '"%s"' % str(DataImport.player_data_save[str(i)].CLVL),
}
OS.set_clipboard(str(dictionary))
To save the file as json use file.store_line()
instead of file.store_string()
func _on_PasteLoadCode_text_entered(new_text):
loaddictionary = new_text
var d = Directory.new()
if not d.dir_exists("user://test"):
d.make_dir("user://test")
var file = File.new()
file.open("user://test/PlayerData.json", File.WRITE)
file.store_line(to_json(loaddictionary))
file.close()