Added finish music and merged with text chat.

#story[1249]
This commit is contained in:
Kusal Ekanayake
2017-09-05 15:24:56 +12:00
parent 7a4b3f0ad9
commit f33e4cc137
9 changed files with 51 additions and 11 deletions
@@ -153,8 +153,7 @@ public class GameClient {
if (socketThread != null) {
socketThread.setSocketToClose();
}
Sounds.stopMusic();
Sounds.playMenuMusic();
FXMLLoader fxmlLoader = new FXMLLoader(
getClass().getResource("/views/StartScreenView.fxml"));
try {
@@ -213,6 +212,9 @@ public class GameClient {
private void loadFinishScreenView() {
Sounds.stopMusic();
Sounds.stopSoundEffects();
Sounds.playFinishMusic();
FXMLLoader fxmlLoader = loadFXMLToHolder("/views/FinishScreenView.fxml");
FinishScreenViewController controller = fxmlLoader.getController();
controller.setFinishers(raceState.getPlayerPositions());
@@ -15,10 +15,12 @@ import javafx.fxml.Initializable;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.Pane;
import seng302.model.ClientYacht;
import seng302.utilities.Sounds;
public class FinishScreenViewController implements Initializable {
@@ -87,4 +89,8 @@ public class FinishScreenViewController implements Initializable {
public void switchToStartScreenView() {
setContentPane("/views/StartScreenView.fxml");
}
public void playButtonHoverSound(MouseEvent mouseEvent) {
Sounds.playHoverSound();
}
}
@@ -16,6 +16,7 @@ import javafx.scene.control.Button;
import javafx.scene.control.TextArea;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.MouseEvent;
import javafx.scene.paint.Color;
import javafx.scene.text.Text;
import javafx.stage.Stage;
@@ -32,6 +33,10 @@ import seng302.visualiser.ClientToServerThread;
*/
public class LobbyController {
public void playButtonHoverSound(MouseEvent mouseEvent) {
Sounds.playHoverSound();
}
public enum CloseStatus {
LEAVE,
READY
@@ -36,7 +36,9 @@ public class StartScreenController implements Initializable {
private GameClient gameClient;
public void initialize(URL url, ResourceBundle resourceBundle) {
Sounds.stopMusic();
Sounds.stopSoundEffects();
Sounds.playMenuMusic();
if (Sounds.isMusicMuted()) {
muteMusicButton.setText("UnMute Music");
} else {
@@ -47,7 +49,7 @@ public class StartScreenController implements Initializable {
} else {
muteSoundsButton.setText("Mute Sounds");
}
Sounds.setMutes();
// gameClient = new GameClient(holder);
}