2024-08-24 15:25:30 +02:00
|
|
|
using Godot;
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
public partial class MainMenu : Control
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
[Export]
|
2025-02-19 11:06:31 +01:00
|
|
|
public PackedScene GameScene { get; set; }
|
2024-08-24 15:25:30 +02:00
|
|
|
|
|
|
|
|
[Export]
|
2024-08-25 17:06:59 +02:00
|
|
|
public string MainMenuScene { get; set; }
|
2024-11-13 17:23:32 +01:00
|
|
|
|
2024-08-24 15:25:30 +02:00
|
|
|
// Called when the node enters the scene tree for the first time.
|
|
|
|
|
public override void _Ready()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
|
|
|
public override void _Process(double delta)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void _on_start_button_pressed()
|
|
|
|
|
{
|
|
|
|
|
if (GameScene != null) {
|
2025-02-19 11:06:31 +01:00
|
|
|
GetTree().ChangeSceneToFile(GameScene.ResourcePath);
|
2024-08-24 15:25:30 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void _on_debug_button_pressed()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void _on_mainmenu_button_pressed()
|
|
|
|
|
{
|
|
|
|
|
if (MainMenuScene != null) {
|
2024-08-25 17:06:59 +02:00
|
|
|
GetTree().ChangeSceneToFile(MainMenuScene);
|
2024-08-24 15:25:30 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void _on_exit_button_pressed()
|
|
|
|
|
{
|
|
|
|
|
GetTree().Quit();
|
|
|
|
|
}
|
|
|
|
|
}
|