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