forked from team-sg/hero-mark-2
Save System Mk.III (and start of new difficulty system)
This commit is contained in:
parent
746b9813e2
commit
4958c420d8
8 changed files with 203 additions and 82 deletions
|
@ -43,6 +43,12 @@ material = SubResource( 2 )
|
|||
margin_right = 256.0
|
||||
margin_bottom = 192.0
|
||||
|
||||
[node name="DeleteBackground" type="ColorRect" parent="."]
|
||||
visible = false
|
||||
material = SubResource( 3 )
|
||||
margin_right = 256.0
|
||||
margin_bottom = 192.0
|
||||
|
||||
[node name="Panel" parent="." instance=ExtResource( 1 )]
|
||||
margin_left = 12.0
|
||||
margin_top = 64.0
|
||||
|
@ -92,8 +98,3 @@ texture_normal = ExtResource( 9 )
|
|||
texture_focused = ExtResource( 9 )
|
||||
expand = true
|
||||
stretch_mode = 3
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
material = SubResource( 3 )
|
||||
margin_right = 256.0
|
||||
margin_bottom = 192.0
|
||||
|
|
|
@ -2,11 +2,15 @@ extends Panel
|
|||
|
||||
export var number = 1
|
||||
|
||||
var file: Save.SaveFile
|
||||
|
||||
func _ready():
|
||||
var file = File.new()
|
||||
if !file.file_exists("user://file" + str(number) + ".pr"):
|
||||
if File.new().file_exists("user://file%d.pr" % number):
|
||||
file = Save.load_file("user://file%d.pr" % number)
|
||||
$"%Name".text = file.name
|
||||
$"%ShardCounter".text = "%02d" % file.get_total_shards()
|
||||
$"%KeyCounter".text = "%03d" % file.get_total_keys()
|
||||
$"%TimeCounter".text = "%02d:%02d" % [file.play_time / 3600.0, fmod(file.play_time / 60.0, 60.0)]
|
||||
else:
|
||||
$FileExists.visible = false
|
||||
$FileDoesNotExist.visible = true
|
||||
else:
|
||||
#Fill out info
|
||||
pass
|
||||
|
|
|
@ -35,6 +35,7 @@ align = 1
|
|||
[node name="FileExists" type="Node2D" parent="."]
|
||||
|
||||
[node name="Name" type="Label" parent="FileExists"]
|
||||
unique_name_in_owner = true
|
||||
margin_left = 8.0
|
||||
margin_top = 4.0
|
||||
margin_right = 64.0
|
||||
|
@ -43,6 +44,7 @@ text = "SG"
|
|||
align = 1
|
||||
|
||||
[node name="TimeCounter" type="Label" parent="FileExists"]
|
||||
unique_name_in_owner = true
|
||||
margin_left = 3.0
|
||||
margin_top = 50.0
|
||||
margin_right = 69.0
|
||||
|
@ -60,6 +62,7 @@ texture = ExtResource( 8 )
|
|||
stretch_mode = 4
|
||||
|
||||
[node name="ShardCounter" type="Label" parent="FileExists"]
|
||||
unique_name_in_owner = true
|
||||
margin_left = 43.0
|
||||
margin_top = 20.0
|
||||
margin_right = 67.0
|
||||
|
@ -67,6 +70,7 @@ margin_bottom = 30.0
|
|||
text = "00"
|
||||
|
||||
[node name="KeyCounter" type="Label" parent="FileExists"]
|
||||
unique_name_in_owner = true
|
||||
margin_left = 43.0
|
||||
margin_top = 33.0
|
||||
margin_right = 64.0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue