mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-12 00:47:26 -04:00
Launcher: Server list: reset color of labels probably
This commit is contained in:
parent
dd5c864d60
commit
ab26b33d99
@ -107,9 +107,9 @@ public class ServerListCell extends ListCell<Server> implements Initializable {
|
|||||||
|
|
||||||
// clear all cells
|
// clear all cells
|
||||||
motd.setText("");
|
motd.setText("");
|
||||||
motd.setTextFill(Color.BLACK);
|
motd.setStyle(null);
|
||||||
version.setText("Connecting...");
|
version.setText("Connecting...");
|
||||||
version.setTextFill(Color.BLACK);
|
version.setStyle(null);
|
||||||
players.setText("");
|
players.setText("");
|
||||||
optionsConnect.setOnAction(e -> connect());
|
optionsConnect.setOnAction(e -> connect());
|
||||||
optionsConnect.setDisable(true);
|
optionsConnect.setDisable(true);
|
||||||
@ -143,8 +143,9 @@ public class ServerListCell extends ListCell<Server> implements Initializable {
|
|||||||
// Offline
|
// Offline
|
||||||
players.setText("");
|
players.setText("");
|
||||||
version.setText("Offline");
|
version.setText("Offline");
|
||||||
|
version.setStyle("-fx-text-fill: red;");
|
||||||
motd.setText(String.format("%s", server.getLastPing().getLastConnectionException()));
|
motd.setText(String.format("%s", server.getLastPing().getLastConnectionException()));
|
||||||
motd.setTextFill(Color.RED);
|
motd.setStyle("-fx-text-fill: red;");
|
||||||
optionsConnect.setDisable(true);
|
optionsConnect.setDisable(true);
|
||||||
canConnect = false;
|
canConnect = false;
|
||||||
return;
|
return;
|
||||||
@ -155,11 +156,11 @@ public class ServerListCell extends ListCell<Server> implements Initializable {
|
|||||||
serverVersion = Versions.getVersionById(ping.getProtocolNumber());
|
serverVersion = Versions.getVersionById(ping.getProtocolNumber());
|
||||||
} else {
|
} else {
|
||||||
serverVersion = Versions.getVersionById(server.getDesiredVersion());
|
serverVersion = Versions.getVersionById(server.getDesiredVersion());
|
||||||
version.setTextFill(Color.GREEN);
|
version.setStyle("-fx-text-fill: green;");
|
||||||
}
|
}
|
||||||
if (serverVersion == null) {
|
if (serverVersion == null) {
|
||||||
version.setText(ping.getServerVersion());
|
version.setText(ping.getServerVersion());
|
||||||
version.setTextFill(Color.RED);
|
version.setStyle("-fx-text-fill: red;");
|
||||||
optionsConnect.setDisable(true);
|
optionsConnect.setDisable(true);
|
||||||
canConnect = false;
|
canConnect = false;
|
||||||
} else {
|
} else {
|
||||||
|
@ -31,7 +31,8 @@ import java.io.IOException;
|
|||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.net.*;
|
import java.net.InetSocketAddress;
|
||||||
|
import java.net.Socket;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
|
||||||
public class Network {
|
public class Network {
|
||||||
@ -206,9 +207,7 @@ public class Network {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// Could not connect
|
// Could not connect
|
||||||
lastException = e;
|
lastException = e;
|
||||||
if (e instanceof SocketTimeoutException || e instanceof ConnectException || e instanceof UnknownHostException) {
|
connection.setConnectionState(ConnectionStates.FAILED);
|
||||||
connection.setConnectionState(ConnectionStates.FAILED);
|
|
||||||
}
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user