Add a 'your game can start' sound

This commit is contained in:
spjspj 2017-10-01 01:51:05 +10:00
parent ed429b0c37
commit 042e64aeb8
3 changed files with 12 additions and 1 deletions

Binary file not shown.

View file

@ -438,7 +438,10 @@ class UpdateSeatsTask extends SwingWorker<Void, TableView> {
int current = getPlayersCount(tableView); int current = getPlayersCount(tableView);
if (current != count) { if (current != count) {
if (count > 0) { if (count > 0) {
if (current > count) { if (current == tableView.getSeats().size()) {
MageTray.instance.displayMessage("The game can start.");
AudioManager.playGameCanStart();
} else if (current > count) {
MageTray.instance.displayMessage("New player joined your game."); MageTray.instance.displayMessage("New player joined your game.");
AudioManager.playPlayerJoinedTable(); AudioManager.playPlayerJoinedTable();
} else { } else {

View file

@ -40,6 +40,7 @@ public class AudioManager {
private MageClip tournamentStarted = null; private MageClip tournamentStarted = null;
private MageClip yourGameStarted = null; private MageClip yourGameStarted = null;
private MageClip playerJoinedTable = null; private MageClip playerJoinedTable = null;
private MageClip gameCanStart = null;
private MageClip playerSubmittedDeck = null; private MageClip playerSubmittedDeck = null;
private MageClip playerWhispered = null; private MageClip playerWhispered = null;
private MageClip playerLeft = null; private MageClip playerLeft = null;
@ -219,6 +220,13 @@ public class AudioManager {
checkAndPlayClip(audioManager.playerJoinedTable); checkAndPlayClip(audioManager.playerJoinedTable);
} }
public static void playGameCanStart() {
if (audioManager.gameCanStart == null) {
audioManager.gameCanStart = new MageClip(Constants.BASE_SOUND_PATH + "GameCanStart.wav", AudioGroup.OtherSounds);
}
checkAndPlayClip(audioManager.gameCanStart);
}
public static void playYourGameStarted() { public static void playYourGameStarted() {
if (audioManager.yourGameStarted == null) { if (audioManager.yourGameStarted == null) {
audioManager.yourGameStarted = new MageClip(Constants.BASE_SOUND_PATH + "OnGameStart.wav", AudioGroup.OtherSounds); audioManager.yourGameStarted = new MageClip(Constants.BASE_SOUND_PATH + "OnGameStart.wav", AudioGroup.OtherSounds);