-
Notifications
You must be signed in to change notification settings - Fork 1
/
save.gd
51 lines (51 loc) · 2.03 KB
/
save.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
extends Node
func _init(slot, erase):
var saveinit = str(slot)+","+str(int(OS.is_vsync_enabled()))+","+str(int(OS.is_window_fullscreen()))
var file = File.new()
file.open("user://userprefs", File.WRITE)
file.store_string(saveinit)
file.close()
if erase:
saveinit = "0,0,<null>,<null>,<null>,<null>,<null>,<null>\n0\n0\n1,11,19\n0,0,0,0,0,0"
else:
saveinit = str(Global.party[0][0])+","+str(Global.party[0][1])+","+str(Global.party[1][0])+","+str(Global.party[1][1])+","+str(Global.party[2][0])+","+str(Global.party[2][1])+","+str(Global.party[3][0])+","+str(Global.party[3][1])+"\n"+str(Global.cpchar)+"\n"+str(Global.dificulty)+"\n"+str(Global.cplace[0])+","+str(Global.cplace[1])+","+str(Global.cplace[2])+"\n"+str(Global.quest[0])+","+str(Global.quest[1])+","+str(Global.quest[2])+","+str(Global.quest[3])+","+str(Global.quest[4])+","+str(Global.quest[5])+"\n"+str(Global.sparty[0][0])+","+str(Global.sparty[0][1])+","+str(Global.sparty[1][0])+","+str(Global.sparty[1][1])+","+str(Global.sparty[2][0])+","+str(Global.sparty[2][1])+","+str(Global.sparty[3][0])+","+str(Global.sparty[3][1])
if slot == 1:
file = File.new()
file.open("user://slot1", File.WRITE)
file.store_string(saveinit)
file.close()
elif slot == 2:
file = File.new()
file.open("user://slot2", File.WRITE)
file.store_string(saveinit)
file.close()
elif slot == 3:
file = File.new()
file.open("user://slot3", File.WRITE)
file.store_string(saveinit)
file.close()
elif slot == 4:
file = File.new()
file.open("user://slot4", File.WRITE)
file.store_string(saveinit)
file.close()
elif slot == 5:
file = File.new()
file.open("user://slot5", File.WRITE)
file.store_string(saveinit)
file.close()
elif slot == 6:
file = File.new()
file.open("user://slot6", File.WRITE)
file.store_string(saveinit)
file.close()
elif slot == 7:
file = File.new()
file.open("user://slot7", File.WRITE)
file.store_string(saveinit)
file.close()
elif slot == 8:
file = File.new()
file.open("user://slot8", File.WRITE)
file.store_string(saveinit)
file.close()