Complete menu navigation

This commit is contained in:
VAILLANT Jeremy
2021-05-08 13:44:51 +02:00
parent 4bd3daa747
commit b683302b2b
4 changed files with 38 additions and 1 deletions
+7
View File
@@ -0,0 +1,7 @@
extends Control
func _on_Return_pressed():
get_tree().change_scene("res://scenes/main.tscn")
func _on_WarCraft_pressed():
get_tree().change_scene("res://scenes/levels/WarCraft.tscn")
+25 -1
View File
@@ -1,8 +1,32 @@
[gd_scene format=2] [gd_scene load_steps=2 format=2]
[ext_resource path="res://scenes/UI/ChooseScene.gd" type="Script" id=1]
[node name="ChooseScene" type="Control"] [node name="ChooseScene" type="Control"]
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
script = ExtResource( 1 )
__meta__ = { __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false
} }
[node name="GridContainer" type="GridContainer" parent="."]
margin_right = 1024.0
margin_bottom = 600.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Return" type="LinkButton" parent="GridContainer"]
margin_right = 54.0
margin_bottom = 14.0
text = "back"
[node name="WarCraft" type="LinkButton" parent="GridContainer"]
margin_top = 18.0
margin_right = 54.0
margin_bottom = 32.0
text = "WarCraft"
[connection signal="pressed" from="GridContainer/Return" to="." method="_on_Return_pressed"]
[connection signal="pressed" from="GridContainer/WarCraft" to="." method="_on_WarCraft_pressed"]
+4
View File
@@ -7,3 +7,7 @@ func _on_Quit_pressed():
# Load scene about # Load scene about
func _on_About_pressed(): func _on_About_pressed():
get_tree().change_scene("res://scenes/UI/About.tscn") get_tree().change_scene("res://scenes/UI/About.tscn")
# Load scene for select game
func _on_New_pressed():
get_tree().change_scene("res://scenes/UI/ChooseScene.tscn")
+2
View File
@@ -36,6 +36,7 @@ text = "Nouveau"
margin_top = 36.0 margin_top = 36.0
margin_right = 151.0 margin_right = 151.0
margin_bottom = 50.0 margin_bottom = 50.0
disabled = true
text = "Reprendre" text = "Reprendre"
[node name="About" type="LinkButton" parent="Grid"] [node name="About" type="LinkButton" parent="Grid"]
@@ -51,5 +52,6 @@ margin_bottom = 86.0
text = "Quitter" text = "Quitter"
script = SubResource( 1 ) script = SubResource( 1 )
[connection signal="pressed" from="Grid/New" to="." method="_on_New_pressed"]
[connection signal="pressed" from="Grid/About" to="." method="_on_About_pressed"] [connection signal="pressed" from="Grid/About" to="." method="_on_About_pressed"]
[connection signal="pressed" from="Grid/Quit" to="." method="_on_Quit_pressed"] [connection signal="pressed" from="Grid/Quit" to="." method="_on_Quit_pressed"]