diff --git a/scenes/UI/ChooseScene.gd b/scenes/UI/ChooseScene.gd new file mode 100644 index 0000000..aa5922a --- /dev/null +++ b/scenes/UI/ChooseScene.gd @@ -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") diff --git a/scenes/UI/ChooseScene.tscn b/scenes/UI/ChooseScene.tscn index 81d2651..c833225 100644 --- a/scenes/UI/ChooseScene.tscn +++ b/scenes/UI/ChooseScene.tscn @@ -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"] anchor_right = 1.0 anchor_bottom = 1.0 +script = ExtResource( 1 ) __meta__ = { "_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"] diff --git a/scenes/main.gd b/scenes/main.gd index 87349b7..1d9700f 100644 --- a/scenes/main.gd +++ b/scenes/main.gd @@ -7,3 +7,7 @@ func _on_Quit_pressed(): # Load scene about func _on_About_pressed(): 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") diff --git a/scenes/main.tscn b/scenes/main.tscn index 0b74a77..5d5cc56 100644 --- a/scenes/main.tscn +++ b/scenes/main.tscn @@ -36,6 +36,7 @@ text = "Nouveau" margin_top = 36.0 margin_right = 151.0 margin_bottom = 50.0 +disabled = true text = "Reprendre" [node name="About" type="LinkButton" parent="Grid"] @@ -51,5 +52,6 @@ margin_bottom = 86.0 text = "Quitter" 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/Quit" to="." method="_on_Quit_pressed"]