mennu
This commit is contained in:
47
menu/start_game_menu.cs
Normal file
47
menu/start_game_menu.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class start_game_menu : Control
|
||||
{
|
||||
private const string _path = "/root/StartGameMenu/";
|
||||
private Button _localMulti, _single, _LANMulti, _join, _host;
|
||||
private Label _error;
|
||||
|
||||
private string Error {
|
||||
set { _error.Set("text", value); }
|
||||
}
|
||||
|
||||
// Called when the node enters the scene tree for the first time.
|
||||
public override void _Ready()
|
||||
{
|
||||
_single = GetNode<Button>(_path + "Btn_Single");
|
||||
_localMulti = GetNode<Button>(_path + "Btn_LocalMulti");
|
||||
_LANMulti = GetNode<Button>(_path + "Btn_LANMulti");
|
||||
_error = GetNode<Label>(_path + "lbl_err");
|
||||
_single.Pressed += () => startSingleGame();
|
||||
_localMulti.Pressed += () => startLocalMultiGame();
|
||||
_LANMulti.Pressed += () => selectLANMultiGame();
|
||||
_host.Pressed += () => startLANMultiGame();
|
||||
_join.Pressed += () => startLANMultiGame(false);
|
||||
}
|
||||
|
||||
// Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
}
|
||||
|
||||
private void startSingleGame() {
|
||||
Error = "single";
|
||||
}
|
||||
private void startLocalMultiGame() {
|
||||
Error = "localmulti";
|
||||
}
|
||||
private void startLANMultiGame(bool isHost = true) {
|
||||
|
||||
}
|
||||
|
||||
private void selectLANMultiGame() {
|
||||
Error = "lanmulti";
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user