forked from External/mage
[UI] Some sounds
This commit is contained in:
parent
5c8ebf393b
commit
de146458a9
7 changed files with 99 additions and 5 deletions
|
|
@ -34,10 +34,12 @@
|
|||
|
||||
package mage.client.game;
|
||||
|
||||
import mage.Constants;
|
||||
import mage.cards.MagePermanent;
|
||||
import mage.client.cards.BigCard;
|
||||
import mage.client.cards.Permanent;
|
||||
import mage.client.plugins.impl.Plugins;
|
||||
import mage.client.util.AudioManager;
|
||||
import mage.client.util.Config;
|
||||
import mage.view.PermanentView;
|
||||
|
||||
|
|
@ -71,6 +73,12 @@ public class BattlefieldPanel extends javax.swing.JLayeredPane {
|
|||
|
||||
private static int i = 0;
|
||||
|
||||
private boolean addedPermanent;
|
||||
private boolean addedArtifact;
|
||||
private boolean addedCreature;
|
||||
|
||||
private boolean removedCreature;
|
||||
|
||||
/** Creates new form BattlefieldPanel */
|
||||
public BattlefieldPanel() {
|
||||
ui.put("battlefieldPanel", this);
|
||||
|
|
@ -114,11 +122,24 @@ public class BattlefieldPanel extends javax.swing.JLayeredPane {
|
|||
permanents.get(permanent.getId()).update(permanent);
|
||||
}
|
||||
}
|
||||
|
||||
addedArtifact = addedCreature = addedPermanent = false;
|
||||
|
||||
int count = permanentsToAdd.size();
|
||||
for (PermanentView permanent : permanentsToAdd) {
|
||||
addPermanent(permanent, count);
|
||||
}
|
||||
|
||||
if (addedArtifact) {
|
||||
AudioManager.playAddArtifact();
|
||||
} else if (addedCreature) {
|
||||
AudioManager.playSummon();
|
||||
} else if (addedPermanent) {
|
||||
AudioManager.playAddPermanent();
|
||||
}
|
||||
|
||||
removedCreature = false;
|
||||
|
||||
for (Iterator<Entry<UUID, MagePermanent>> i = permanents.entrySet().iterator(); i.hasNext();) {
|
||||
Entry<UUID, MagePermanent> entry = i.next();
|
||||
if (!battlefield.containsKey(entry.getKey())) {
|
||||
|
|
@ -128,6 +149,10 @@ public class BattlefieldPanel extends javax.swing.JLayeredPane {
|
|||
}
|
||||
}
|
||||
|
||||
if (removedCreature) {
|
||||
AudioManager.playDiedCreature();
|
||||
}
|
||||
|
||||
if (changed) {
|
||||
this.battlefield = battlefield;
|
||||
sortLayout();
|
||||
|
|
@ -183,6 +208,14 @@ public class BattlefieldPanel extends javax.swing.JLayeredPane {
|
|||
threads.add(t);
|
||||
}*/
|
||||
}
|
||||
|
||||
if (permanent.getCardTypes().contains(Constants.CardType.ARTIFACT)) {
|
||||
addedArtifact = true;
|
||||
} else if (permanent.getCardTypes().contains(Constants.CardType.CREATURE)) {
|
||||
addedCreature = true;
|
||||
} else {
|
||||
addedPermanent = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void groupAttachments(PermanentView permanent) {
|
||||
|
|
@ -241,6 +274,9 @@ public class BattlefieldPanel extends javax.swing.JLayeredPane {
|
|||
});
|
||||
t.start();
|
||||
}
|
||||
if (((MagePermanent)comp).getOriginal().getCardTypes().contains(Constants.CardType.CREATURE)) {
|
||||
removedCreature = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue