41 lines
1009 B
C#
41 lines
1009 B
C#
using Godot;
|
|
|
|
public partial class MainMenu : Node2D
|
|
{
|
|
private AnimationPlayer _animationPlayer;
|
|
|
|
[Signal]
|
|
public delegate void IntroAnimationsCompletedEventHandler();
|
|
|
|
public override void _Ready()
|
|
{
|
|
GetParent().GetNode<TextureRect>("MainMenu/UIAnimations/LoreSplash").Show();
|
|
_animationPlayer = GetTree().Root.GetNode<AnimationPlayer>("/root/Main/MainMenu/UIAnimations/AnimationPlayer");
|
|
_animationPlayer.Queue("IntroLore");
|
|
var bgmPlayer = GetTree().Root.GetNode<BGMPlayer>("BgmPlayer");
|
|
bgmPlayer.SetBGMFromFilepath("Audio/BGM/TitleTheme.ogg");
|
|
bgmPlayer.PlayBGM();
|
|
}
|
|
|
|
|
|
|
|
private void OneSinglePlayerPressed()
|
|
{
|
|
Hide();
|
|
var main = GetTree().Root.GetNode<Main>("/root/Main");
|
|
main.LoadLevel(0, 1);
|
|
}
|
|
|
|
private void OnTwoPlayerPressed()
|
|
{
|
|
Hide();
|
|
var main = GetTree().Root.GetNode<Main>("/root/Main");
|
|
main.LoadLevel(0, 2);
|
|
}
|
|
|
|
private void OnQuitButtonPressed()
|
|
{
|
|
GetTree().Quit();
|
|
}
|
|
}
|