mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
Fixed Issue 183
This commit is contained in:
parent
4c42abc9c6
commit
ae52438c67
2 changed files with 7 additions and 12 deletions
|
@ -56,6 +56,7 @@ import mage.client.cards.BigCard;
|
||||||
import mage.client.cards.Permanent;
|
import mage.client.cards.Permanent;
|
||||||
import mage.client.plugins.impl.Plugins;
|
import mage.client.plugins.impl.Plugins;
|
||||||
import mage.client.util.Config;
|
import mage.client.util.Config;
|
||||||
|
import mage.game.permanent.Battlefield;
|
||||||
import mage.view.PermanentView;
|
import mage.view.PermanentView;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -69,9 +70,8 @@ public class BattlefieldPanel extends javax.swing.JLayeredPane {
|
||||||
private BigCard bigCard;
|
private BigCard bigCard;
|
||||||
private Map<String, JComponent> ui = new HashMap<String, JComponent>();
|
private Map<String, JComponent> ui = new HashMap<String, JComponent>();
|
||||||
|
|
||||||
protected static Map<UUID, PermanentView> battlefield;
|
protected Map<UUID, PermanentView> battlefield;
|
||||||
protected static List<Thread> threads = new ArrayList<Thread>();
|
private Dimension cardDimension;
|
||||||
private static Dimension cardDimension;
|
|
||||||
|
|
||||||
/** Creates new form BattlefieldPanel */
|
/** Creates new form BattlefieldPanel */
|
||||||
public BattlefieldPanel(JScrollPane jScrollPane) {
|
public BattlefieldPanel(JScrollPane jScrollPane) {
|
||||||
|
@ -127,17 +127,12 @@ public class BattlefieldPanel extends javax.swing.JLayeredPane {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changed) {
|
if (changed) {
|
||||||
BattlefieldPanel.battlefield = battlefield;
|
this.battlefield = battlefield;
|
||||||
sortLayout();
|
sortLayout();
|
||||||
synchronized (this) {
|
|
||||||
for (Thread t : threads) {
|
|
||||||
t.start();
|
|
||||||
}
|
|
||||||
threads.clear();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO: review sorting stuff
|
||||||
public void sortLayout() {
|
public void sortLayout() {
|
||||||
Plugins.getInstance().sortPermanents(ui, permanents.values());
|
Plugins.getInstance().sortPermanents(ui, permanents.values());
|
||||||
if (battlefield == null) {return;}
|
if (battlefield == null) {return;}
|
||||||
|
|
|
@ -487,7 +487,7 @@ public class CardPluginImpl implements CardPlugin {
|
||||||
@Override
|
@Override
|
||||||
public void onRemoveCard(MagePermanent card, int count) {
|
public void onRemoveCard(MagePermanent card, int count) {
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
Animation.hideCard((CardPanel) card, count > 0 ? count : 1);
|
Animation.hideCard(card, count > 0 ? count : 1);
|
||||||
try {
|
try {
|
||||||
while ((card).getAlpha() - 0.05f > 0) {
|
while ((card).getAlpha() - 0.05f > 0) {
|
||||||
Thread.sleep(30);
|
Thread.sleep(30);
|
||||||
|
|
Loading…
Reference in a new issue