Added navigation to main menu options

This commit is contained in:
Marco 2025-03-12 15:47:57 +01:00
commit 316880cf9d
6 changed files with 54 additions and 8 deletions

View file

@ -14,6 +14,9 @@ public partial class MainMenu : CanvasLayer
[Export]
public Control SubMenuHolder { get; set; } = new Control();
[Export]
public Button DefaultSelectedButton { get; private set; }
[Export]
public AudioStreamPlayer2D MusicPlayer { get; private set; }
@ -36,6 +39,7 @@ public partial class MainMenu : CanvasLayer
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
DefaultSelectedButton.GrabFocus();
}
// Called every frame. 'delta' is the elapsed time since the previous frame.
@ -103,6 +107,8 @@ public partial class MainMenu : CanvasLayer
{
MusicPlayer.Play();
}
DefaultSelectedButton.GrabFocus();
};
}