Merge pull request 'bugfix/loading-for-debug-mode' (#30) from bugfix/loading-for-debug-mode into dev
Reviewed-on: Athena/game-source#30
This commit is contained in:
+7
-3
@@ -9,6 +9,8 @@ func _ready():
|
|||||||
print("[global#_ready] get root scene")
|
print("[global#_ready] get root scene")
|
||||||
var root = get_tree().get_root()
|
var root = get_tree().get_root()
|
||||||
current_scene = root.get_child(root.get_child_count() - 1)
|
current_scene = root.get_child(root.get_child_count() - 1)
|
||||||
|
if current_scene.name != "Main":
|
||||||
|
get_node("/root/Loading").hide()
|
||||||
|
|
||||||
func goto_scene(path):
|
func goto_scene(path):
|
||||||
print("[global#goto_scene]")
|
print("[global#goto_scene]")
|
||||||
@@ -20,6 +22,8 @@ func goto_scene(path):
|
|||||||
set_process(true)
|
set_process(true)
|
||||||
current_scene.queue_free()
|
current_scene.queue_free()
|
||||||
wait_frames = 1
|
wait_frames = 1
|
||||||
|
Loading.get_node("ColorRect/CenterContainer/VBoxContainer/ProgressBar").set_max(loader.get_stage_count())
|
||||||
|
|
||||||
|
|
||||||
func _process(_delta):
|
func _process(_delta):
|
||||||
print("[global#_process]")
|
print("[global#_process]")
|
||||||
@@ -50,9 +54,9 @@ func _process(_delta):
|
|||||||
break
|
break
|
||||||
|
|
||||||
func update_progress():
|
func update_progress():
|
||||||
var progress = float(loader.get_stage()) / loader.get_stage_count()
|
print("[global#update_progress]")
|
||||||
print("[global#update_progress] " + String(progress))
|
Loading.visible = true
|
||||||
get_node("/root/Loading").visible = true
|
Loading.get_node("ColorRect/CenterContainer/VBoxContainer/ProgressBar").set_value(loader.get_stage())
|
||||||
|
|
||||||
func set_new_scene(scene_resource):
|
func set_new_scene(scene_resource):
|
||||||
print("[global#set_new_scene]")
|
print("[global#set_new_scene]")
|
||||||
|
|||||||
+16
-3
@@ -20,19 +20,32 @@ __meta__ = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[node name="CenterContainer" type="CenterContainer" parent="ColorRect"]
|
[node name="CenterContainer" type="CenterContainer" parent="ColorRect"]
|
||||||
|
margin_top = 282.0
|
||||||
margin_right = 1024.0
|
margin_right = 1024.0
|
||||||
margin_bottom = 600.0
|
margin_bottom = 282.0
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[node name="VBoxContainer" type="VBoxContainer" parent="ColorRect/CenterContainer"]
|
[node name="VBoxContainer" type="VBoxContainer" parent="ColorRect/CenterContainer"]
|
||||||
margin_left = 479.0
|
margin_left = 479.0
|
||||||
margin_top = 293.0
|
|
||||||
margin_right = 544.0
|
margin_right = 544.0
|
||||||
margin_bottom = 307.0
|
margin_bottom = 32.0
|
||||||
|
alignment = 1
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
|
||||||
[node name="Label" type="Label" parent="ColorRect/CenterContainer/VBoxContainer"]
|
[node name="Label" type="Label" parent="ColorRect/CenterContainer/VBoxContainer"]
|
||||||
margin_right = 65.0
|
margin_right = 65.0
|
||||||
margin_bottom = 14.0
|
margin_bottom = 14.0
|
||||||
text = "Loading ..."
|
text = "Loading ..."
|
||||||
|
align = 1
|
||||||
|
|
||||||
|
[node name="ProgressBar" type="ProgressBar" parent="ColorRect/CenterContainer/VBoxContainer"]
|
||||||
|
margin_top = 18.0
|
||||||
|
margin_right = 65.0
|
||||||
|
margin_bottom = 32.0
|
||||||
|
max_value = 1.0
|
||||||
|
step = 0.1
|
||||||
|
rounded = true
|
||||||
|
|||||||
Reference in New Issue
Block a user