diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/client/Client.java b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/client/Client.java index 300fea7..3d6d5e1 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/client/Client.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/client/Client.java @@ -374,10 +374,6 @@ public class Client { case GuiParameters.VoteIsOver: chatApp.getGameController().clearAllNoiseDisplay(); break; - case GuiParameters.listOfPLayers: - updateListOfClients(data); - //TODO - break; case GuiParameters.getMembersInLobby: updateLobbyMembers(data); break; @@ -398,9 +394,6 @@ public class Client { case GuiParameters.newLobbyCreated: makeNewLobby(data); break; - case GuiParameters.newPlayerOnServer: - addNewPlayerToGui(data); - break; case GuiParameters.updateHighScore: chatApp.getLoungeSceneViewController().addHighScore(data); break; @@ -428,11 +421,6 @@ public class Client { LOGGER.debug("Made it into removeLobbyFromGui()"); } - private void addNewPlayerToGui(String data) { - loungeSceneViewController.addClientToList(data); - LOGGER.debug("addNewPlayerToGui() seems to have finished"); - } - private void makeNewLobby(String data) { String[] params = data.split(":"); loungeSceneViewController.newLobby(params[0], params[1]); @@ -463,14 +451,6 @@ public class Client { //TODO } - private void updateListOfClients(String data) { - String[] arr = data.split(":"); - ObservableList list = new SimpleListProperty<>(); - int n = arr.length; - for (int i = 0; i < n; i = i + 1) { - loungeSceneViewController.addClientToList(arr[i]); - } - } /** * Starts a new thread, thad adds a message to notificationText in the gameController, waits 3 diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/client/gui/lounge/LoungeSceneViewController.java b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/client/gui/lounge/LoungeSceneViewController.java index 8ad72d7..4b18637 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/client/gui/lounge/LoungeSceneViewController.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/client/gui/lounge/LoungeSceneViewController.java @@ -69,10 +69,6 @@ public class LoungeSceneViewController implements Initializable { @FXML private SplitPane chatSplitPane; @FXML - private AnchorPane chatAnchorPane; - @FXML - private AnchorPane otherNotificationAnchorPane; - @FXML public Button highScoreButton; @FXML private Button leaveLobbyButton; @@ -87,8 +83,6 @@ public class LoungeSceneViewController implements Initializable { @FXML public ListView LobbyListView; @FXML - public ListView ClientListView; - @FXML private Button ChangeNameButton; @FXML private Button LeaveServerButton; @@ -100,7 +94,6 @@ public class LoungeSceneViewController implements Initializable { private ToolBar NTtBToolBar; public static ListView lListView; - public static ListView cListView; public static ClientModel client; private static ChatApp chatApp; @@ -153,10 +146,7 @@ public class LoungeSceneViewController implements Initializable { newGameButton.setOnAction(event -> newGame()); LobbyListView.setVisible(true); lListView = LobbyListView; - cListView = ClientListView; LOGGER.debug("Lobby in initialize" + LobbyListView); - ClientListView.setVisible(true); - ClientListView.setItems(clients); addChatView(); addBackgroundDay(); LOGGER.debug("cApp = " + cApp); @@ -395,7 +385,7 @@ public class LoungeSceneViewController implements Initializable { @Override public void run() { try { - chatAnchorPane.getChildren().add(chatApp.chat); + ChatArea.getChildren().add(chatApp.chat); } catch (Exception e) { LOGGER.debug("Not yet initialized: chatAnchorPane"); } @@ -513,45 +503,6 @@ public class LoungeSceneViewController implements Initializable { client.getClient().sendMsgToServer(Protocol.clientQuitRequest); } - /** - * Used to add a new player to the list of players. "NPLOS" {@link ch.unibas.dmi.dbis.cs108.multiplayer.helpers.GuiParameters} - * - * @param s the information corresponding to to the client in String from - */ - public void addClientToList(String s) { - ClientListItem cl = new ClientListItem(s); - ClientListView = cListView; - Platform.runLater(new Runnable() { - @Override - public void run() { - clients.add(cl); - LOGGER.debug("in addClientToList() in run()"); - LOGGER.debug(cl.toString() + " in run()"); - } - }); - - } - - /** - * Sould remove a client of a certain name from the ListView - * - * @param name the name of the client to be removed - */ - public void removeClientFromList(String name) { - Iterator it = clients.iterator(); - while (it.hasNext()) { - String uid = it.next().getName(); - if (uid.equals(name)) { - it.remove(); - break; - } - } - } - - public void removeClientFromLobby(String s) { - //todo - } - /** * Sends the create New Lobby Protocol message */ diff --git a/src/main/resources/ch/unibas/dmi/dbis/cs108/multiplayer/client/gui/chat/ChatView.fxml b/src/main/resources/ch/unibas/dmi/dbis/cs108/multiplayer/client/gui/chat/ChatView.fxml index 1565d1a..33d289f 100644 --- a/src/main/resources/ch/unibas/dmi/dbis/cs108/multiplayer/client/gui/chat/ChatView.fxml +++ b/src/main/resources/ch/unibas/dmi/dbis/cs108/multiplayer/client/gui/chat/ChatView.fxml @@ -44,7 +44,7 @@ - +