2024-08-15 13:15:33 +00:00
|
|
|
using Godot;
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
public partial class main_menu : Control
|
|
|
|
|
{
|
|
|
|
|
// Called when the node enters the scene tree for the first time.
|
2025-04-22 22:51:12 +00:00
|
|
|
private input_menu _inputMenu;
|
2025-04-23 14:56:10 +00:00
|
|
|
private ship_choice _shipChoice;
|
|
|
|
|
private VBoxContainer _layout;
|
2025-04-22 22:51:12 +00:00
|
|
|
|
2024-08-15 13:15:33 +00:00
|
|
|
public override void _Ready()
|
|
|
|
|
{
|
2025-04-22 22:51:12 +00:00
|
|
|
_inputMenu = GetNode<input_menu>("InputMenu");
|
2025-04-23 14:56:10 +00:00
|
|
|
_shipChoice = GetNode<ship_choice>("ShipChoice");
|
|
|
|
|
_layout = GetNode<VBoxContainer>("CanvasLayer/CenterContainer/Layout");
|
2025-04-22 22:51:12 +00:00
|
|
|
|
2024-08-15 13:15:33 +00:00
|
|
|
//Connecting Buttons
|
2025-04-23 14:56:10 +00:00
|
|
|
GetNode<Button>("CanvasLayer/CenterContainer/Layout/StartButton").Pressed += OnStartButtonPressed;
|
|
|
|
|
GetNode<Button>("CanvasLayer/CenterContainer/Layout/ExitButton").Pressed += OnExitButtonPressed;
|
|
|
|
|
GetNode<Button>("CanvasLayer/CenterContainer/Layout/InputButton").Pressed += OnInputButtonPressed;
|
|
|
|
|
|
2024-08-15 13:15:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OnStartButtonPressed()
|
|
|
|
|
{
|
2025-04-23 14:56:10 +00:00
|
|
|
_layout.Hide();
|
|
|
|
|
_shipChoice.Show();
|
2024-08-15 13:15:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OnExitButtonPressed()
|
|
|
|
|
{
|
|
|
|
|
GetTree().Quit();
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-22 22:51:12 +00:00
|
|
|
private void OnInputButtonPressed()
|
|
|
|
|
{
|
|
|
|
|
_inputMenu.Show();
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-19 22:24:46 +00:00
|
|
|
// Called every frame. 'delta' has been the elapsed time since the previous frame.
|
2024-08-15 13:15:33 +00:00
|
|
|
public override void _Process(double delta)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|