Projekt přejmenován. Neko nastaven na výchozí pozici

This commit is contained in:
Perry 2026-03-22 18:31:05 +01:00
parent 1a27dd6fab
commit ceac37920b
104 changed files with 873 additions and 208 deletions

View file

@ -0,0 +1,37 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace ONDClient.GUI;
public class LoadingUIElement : TextUIElement {
private string expectedEndpoint;
private Client.ConnectionState lastState = Client.ConnectionState.IDLE;
public LoadingUIElement(Point corner1, SpriteFont font, string expectedEndpoint, Alignment alignment = Alignment.CENTER, bool autoBounds = true) : base(corner1, font, alignment, autoBounds) {
this.expectedEndpoint = expectedEndpoint;
Active = true;
// Color = Color.LightGray;
}
public override void Update() {
if(lastState == Client.State) return;
lastState = Client.State;
switch (Client.State){
case Client.ConnectionState.CONNECTING:
Text = "Connecting to " + expectedEndpoint;
break;
case Client.ConnectionState.CONNECTED:
Text = "Connected to " + expectedEndpoint;
break;
case Client.ConnectionState.ACCEPTED:
Text = "Waiting for opponent...";
break;
case Client.ConnectionState.GAME_STARTING:
Text = "Opponent: " + Client.Opponent.username;
Color = Color.White;
// ScaleMultiplier = 1.5f;
break;
}
}
}