diff --git a/Assets/components/main_menu.tscn b/Assets/components/main_menu.tscn index ebba59c..a651204 100644 --- a/Assets/components/main_menu.tscn +++ b/Assets/components/main_menu.tscn @@ -48,7 +48,25 @@ text = "Settings" layout_mode = 2 text = "Exit" +[node name="ItemList" type="ItemList" parent="."] +visible = false +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -262.0 +offset_top = -352.0 +offset_right = 262.0 +offset_bottom = 352.0 +grow_horizontal = 2 +grow_vertical = 2 +item_count = 1 +item_0/text = "Go Back" + [connection signal="pressed" from="VBoxContainer/Start" to="." method="_on_start_pressed"] [connection signal="pressed" from="VBoxContainer/Load Level" to="." method="_on_load_level_pressed"] [connection signal="pressed" from="VBoxContainer/Settings" to="." method="_on_settings_pressed"] [connection signal="pressed" from="VBoxContainer/Exit" to="." method="_on_exit_pressed"] +[connection signal="item_clicked" from="ItemList" to="." method="_on_item_list_item_clicked"] diff --git a/Assets/scripts/Main Menu.gd b/Assets/scripts/Main Menu.gd index fc0ff46..bd67ed8 100644 --- a/Assets/scripts/Main Menu.gd +++ b/Assets/scripts/Main Menu.gd @@ -19,4 +19,10 @@ func _on_settings_pressed(): func _on_load_level_pressed(): - pass # Replace with function body. + $VBoxContainer.hide() + $ItemList.show() + +func _on_item_list_item_clicked(index, at_position, mouse_button_index): + if index == 0: + $ItemList.hide() + $VBoxContainer.show()