mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
ante out of edt
This commit is contained in:
@@ -91,16 +91,17 @@ public class Match {
|
||||
final boolean canRandomFoil = Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_RANDOM_FOIL) && gameType == GameType.Constructed;
|
||||
GameNew.newGame(currentGame, canRandomFoil, this.useAnte);
|
||||
|
||||
if (useAnte) { // Deciding which cards go to ante
|
||||
List<Pair<Player, Card>> list = GameNew.chooseCardsForAnte(currentGame);
|
||||
GameNew.moveCardsToAnte(list);
|
||||
currentGame.fireEvent(new GameEventAnteCardsSelected(list));
|
||||
}
|
||||
|
||||
// This code was run from EDT.
|
||||
currentGame.getAction().invoke(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
if (useAnte) { // Deciding which cards go to ante
|
||||
List<Pair<Player, Card>> list = GameNew.chooseCardsForAnte(currentGame);
|
||||
GameNew.moveCardsToAnte(list);
|
||||
currentGame.fireEvent(new GameEventAnteCardsSelected(list));
|
||||
}
|
||||
|
||||
currentGame.getAction().startGame();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -44,7 +44,6 @@ import forge.card.MagicColor;
|
||||
import forge.card.ability.AbilityFactory;
|
||||
import forge.card.ability.AbilityUtils;
|
||||
import forge.card.cardfactory.CardFactoryUtil;
|
||||
import forge.card.cost.Cost;
|
||||
import forge.card.mana.ManaCost;
|
||||
import forge.card.mana.ManaPool;
|
||||
import forge.card.replacement.ReplacementResult;
|
||||
@@ -1829,7 +1828,7 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
adjMax += Integer.valueOf(k[1]);
|
||||
}
|
||||
}
|
||||
final int adjCheck = this.maxLandsToPlay + adjMax;
|
||||
final int adjCheck = Player.maxLandsToPlay + adjMax;
|
||||
// System.out.println("Max lands for player " + this.getName() + ": " + adjCheck);
|
||||
|
||||
return this.numLandsPlayed < adjCheck || this.isCardInPlay("Fastbond") || this.isCardInCommand("Naya");
|
||||
|
||||
@@ -67,10 +67,16 @@ public class GuiDialog {
|
||||
* a {@link java.lang.String} object.
|
||||
*/
|
||||
public static void message(final String message) {
|
||||
message(message, UIManager.getString("OptionPane.messageDialogTitle"));
|
||||
FThreads.invokeInEdtAndWait( new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
message(message, UIManager.getString("OptionPane.messageDialogTitle"));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void message(final String message, String title) {
|
||||
|
||||
JOptionPane.showMessageDialog(null, message, title, JOptionPane.PLAIN_MESSAGE);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user