forked from team-sg/hero-mark-2
put more text on menus
This commit is contained in:
parent
f14e8ebdd0
commit
8ba46dc705
23 changed files with 373 additions and 69 deletions
|
@ -9,9 +9,45 @@ export var number = 1
|
|||
|
||||
var file: Save.SaveFile = null
|
||||
|
||||
onready var splatter = $DeathSplatter
|
||||
|
||||
func _ready():
|
||||
$FileNumber.text = "FILE%d" % number
|
||||
refresh()
|
||||
|
||||
|
||||
func select() -> void:
|
||||
if get_parent().kill_mode == false:
|
||||
# if a file exists, load and play it!
|
||||
if file:
|
||||
# set current file and difficulty
|
||||
Save.current_file = file
|
||||
Game.difficulty = file.difficulty
|
||||
# update last-played file for continue button
|
||||
Options.last_file = number
|
||||
Options.save_options()
|
||||
# let file select scene know a file has been loaded
|
||||
emit_signal("file_loaded")
|
||||
# empty file, so go to file creation screen
|
||||
else:
|
||||
# wait for fade
|
||||
Fade.fade_out(0.4)
|
||||
yield(Fade, "fade_finished")
|
||||
# create new file and give it to the file create screen
|
||||
var file_create = FileCreate.instance()
|
||||
file_create.file = Save.SaveFile.new("user://file%d.pr" % number)
|
||||
SceneManager.current_scene = file_create
|
||||
else:
|
||||
#Delete file
|
||||
if file:
|
||||
var dir = Directory.new()
|
||||
dir.remove(file.file_path)
|
||||
splatter.emitting = true
|
||||
Audio.play_sound(Audio.a_die,Audio.ac_die)
|
||||
refresh()
|
||||
|
||||
|
||||
func refresh():
|
||||
# check if the file exists
|
||||
if File.new().file_exists("user://file%d.pr" % number):
|
||||
# load file and fill in information
|
||||
|
@ -21,28 +57,7 @@ func _ready():
|
|||
$"%KeyCounter".text = "%03d" % file.get_total_keys()
|
||||
$"%DeathCounter".text = "%04d" % file.get_total_deaths()
|
||||
$"%TimeCounter".text = "%02d:%02d" % [file.play_time / 3600.0, fmod(file.play_time / 60.0, 60.0)]
|
||||
$"%Difficulty".text = Game.DIFFICULTY_NAMES[file.difficulty]
|
||||
else:
|
||||
$FileExists.visible = false
|
||||
$FileDoesNotExist.visible = true
|
||||
|
||||
|
||||
func select() -> void:
|
||||
# if a file exists, load and play it!
|
||||
if file:
|
||||
# set current file and difficulty
|
||||
Save.current_file = file
|
||||
Game.difficulty = file.difficulty
|
||||
# update last-played file for continue button
|
||||
Options.last_file = number
|
||||
Options.save_options()
|
||||
# let file select scene know a file has been loaded
|
||||
emit_signal("file_loaded")
|
||||
# empty file, so go to file creation screen
|
||||
else:
|
||||
# wait for fade
|
||||
Fade.fade_out(0.4)
|
||||
yield(Fade, "fade_finished")
|
||||
# create new file and give it to the file create screen
|
||||
var file_create = FileCreate.instance()
|
||||
file_create.file = Save.SaveFile.new("user://file%d.pr" % number)
|
||||
SceneManager.current_scene = file_create
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue