mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
Added some new sound files (PlayerLost, PlayerWon, PlayerSubmittedDeck, PlayerLeft).
This commit is contained in:
parent
2b916a5dfb
commit
182839d41a
12 changed files with 73 additions and 22 deletions
|
|
@ -56,7 +56,7 @@
|
|||
<Component id="tabPane" min="-2" pref="277" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="btnOk" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="25" max="32767" attributes="0"/>
|
||||
<EmptySpace min="0" pref="29" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
|
|
@ -155,22 +155,13 @@
|
|||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="lblPlayerInfo" min="-2" pref="90" max="-2" attributes="0"/>
|
||||
<Component id="lblDurationMatch" alignment="0" min="-2" pref="101" max="-2" attributes="0"/>
|
||||
<Component id="lblMatchScore" alignment="0" min="-2" pref="86" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="lblDurationGame" min="-2" pref="101" max="-2" attributes="0"/>
|
||||
<Component id="lblLife" alignment="0" min="-2" pref="71" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Component id="lblPlayerInfo" min="-2" pref="90" max="-2" attributes="0"/>
|
||||
<Component id="lblDurationMatch" alignment="0" min="-2" pref="101" max="-2" attributes="0"/>
|
||||
<Component id="lblMatchScore" alignment="0" min="-2" pref="86" max="-2" attributes="0"/>
|
||||
<Component id="lblDurationGame" min="-2" pref="101" max="-2" attributes="0"/>
|
||||
<Component id="lblLife" alignment="0" min="-2" pref="71" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
|
|
|
|||
|
|
@ -91,9 +91,9 @@ public class GameEndDialog extends MageDialog {
|
|||
this.txtLife.setText(sb.toString());
|
||||
|
||||
if (gameEndView.hasWon()) {
|
||||
AudioManager.playPlayerJoinedTable();
|
||||
AudioManager.playPlayerWon();
|
||||
} else {
|
||||
AudioManager.playButtonCancel();
|
||||
AudioManager.playPlayerLost();
|
||||
}
|
||||
|
||||
txtMatchScore.setText(gameEndView.getMatchView().getResult());
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ import mage.client.constants.Constants.DeckEditorMode;
|
|||
import mage.client.draft.DraftPanel;
|
||||
import mage.client.game.GamePanel;
|
||||
import mage.client.plugins.impl.Plugins;
|
||||
import mage.client.util.AudioManager;
|
||||
import mage.client.util.DeckUtil;
|
||||
import mage.client.util.GameManager;
|
||||
import mage.client.util.object.SaveObjectUtil;
|
||||
|
|
@ -112,6 +113,16 @@ public class CallbackClientImpl implements CallbackClient {
|
|||
ChatMessage message = (ChatMessage) callback.getData();
|
||||
ChatPanel panel = MageFrame.getChat(callback.getObjectId());
|
||||
if (panel != null) {
|
||||
if (message.getSoundToPlay() != null) {
|
||||
switch (message.getSoundToPlay()) {
|
||||
case PlayerLeft:
|
||||
AudioManager.playPlayerLeft();
|
||||
break;
|
||||
case PlayerSubmittedDeck:
|
||||
AudioManager.playPlayerSubmittedDeck();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (message.getMessage().equals(Constants.MSG_TIP_HOT_KEYS_CODE) && panel.getConnectedChat() != null) {
|
||||
panel.getConnectedChat().receiveMessage("[Tips] ", "You may use hot keys to play faster: " + "" +
|
||||
"\nTurn Mousewheel - Show big image of card your mousepointer hovers over" +
|
||||
|
|
|
|||
|
|
@ -47,6 +47,10 @@ public class AudioManager {
|
|||
audioManager.onHover = audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnHover.wav");
|
||||
|
||||
audioManager.playerJoinedTable = audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnPlayerJoinedTable.wav");
|
||||
audioManager.playerSubmittedDeck = audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnPlayerSubmittedDeck.wav");
|
||||
audioManager.playerLeft = audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnPlayerLeft.wav");
|
||||
audioManager.playerWon = audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnPlayerWon.wav");
|
||||
audioManager.playerLost = audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnPlayerLost.wav");
|
||||
}
|
||||
return audioManager;
|
||||
}
|
||||
|
|
@ -123,6 +127,22 @@ public class AudioManager {
|
|||
checkAndPlayClip(getManager().playerJoinedTable);
|
||||
}
|
||||
|
||||
public static void playPlayerSubmittedDeck() {
|
||||
checkAndPlayClip(getManager().playerSubmittedDeck);
|
||||
}
|
||||
|
||||
public static void playPlayerLeft() {
|
||||
checkAndPlayClip(getManager().playerLeft);
|
||||
}
|
||||
|
||||
public static void playPlayerLost() {
|
||||
checkAndPlayClip(getManager().playerLost);
|
||||
}
|
||||
|
||||
public static void playPlayerWon() {
|
||||
checkAndPlayClip(getManager().playerWon);
|
||||
}
|
||||
|
||||
private static void checkAndPlayClip(Clip clip) {
|
||||
try {
|
||||
if (clip != null) {
|
||||
|
|
@ -186,4 +206,8 @@ public class AudioManager {
|
|||
private Clip onHover = null;
|
||||
|
||||
private Clip playerJoinedTable = null;
|
||||
private Clip playerSubmittedDeck = null;
|
||||
private Clip playerLeft = null;
|
||||
private Clip playerWon = null;
|
||||
private Clip playerLost = null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue