mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
- don't remove packs from spell shop until after buying them
- restore focus to 'no' button after mulliganing
This commit is contained in:
@@ -39,7 +39,6 @@ import forge.game.zone.ZoneType;
|
|||||||
import forge.gui.GuiDialog;
|
import forge.gui.GuiDialog;
|
||||||
import forge.gui.framework.SDisplayUtil;
|
import forge.gui.framework.SDisplayUtil;
|
||||||
import forge.gui.match.CMatchUI;
|
import forge.gui.match.CMatchUI;
|
||||||
import forge.gui.match.VMatchUI;
|
|
||||||
import forge.gui.match.nonsingleton.VField;
|
import forge.gui.match.nonsingleton.VField;
|
||||||
import forge.gui.match.views.VMessage;
|
import forge.gui.match.views.VMessage;
|
||||||
import forge.view.ButtonUtil;
|
import forge.view.ButtonUtil;
|
||||||
@@ -83,8 +82,10 @@ public class InputMulligan extends Input {
|
|||||||
|
|
||||||
if (newHand == 0) {
|
if (newHand == 0) {
|
||||||
this.end();
|
this.end();
|
||||||
|
} else {
|
||||||
|
ButtonUtil.enableAllFocusOk();
|
||||||
}
|
}
|
||||||
} // selectButtonOK()
|
}
|
||||||
|
|
||||||
final void end() {
|
final void end() {
|
||||||
GameState game = Singletons.getModel().getGame();
|
GameState game = Singletons.getModel().getGame();
|
||||||
|
|||||||
@@ -321,7 +321,6 @@ public final class CEditorQuestCardShop extends ACEditorBase<InventoryItem, Deck
|
|||||||
this.questData.getCards().buyCard(card, value);
|
this.questData.getCards().buyCard(card, value);
|
||||||
|
|
||||||
} else if (item instanceof OpenablePack) {
|
} else if (item instanceof OpenablePack) {
|
||||||
this.getTableCatalog().removeCard(item, qty);
|
|
||||||
for (int i = 0; qty > i; ++i) {
|
for (int i = 0; qty > i; ++i) {
|
||||||
OpenablePack booster = null;
|
OpenablePack booster = null;
|
||||||
if (item instanceof BoosterPack) {
|
if (item instanceof BoosterPack) {
|
||||||
@@ -339,8 +338,8 @@ public final class CEditorQuestCardShop extends ACEditorBase<InventoryItem, Deck
|
|||||||
"You have found the following cards inside:", newCards);
|
"You have found the following cards inside:", newCards);
|
||||||
c.show();
|
c.show();
|
||||||
}
|
}
|
||||||
} else if (item instanceof PreconDeck) {
|
|
||||||
this.getTableCatalog().removeCard(item, qty);
|
this.getTableCatalog().removeCard(item, qty);
|
||||||
|
} else if (item instanceof PreconDeck) {
|
||||||
final PreconDeck deck = (PreconDeck) item;
|
final PreconDeck deck = (PreconDeck) item;
|
||||||
this.questData.getCards().buyPreconDeck(deck, value);
|
this.questData.getCards().buyPreconDeck(deck, value);
|
||||||
final ItemPool<InventoryItem> newInventory =
|
final ItemPool<InventoryItem> newInventory =
|
||||||
@@ -348,11 +347,13 @@ public final class CEditorQuestCardShop extends ACEditorBase<InventoryItem, Deck
|
|||||||
for (int i = 0; qty > i; ++i) {
|
for (int i = 0; qty > i; ++i) {
|
||||||
getTableDeck().addCards(newInventory);
|
getTableDeck().addCards(newInventory);
|
||||||
}
|
}
|
||||||
|
boolean one = 1 == qty;
|
||||||
JOptionPane.showMessageDialog(null, String.format(
|
JOptionPane.showMessageDialog(null, String.format(
|
||||||
"%s '%s' %s added to your decklist.%n%nCards from it were also added to your pool.",
|
"%s '%s' %s added to your decklist.%n%n%s cards were also added to your pool.",
|
||||||
1 == qty ? "Deck" : String.format("%d copies of deck", qty),
|
one ? "Deck" : String.format("%d copies of deck", qty),
|
||||||
deck.getName(), 1 == qty ? "was" : "were"),
|
deck.getName(), one ? "was" : "were", one ? "Its" : "Their"),
|
||||||
"Thanks for purchasing!", JOptionPane.INFORMATION_MESSAGE);
|
"Thanks for purchasing!", JOptionPane.INFORMATION_MESSAGE);
|
||||||
|
this.getTableCatalog().removeCard(item, qty);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.creditsLabel.setText("Credits: " + this.questData.getAssets().getCredits());
|
this.creditsLabel.setText("Credits: " + this.questData.getAssets().getCredits());
|
||||||
|
|||||||
Reference in New Issue
Block a user