feat: Start of bracket screen, main menu connect screen done, connection fixes
This commit is contained in:
23
scripts/ConnectButtonUI.cs
Normal file
23
scripts/ConnectButtonUI.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class ConnectButtonUI : Button
|
||||
{
|
||||
[Export] public TextEdit addressUI;
|
||||
[Export] public Label errorLabel;
|
||||
[Export] public PackedScene nextScene;
|
||||
|
||||
public override void _Pressed()
|
||||
{
|
||||
if (Connection.Instance.Connect(addressUI.Text))
|
||||
{
|
||||
GD.Print("Success!");
|
||||
GetTree().ChangeSceneToPacked(nextScene);
|
||||
}
|
||||
else
|
||||
{
|
||||
errorLabel.Text = "Couldn't connect to server!";
|
||||
}
|
||||
base._Pressed();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user