Close #8 - Fix loading value progress
This commit is contained in:
+6
-4
@@ -10,7 +10,7 @@ func _ready():
|
||||
var root = get_tree().get_root()
|
||||
current_scene = root.get_child(root.get_child_count() - 1)
|
||||
if current_scene.name != "Main":
|
||||
get_node("/root/Loading").hide()
|
||||
get_node("/root/Loading").hide()
|
||||
|
||||
func goto_scene(path):
|
||||
print("[global#goto_scene]")
|
||||
@@ -22,6 +22,8 @@ func goto_scene(path):
|
||||
set_process(true)
|
||||
current_scene.queue_free()
|
||||
wait_frames = 1
|
||||
Loading.get_node("ColorRect/CenterContainer/VBoxContainer/ProgressBar").set_max(loader.get_stage_count())
|
||||
|
||||
|
||||
func _process(_delta):
|
||||
print("[global#_process]")
|
||||
@@ -52,9 +54,9 @@ func _process(_delta):
|
||||
break
|
||||
|
||||
func update_progress():
|
||||
var progress = float(loader.get_stage()) / loader.get_stage_count()
|
||||
print("[global#update_progress] " + String(progress))
|
||||
get_node("/root/Loading").visible = true
|
||||
print("[global#update_progress]")
|
||||
Loading.visible = true
|
||||
Loading.get_node("ColorRect/CenterContainer/VBoxContainer/ProgressBar").set_value(loader.get_stage())
|
||||
|
||||
func set_new_scene(scene_resource):
|
||||
print("[global#set_new_scene]")
|
||||
|
||||
Reference in New Issue
Block a user