first commit
This commit is contained in:
34
scripts/stages/menus/MenuMain.cs
Normal file
34
scripts/stages/menus/MenuMain.cs
Normal file
@ -0,0 +1,34 @@
|
||||
using BallanceStalker;
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public class MenuMain : Control {
|
||||
|
||||
[Signal]
|
||||
public delegate void MenuMain_GotoPage(MenuManager.MenuPage menu_type);
|
||||
[Signal]
|
||||
public delegate void MenuMain_Back();
|
||||
[Signal]
|
||||
public delegate void MenuMain_Exit();
|
||||
|
||||
// Called when the node enters the scene tree for the first time.
|
||||
public override void _Ready() {
|
||||
GetNode<ButtonCommon>("MenuList/BtnLoadLevel").Connect("pressed", this, nameof(Proc_GotoPage), new Godot.Collections.Array() { MenuManager.MenuPage.LoadLevel });
|
||||
GetNode<ButtonCommon>("MenuList/BtnLoadSky").Connect("pressed", this, nameof(Proc_GotoPage), new Godot.Collections.Array() { MenuManager.MenuPage.LoadSky });
|
||||
GetNode<ButtonCommon>("MenuList/BtnMultiplayer").Connect("pressed", this, nameof(Proc_GotoPage), new Godot.Collections.Array() { MenuManager.MenuPage.Multiplayer });
|
||||
GetNode<ButtonCommon>("MenuList/BtnAbout").Connect("pressed", this, nameof(Proc_GotoPage), new Godot.Collections.Array() { MenuManager.MenuPage.About });
|
||||
GetNode<ButtonCommon>("MenuList/BtnBack").Connect("pressed", this, nameof(Proc_Back));
|
||||
GetNode<ButtonCommon>("MenuList/BtnExit").Connect("pressed", this, nameof(Proc_Exit));
|
||||
}
|
||||
|
||||
private void Proc_GotoPage(MenuManager.MenuPage menu_type) {
|
||||
EmitSignal(nameof(MenuMain_GotoPage), menu_type);
|
||||
}
|
||||
private void Proc_Back() {
|
||||
EmitSignal(nameof(MenuMain_Back));
|
||||
}
|
||||
private void Proc_Exit() {
|
||||
EmitSignal(nameof(MenuMain_Exit));
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user