merge development into test #26

Merged
j23f0712 merged 95 commits from development into dev/test 2024-12-01 21:02:48 +01:00
14 changed files with 66 additions and 24 deletions
Showing only changes of commit 8c8bd4db0d - Show all commits

View File

@@ -1,5 +1,6 @@
package pp.mdga.client; package pp.mdga.client;
import pp.mdga.client.acoustic.MdgaSound;
import pp.mdga.client.view.CeremonyView; import pp.mdga.client.view.CeremonyView;
import pp.mdga.client.view.GameView; import pp.mdga.client.view.GameView;
import pp.mdga.client.view.LobbyView; import pp.mdga.client.view.LobbyView;
@@ -71,17 +72,21 @@ public void selectCard(BonusCard card) {
public void confirm() { public void confirm() {
LOGGER.log(Level.INFO, "confirm"); LOGGER.log(Level.INFO, "confirm");
GameView gameView = (GameView) app.getView();
if(a != null && b != null) { if(a != null && b != null) {
//swap //swap
gameView.getBoardHandler().clearSelectable();
} else if (a != null) { } else if (a != null) {
//piece //piece
gameView.getBoardHandler().clearSelectable();
} else if (card != null){ } else if (card != null){
//card //card
gameView.getGuiHandler().clearSelectableCards();
} else { } else {
throw new RuntimeException("nothing to confirm"); throw new RuntimeException("nothing to confirm");
} }
GameView gameView = (GameView) app.getView();
gameView.noConfirm(); gameView.noConfirm();
} }
@@ -120,6 +125,7 @@ public void setJoin(String ip, int port) {
public void leave() { public void leave() {
LOGGER.log(Level.INFO, "leave"); LOGGER.log(Level.INFO, "leave");
app.getAcousticHandler().playSound(MdgaSound.LEAVE);
enter(MdgaState.MAIN); enter(MdgaState.MAIN);
} }
@@ -151,9 +157,9 @@ public void enter(MdgaState state) {
if (state == MdgaState.LOBBY) { if (state == MdgaState.LOBBY) {
LobbyView lobbyView = (LobbyView) app.getView(); LobbyView lobbyView = (LobbyView) app.getView();
//app.getNotificationSynchronizer().addTestNotification(new TskSelectNotification(Color.CYBER, "blablabupp", false)); app.getNotificationSynchronizer().addTestNotification(new TskSelectNotification(Color.CYBER, "blablabupp", false));
//app.getNotificationSynchronizer().addTestNotification(new TskSelectNotification(Color.ARMY, "Spieler 2", false)); app.getNotificationSynchronizer().addTestNotification(new TskSelectNotification(Color.ARMY, "Spieler 2", false));
lobbyView.setReady(Color.ARMY, true); lobbyView.setReady(Color.ARMY, false);
} }
} }
} }

View File

@@ -86,10 +86,30 @@ public void playSound(MdgaSound sound) {
assets.add(new SoundAssetDelayVolume(SoundAsset.UI_CLICK, 0.8f, 0.0f)); assets.add(new SoundAssetDelayVolume(SoundAsset.UI_CLICK, 0.8f, 0.0f));
break; break;
case START: case START:
assets.add(new SoundAssetDelayVolume(SoundAsset.START, 0.8f, 0.2f)); assets.add(new SoundAssetDelayVolume(SoundAsset.START, 0.8f, 0.5f));
break;
case THROW:
assets.add(new SoundAssetDelayVolume(SoundAsset.LAUGHT, 1.0f, 0.2f));
break;
case POWERUP:
assets.add(new SoundAssetDelayVolume(SoundAsset.POWERUP, 1.0f, 0.2f));
break;
case SELF_READY:
assets.add(new SoundAssetDelayVolume(SoundAsset.ROBOT_READY, 1.0f, 0.0f));
break;
case OTHER_READY:
assets.add(new SoundAssetDelayVolume(SoundAsset.UNIT_READY, 1.0f, 0.0f));
break;
case OTHER_CONNECTED:
assets.add(new SoundAssetDelayVolume(SoundAsset.CONNECTED, 1.0f, 0.0f));
break;
case NOT_READY:
assets.add(new SoundAssetDelayVolume(SoundAsset.UI_SOUND, 1.0f, 0.0f));
break;
case LEAVE:
assets.add(new SoundAssetDelayVolume(SoundAsset.UI_SOUND2, 0.6f, 0.0f));
break; break;
default: default:
break; break;
} }

View File

@@ -24,4 +24,11 @@ public enum MdgaSound {
WRONG_INPUT, WRONG_INPUT,
UI_CLICK, UI_CLICK,
START, START,
THROW,
POWERUP,
SELF_READY,
OTHER_READY,
OTHER_CONNECTED,
NOT_READY,
LEAVE,
} }

View File

@@ -19,9 +19,16 @@ enum SoundAsset {
VICTORY("LevelUp2.wav"), VICTORY("LevelUp2.wav"),
LOST("GameOver.wav"), LOST("GameOver.wav"),
BUTTON_PRESS("menu_button.ogg"), BUTTON_PRESS("menu_button.ogg"),
ERROR("error_sound.ogg"), ERROR("buzzer.wav"),
UI_SOUND("ui_sound.ogg"),
UI_SOUND2("ui_swoosch.wav"),
UI_CLICK("uiclick.ogg"), UI_CLICK("uiclick.ogg"),
START("gamestart.ogg"); START("gamestart.ogg"),
LAUGHT("laughter.wav"),
POWERUP("powerup.wav"),
ROBOT_READY("robotReady.wav"),
UNIT_READY("unitReady.wav"),
CONNECTED("connected.wav");
private final String path; private final String path;

View File

@@ -10,6 +10,7 @@
import com.jme3.texture.Texture; import com.jme3.texture.Texture;
import com.jme3.util.SkyFactory; import com.jme3.util.SkyFactory;
import pp.mdga.client.MdgaApp; import pp.mdga.client.MdgaApp;
import pp.mdga.client.acoustic.MdgaSound;
import pp.mdga.client.button.ButtonLeft; import pp.mdga.client.button.ButtonLeft;
import pp.mdga.client.button.ButtonRight; import pp.mdga.client.button.ButtonRight;
import pp.mdga.client.button.LobbyButton; import pp.mdga.client.button.LobbyButton;
@@ -140,19 +141,21 @@ public void setTaken(Color color, boolean isTaken, boolean isSelf, String name)
} }
public void setReady(Color color, boolean isReady) { public void setReady(Color color, boolean isReady) {
switch (color) { LobbyButton button = switch (color) {
case CYBER: case CYBER -> cyberButton;
cyberButton.setReady(isReady); case AIRFORCE -> airforceButton;
break; case ARMY -> armyButton;
case AIRFORCE: case NAVY -> navyButton;
airforceButton.setReady(isReady); };
break;
case ARMY: button.setReady(isReady);
armyButton.setReady(isReady);
break; if(button.getTaken() != LobbyButton.Taken.SELF) {
case NAVY: app.getAcousticHandler().playSound(MdgaSound.OTHER_READY);
navyButton.setReady(isReady); }
break;
if(!isReady) {
app.getAcousticHandler().playSound(MdgaSound.NOT_READY);
} }
} }
@@ -189,11 +192,10 @@ private void toggleTsk(Color color) {
private void ready() { private void ready() {
app.getModelSyncronizer().setReady(); app.getModelSyncronizer().setReady();
//TODO: playSound app.getAcousticHandler().playSound(MdgaSound.SELF_READY);
} }
private void leaveLobby() { private void leaveLobby() {
app.getModelSyncronizer().leave(); app.getModelSyncronizer().leave();
//TODO: playSound
} }
} }

View File

@@ -17,7 +17,7 @@ public class TskSelectNotification extends Notification{
* @param name the name of the player that is in the game. * @param name the name of the player that is in the game.
* @param self true if it was the local player selecting the tsk, false otherwise * @param self true if it was the local player selecting the tsk, false otherwise
*/ */
TskSelectNotification(Color color, String name, boolean self) { public TskSelectNotification(Color color, String name, boolean self) {
this.color = color; this.color = color;
this.name = name; this.name = name;
this.self = self; this.self = self;