feat: theming pass, reworked connection flow...

- bracket view theming (pending rework)
- some light refactoring
- TOURNAMENT:CANCEL command (pending server side implementation)
- logic for waiting for last moves in games to wait for chip to drop
- transition back to main menu on disconnects, disconnect tolerance
This commit is contained in:
2025-12-07 01:24:13 -05:00
Unverified
parent 7ee74478c3
commit 95c3cef1be
12 changed files with 344 additions and 151 deletions

View File

@@ -1,23 +1,19 @@
using Godot;
using System;
public partial class ConnectButtonUI : Button
{
[Export] public TextEdit AddressUi;
[Export] public TextEdit AddressField;
[Export] public Label ErrorLabel;
private const string BRACKET_SCENE_PATH = "res://scenes/bracket_view.tscn";
public override void _Ready()
{
Connection.Instance.OnWSConnectionSuccess += () => GetTree().ChangeSceneToFile(BRACKET_SCENE_PATH);
Connection.Instance.OnWSConnectionFailed += () => ErrorLabel.Text = "Couldn't connect to server! " + Connection.Instance.LastError;
}
public override void _Pressed()
{
if (Connection.Instance.Connect(AddressUi.Text))
{
GD.Print("Success!");
GetTree().ChangeSceneToFile(BRACKET_SCENE_PATH);
}
else
{
ErrorLabel.Text = "Couldn't connect to server!";
}
base._Pressed();
Connection.Instance.Connect(AddressField.Text);
}
}