Bugfixy, odstranění nepoužívaných tříd CameraSystem a ITargetingEnemy, přidání dedikované třídy ReturnToMenuElement, předělání pathfinding algoritmu z DFS na BFS, přesun správy obtížnosti do abstraktní třídy Enemy, přidání scriptů pro kompilaci na aplikaci nevyžadující dotnet
This commit is contained in:
parent
ceac37920b
commit
e5d746d597
24 changed files with 258 additions and 138 deletions
|
|
@ -1,14 +1,15 @@
|
|||
using System;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
|
||||
namespace ONDClient.GUI;
|
||||
|
||||
public class LoadingUIElement : TextUIElement {
|
||||
private string expectedEndpoint;
|
||||
private Func<string> expectedEndpointGetter;
|
||||
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;
|
||||
|
||||
public LoadingUIElement(Point corner1, SpriteFont font, Func<string> expectedEndpointGetter, Alignment alignment = Alignment.CENTER, bool autoBounds = true) : base(corner1, font, alignment, autoBounds) {
|
||||
this.expectedEndpointGetter = expectedEndpointGetter;
|
||||
Active = true;
|
||||
// Color = Color.LightGray;
|
||||
}
|
||||
|
|
@ -19,10 +20,10 @@ public class LoadingUIElement : TextUIElement {
|
|||
|
||||
switch (Client.State){
|
||||
case Client.ConnectionState.CONNECTING:
|
||||
Text = "Connecting to " + expectedEndpoint;
|
||||
Text = "Connecting to " + expectedEndpointGetter();
|
||||
break;
|
||||
case Client.ConnectionState.CONNECTED:
|
||||
Text = "Connected to " + expectedEndpoint;
|
||||
Text = "Connected to " + expectedEndpointGetter();
|
||||
break;
|
||||
case Client.ConnectionState.ACCEPTED:
|
||||
Text = "Waiting for opponent...";
|
||||
|
|
@ -32,6 +33,12 @@ public class LoadingUIElement : TextUIElement {
|
|||
Color = Color.White;
|
||||
// ScaleMultiplier = 1.5f;
|
||||
break;
|
||||
case Client.ConnectionState.IDLE:
|
||||
Text = "Idle";
|
||||
break;
|
||||
case Client.ConnectionState.DISCONNECTED:
|
||||
Text = "Disconnected: " + Client.StatusText;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue