forked from team-sg/hero-mark-2
file select and file creation, menus glued together
This commit is contained in:
parent
13708b4046
commit
f7496c5e6f
18 changed files with 754 additions and 47 deletions
|
@ -142,11 +142,15 @@ var current_file: SaveFile = null
|
|||
|
||||
func _ready() -> void:
|
||||
# TODO: make load last played file
|
||||
current_file = load_file("user://file1.pr")
|
||||
Game.difficulty = current_file.difficulty
|
||||
current_file = load_file("user://file%d.pr" % Options.last_file)
|
||||
if current_file:
|
||||
Game.difficulty = current_file.difficulty
|
||||
|
||||
## shortcut for loading a save file from specific path
|
||||
func load_file(path: String) -> SaveFile:
|
||||
var file = SaveFile.new(path)
|
||||
file.load_from_file()
|
||||
return file
|
||||
if File.new().file_exists(path):
|
||||
var file = SaveFile.new(path)
|
||||
file.load_from_file()
|
||||
return file
|
||||
else:
|
||||
return null
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue