Added button sounds on hover, click and in the lobby

- Started playing start & lobby sounds
 - Started playing button hover & click sounds

Tags: #story[1249]
This commit is contained in:
Michael Rausch
2017-09-11 19:50:17 +12:00
parent 3d0209300e
commit 131cd80e02
16 changed files with 171 additions and 356 deletions
@@ -3,8 +3,10 @@ package seng302.visualiser.controllers.cells;
import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.effect.DropShadow;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.GridPane;
import javafx.scene.paint.Color;
import seng302.utilities.Sounds;
public class PlayerCell {
@@ -24,4 +26,8 @@ public class PlayerCell {
public void initialize() {
playerName.setText(name);
}
public void playButtonHoverSound(MouseEvent mouseEvent) {
Sounds.playHoverSound();
}
}
@@ -16,9 +16,11 @@ import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.control.Label;
import javafx.scene.effect.DropShadow;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.GridPane;
import javafx.scene.paint.Color;
import seng302.gameServer.ServerDescription;
import seng302.utilities.Sounds;
import seng302.visualiser.GameClient;
import seng302.visualiser.controllers.ViewManager;
@@ -64,7 +66,10 @@ public class ServerCell implements Initializable {
serverPlayerCount.setText(currPlayerCount);
mapName.setText(mapNameString);
serverConnButton.setOnMouseReleased(event -> joinServer());
serverConnButton.setOnMouseReleased(event -> {
Sounds.playButtonClick();
joinServer();
});
}
/**
@@ -75,4 +80,7 @@ public class ServerCell implements Initializable {
ViewManager.getInstance().getGameClient().runAsClient(hostName, portNumber);
}
public void playButtonHoverSound(MouseEvent mouseEvent) {
Sounds.playHoverSound();
}
}