Merge remote-tracking branch 'origin/master'
# Conflicts: # src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/client/gui/lounge/LoungeSceneViewController.java
This commit is contained in:
commit
d71da4cf0c
@ -374,10 +374,6 @@ public class Client {
|
|||||||
case GuiParameters.VoteIsOver:
|
case GuiParameters.VoteIsOver:
|
||||||
chatApp.getGameController().clearAllNoiseDisplay();
|
chatApp.getGameController().clearAllNoiseDisplay();
|
||||||
break;
|
break;
|
||||||
case GuiParameters.listOfPLayers:
|
|
||||||
updateListOfClients(data);
|
|
||||||
//TODO
|
|
||||||
break;
|
|
||||||
case GuiParameters.getMembersInLobby:
|
case GuiParameters.getMembersInLobby:
|
||||||
updateLobbyMembers(data);
|
updateLobbyMembers(data);
|
||||||
break;
|
break;
|
||||||
@ -398,9 +394,6 @@ public class Client {
|
|||||||
case GuiParameters.newLobbyCreated:
|
case GuiParameters.newLobbyCreated:
|
||||||
makeNewLobby(data);
|
makeNewLobby(data);
|
||||||
break;
|
break;
|
||||||
case GuiParameters.newPlayerOnServer:
|
|
||||||
addNewPlayerToGui(data);
|
|
||||||
break;
|
|
||||||
case GuiParameters.updateHighScore:
|
case GuiParameters.updateHighScore:
|
||||||
chatApp.getLoungeSceneViewController().addHighScore(data);
|
chatApp.getLoungeSceneViewController().addHighScore(data);
|
||||||
break;
|
break;
|
||||||
@ -428,11 +421,6 @@ public class Client {
|
|||||||
LOGGER.debug("Made it into removeLobbyFromGui()");
|
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) {
|
private void makeNewLobby(String data) {
|
||||||
String[] params = data.split(":");
|
String[] params = data.split(":");
|
||||||
loungeSceneViewController.newLobby(params[0], params[1]);
|
loungeSceneViewController.newLobby(params[0], params[1]);
|
||||||
@ -463,14 +451,6 @@ public class Client {
|
|||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateListOfClients(String data) {
|
|
||||||
String[] arr = data.split(":");
|
|
||||||
ObservableList<SimpleStringProperty> 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
|
* Starts a new thread, thad adds a message to notificationText in the gameController, waits 3
|
||||||
|
|||||||
@ -69,10 +69,6 @@ public class LoungeSceneViewController implements Initializable {
|
|||||||
@FXML
|
@FXML
|
||||||
private SplitPane chatSplitPane;
|
private SplitPane chatSplitPane;
|
||||||
@FXML
|
@FXML
|
||||||
private AnchorPane chatAnchorPane;
|
|
||||||
@FXML
|
|
||||||
private AnchorPane otherNotificationAnchorPane;
|
|
||||||
@FXML
|
|
||||||
public Button highScoreButton;
|
public Button highScoreButton;
|
||||||
@FXML
|
@FXML
|
||||||
private Button leaveLobbyButton;
|
private Button leaveLobbyButton;
|
||||||
@ -87,8 +83,6 @@ public class LoungeSceneViewController implements Initializable {
|
|||||||
@FXML
|
@FXML
|
||||||
public ListView<LobbyListItem> LobbyListView;
|
public ListView<LobbyListItem> LobbyListView;
|
||||||
@FXML
|
@FXML
|
||||||
public ListView<ClientListItem> ClientListView;
|
|
||||||
@FXML
|
|
||||||
private Button ChangeNameButton;
|
private Button ChangeNameButton;
|
||||||
@FXML
|
@FXML
|
||||||
private Button LeaveServerButton;
|
private Button LeaveServerButton;
|
||||||
@ -100,7 +94,6 @@ public class LoungeSceneViewController implements Initializable {
|
|||||||
private ToolBar NTtBToolBar;
|
private ToolBar NTtBToolBar;
|
||||||
|
|
||||||
public static ListView<LobbyListItem> lListView;
|
public static ListView<LobbyListItem> lListView;
|
||||||
public static ListView<ClientListItem> cListView;
|
|
||||||
|
|
||||||
public static ClientModel client;
|
public static ClientModel client;
|
||||||
private static ChatApp chatApp;
|
private static ChatApp chatApp;
|
||||||
@ -153,10 +146,7 @@ public class LoungeSceneViewController implements Initializable {
|
|||||||
newGameButton.setOnAction(event -> newGame());
|
newGameButton.setOnAction(event -> newGame());
|
||||||
LobbyListView.setVisible(true);
|
LobbyListView.setVisible(true);
|
||||||
lListView = LobbyListView;
|
lListView = LobbyListView;
|
||||||
cListView = ClientListView;
|
|
||||||
LOGGER.debug("Lobby in initialize" + LobbyListView);
|
LOGGER.debug("Lobby in initialize" + LobbyListView);
|
||||||
ClientListView.setVisible(true);
|
|
||||||
ClientListView.setItems(clients);
|
|
||||||
addChatView();
|
addChatView();
|
||||||
addBackgroundDay();
|
addBackgroundDay();
|
||||||
LOGGER.debug("cApp = " + cApp);
|
LOGGER.debug("cApp = " + cApp);
|
||||||
@ -395,7 +385,7 @@ public class LoungeSceneViewController implements Initializable {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
chatAnchorPane.getChildren().add(chatApp.chat);
|
ChatArea.getChildren().add(chatApp.chat);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.debug("Not yet initialized: chatAnchorPane");
|
LOGGER.debug("Not yet initialized: chatAnchorPane");
|
||||||
}
|
}
|
||||||
@ -513,45 +503,6 @@ public class LoungeSceneViewController implements Initializable {
|
|||||||
client.getClient().sendMsgToServer(Protocol.clientQuitRequest);
|
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<ClientListItem> 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
|
* Sends the create New Lobby Protocol message
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -44,7 +44,7 @@
|
|||||||
<RowConstraints minHeight="10.0" percentHeight="90.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="10.0" percentHeight="90.0" vgrow="SOMETIMES" />
|
||||||
</rowConstraints>
|
</rowConstraints>
|
||||||
<children>
|
<children>
|
||||||
<AnchorPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="56.0" prefWidth="125.0" GridPane.halignment="CENTER" GridPane.hgrow="ALWAYS" GridPane.valignment="CENTER" GridPane.vgrow="ALWAYS">
|
<AnchorPane fx:id="sendButtonAnchor" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="56.0" prefWidth="125.0" GridPane.halignment="CENTER" GridPane.hgrow="ALWAYS" GridPane.valignment="CENTER" GridPane.vgrow="ALWAYS">
|
||||||
<children>
|
<children>
|
||||||
<Button fx:id="sendButton" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" prefHeight="56.0" prefWidth="178.0" text="Send" textOverrun="CENTER_WORD_ELLIPSIS" wrapText="true" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
<Button fx:id="sendButton" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" prefHeight="56.0" prefWidth="178.0" text="Send" textOverrun="CENTER_WORD_ELLIPSIS" wrapText="true" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
<font>
|
<font>
|
||||||
@ -55,7 +55,7 @@
|
|||||||
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
|
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
|
||||||
</GridPane.margin>
|
</GridPane.margin>
|
||||||
</AnchorPane>
|
</AnchorPane>
|
||||||
<AnchorPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="92.0" prefWidth="85.0" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.hgrow="ALWAYS" GridPane.valignment="CENTER" GridPane.vgrow="ALWAYS">
|
<AnchorPane fx:id="whisperAnchor" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="92.0" prefWidth="85.0" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.hgrow="ALWAYS" GridPane.valignment="CENTER" GridPane.vgrow="ALWAYS">
|
||||||
<children>
|
<children>
|
||||||
<TextField fx:id="whisperTargetSelectField" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="56.0" prefWidth="488.0" promptText="whisper..." AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
|
<TextField fx:id="whisperTargetSelectField" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="56.0" prefWidth="488.0" promptText="whisper..." AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
|
||||||
</children>
|
</children>
|
||||||
@ -63,7 +63,7 @@
|
|||||||
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
|
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
|
||||||
</GridPane.margin>
|
</GridPane.margin>
|
||||||
</AnchorPane>
|
</AnchorPane>
|
||||||
<AnchorPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="92.0" prefWidth="366.0" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.hgrow="ALWAYS" GridPane.valignment="CENTER" GridPane.vgrow="ALWAYS">
|
<AnchorPane fx:id="chatinputAnchor" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="92.0" prefWidth="366.0" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.hgrow="ALWAYS" GridPane.valignment="CENTER" GridPane.vgrow="ALWAYS">
|
||||||
<children>
|
<children>
|
||||||
<TextField fx:id="chatMsgField" layoutX="-420.0" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="56.0" prefWidth="1372.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
|
<TextField fx:id="chatMsgField" layoutX="-420.0" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="56.0" prefWidth="1372.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
|
||||||
</children>
|
</children>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 87 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 30 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.9 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 13 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 947 KiB After Width: | Height: | Size: 137 KiB |
@ -35,31 +35,30 @@
|
|||||||
</AnchorPane>
|
</AnchorPane>
|
||||||
</center>
|
</center>
|
||||||
<bottom>
|
<bottom>
|
||||||
<AnchorPane fx:id="ChatArea" pickOnBounds="false" BorderPane.alignment="CENTER">
|
<AnchorPane fx:id="ChatArea" pickOnBounds="false" prefHeight="83.0" prefWidth="578.0" BorderPane.alignment="CENTER">
|
||||||
<children>
|
<children>
|
||||||
<SplitPane fx:id="chatSplitPane" dividerPositions="0.46467817896389324" minHeight="50.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
<SplitPane fx:id="chatSplitPane" disable="true" dividerPositions="0.5" layoutY="-34.0" minHeight="50.0" prefHeight="46.0" prefWidth="578.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
<items>
|
<items>
|
||||||
<AnchorPane fx:id="chatAnchorPane" minHeight="0.0" minWidth="0.0" />
|
<AnchorPane fx:id="ChatArea" prefHeight="200.0" prefWidth="200.0" />
|
||||||
<AnchorPane fx:id="otherNotificationAnchorPane" minHeight="0.0" minWidth="0.0">
|
<AnchorPane prefHeight="200.0" prefWidth="200.0" />
|
||||||
<children>
|
</items></SplitPane>
|
||||||
<Label text="High Score:" />
|
|
||||||
<TextFlow fx:id="highScore" layoutY="18.0" prefHeight="30.0" prefWidth="99.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="239.0" AnchorPane.topAnchor="18.0" />
|
|
||||||
<Label layoutX="120.0" text="Lobbies:" />
|
|
||||||
<TextFlow fx:id="lobbyPrint" layoutX="120.0" layoutY="18.0" />
|
|
||||||
<Line endX="-6.5" endY="-24.0" layoutX="120.0" layoutY="24.0" startX="-6.5" startY="48.5" AnchorPane.bottomAnchor="0.0" AnchorPane.topAnchor="0.0" />
|
|
||||||
</children>
|
|
||||||
</AnchorPane>
|
|
||||||
</items>
|
|
||||||
</SplitPane>
|
|
||||||
</children>
|
</children>
|
||||||
</AnchorPane>
|
</AnchorPane>
|
||||||
</bottom>
|
</bottom>
|
||||||
<left>
|
|
||||||
<ListView fx:id="ClientListView" pickOnBounds="false" BorderPane.alignment="CENTER" />
|
|
||||||
</left>
|
|
||||||
<right>
|
<right>
|
||||||
<ListView fx:id="LobbyListView" pickOnBounds="false" BorderPane.alignment="CENTER" />
|
<ListView fx:id="LobbyListView" pickOnBounds="false" BorderPane.alignment="CENTER" />
|
||||||
</right>
|
</right>
|
||||||
|
<left>
|
||||||
|
<AnchorPane prefHeight="316.0" prefWidth="181.0" BorderPane.alignment="CENTER">
|
||||||
|
<children>
|
||||||
|
<Label layoutX="59.0" layoutY="200.0" text="High Score:" />
|
||||||
|
<TextFlow fx:id="highScore" layoutX="62.0" layoutY="232.0" prefHeight="167.0" prefWidth="181.0" AnchorPane.bottomAnchor="1.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="232.0" />
|
||||||
|
<Label layoutX="67.0" layoutY="6.0" text="Players:" />
|
||||||
|
<TextFlow fx:id="lobbyPrint" layoutX="5.0" layoutY="23.0" prefHeight="178.0" prefWidth="171.0" />
|
||||||
|
<Line endX="72.5" layoutX="91.0" layoutY="201.0" startX="-79.5" />
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
</left>
|
||||||
</BorderPane>
|
</BorderPane>
|
||||||
<AnchorPane fx:id="gameDisplayAnchorPane" maxHeight="843.75" maxWidth="1500.0" pickOnBounds="false" />
|
<AnchorPane fx:id="gameDisplayAnchorPane" maxHeight="843.75" maxWidth="1500.0" pickOnBounds="false" />
|
||||||
</children>
|
</children>
|
||||||
|
|||||||
Reference in New Issue
Block a user