mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
Return false instead of throw if an illegal draft choice is made
This commit is contained in:
@@ -907,8 +907,7 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
||||
}
|
||||
|
||||
public void sellCard(PaperCard card, Integer result) {
|
||||
float price = CardUtil.getCardPrice(card) * result;
|
||||
price *= difficultyData.sellFactor;
|
||||
float price = cardSellPrice(card) * result;
|
||||
cards.remove(card, result);
|
||||
addGold((int) price);
|
||||
}
|
||||
|
||||
@@ -17,12 +17,7 @@ import forge.assets.FSkinFont;
|
||||
import forge.assets.FSkinImage;
|
||||
import forge.card.CardEdition;
|
||||
import forge.card.CardZoom;
|
||||
import forge.deck.AddBasicLandsDialog;
|
||||
import forge.deck.CardPool;
|
||||
import forge.deck.Deck;
|
||||
import forge.deck.DeckFormat;
|
||||
import forge.deck.DeckSection;
|
||||
import forge.deck.FDeckViewer;
|
||||
import forge.deck.*;
|
||||
import forge.game.GameType;
|
||||
import forge.gamemodes.limited.BoosterDraft;
|
||||
import forge.item.InventoryItem;
|
||||
@@ -37,11 +32,7 @@ import forge.menu.FPopupMenu;
|
||||
import forge.model.FModel;
|
||||
import forge.screens.FScreen;
|
||||
import forge.screens.TabPageScreen;
|
||||
import forge.toolbox.FContainer;
|
||||
import forge.toolbox.FEvent;
|
||||
import forge.toolbox.FLabel;
|
||||
import forge.toolbox.FOptionPane;
|
||||
import forge.toolbox.GuiChoose;
|
||||
import forge.toolbox.*;
|
||||
import forge.util.Callback;
|
||||
import forge.util.ItemPool;
|
||||
import forge.util.Utils;
|
||||
@@ -568,6 +559,32 @@ public class AdventureDeckEditor extends TabPageScreen<AdventureDeckEditor> {
|
||||
if (!catalogPage.showNoSellCards || !catalogPage.showAutoSellCards || !catalogPage.showCollectionCards) {
|
||||
addItem(new FMenuItem(Forge.getLocalizer().getMessage("lblShowAll"), Forge.hdbuttons ? FSkinImage.HDPLUS : FSkinImage.PLUS, e1 -> catalogPage.showAllCards()));
|
||||
}
|
||||
|
||||
// Add bulk sell menu option. This will sell all cards in the current filter.
|
||||
int count = 0;
|
||||
int value = 0;
|
||||
|
||||
for (Map.Entry<PaperCard, Integer> entry : catalogPage.cardManager.getFilteredItems()) {
|
||||
value += AdventurePlayer.current().cardSellPrice(entry.getKey()) * entry.getValue();
|
||||
count += entry.getValue();
|
||||
}
|
||||
|
||||
final int finalCount = count;
|
||||
final int finalValue = value;
|
||||
addItem(new FMenuItem(Forge.getLocalizer().getMessage("lblSellCurrentFilters"), FSkinImage.QUEST_COINSTACK, e1 -> {
|
||||
FOptionPane.showConfirmDialog(Forge.getLocalizer().getMessage("lblSellAllConfirm", finalCount, finalValue), Forge.getLocalizer().getMessage("lblSellCurrentFilters"), Forge.getLocalizer().getMessage("lblSell"), Forge.getLocalizer().getMessage("lblCancel"), false, new Callback<Boolean>() {
|
||||
@Override
|
||||
public void run(Boolean result) {
|
||||
if (result) {
|
||||
for (Map.Entry<PaperCard, Integer> entry : catalogPage.cardManager.getFilteredItems()) {
|
||||
AdventurePlayer.current().sellCard(entry.getKey(), entry.getValue());
|
||||
}
|
||||
catalogPage.refresh();
|
||||
lblGold.setText(String.valueOf(AdventurePlayer.current().getGold()));
|
||||
}
|
||||
}
|
||||
});
|
||||
}));
|
||||
}
|
||||
((DeckEditorPage) getSelectedPage()).buildDeckMenu(this);
|
||||
}
|
||||
|
||||
@@ -3436,6 +3436,8 @@ lblShowNoSell=No-Sell Anzeigen
|
||||
lblShowAll=Alle Anzeigen
|
||||
lblHideCollection=Sammlung Ausblenden
|
||||
lblShowCollection=Sammlung Anzeigen
|
||||
lblSellCurrentFilters=Sell Displayed Cards
|
||||
lblSellAllConfirm=You are attempting to sell {0} cards for {1} gold. Selling cards is irreversible. Are you sure you want to proceed?
|
||||
lblCracked=Geknackt!
|
||||
lblTake=Nehmen
|
||||
lblRefund=Erstattung
|
||||
|
||||
@@ -3169,6 +3169,8 @@ lblShowNoSell=Show No-Sell
|
||||
lblShowAll=Show All
|
||||
lblHideCollection=Hide Collection
|
||||
lblShowCollection=Show Collection
|
||||
lblSellCurrentFilters=Sell Displayed Cards
|
||||
lblSellAllConfirm=You are attempting to sell {0} cards for {1} gold. Selling cards is irreversible. Are you sure you want to proceed?
|
||||
lblCracked=Cracked!
|
||||
lblTake=Take
|
||||
lblRefund=Refund
|
||||
|
||||
@@ -3450,6 +3450,8 @@ lblShowNoSell=Mostrar No Vender
|
||||
lblShowAll=Mostrar Todo
|
||||
lblHideCollection=Ocultar Colección
|
||||
lblShowCollection=Mostrar Colección
|
||||
lblSellCurrentFilters=Sell Displayed Cards
|
||||
lblSellAllConfirm=You are attempting to sell {0} cards for {1} gold. Selling cards is irreversible. Are you sure you want to proceed?
|
||||
lblCracked=¡Agrietado!
|
||||
lblTake=Llevar
|
||||
lblRefund=Reembolso
|
||||
|
||||
@@ -3444,6 +3444,8 @@ lblShowNoSell=Afficher Non-Vente
|
||||
lblShowAll=Afficher Tout
|
||||
lblHideCollection=Masquer la Collection
|
||||
lblShowCollection=Afficher la Collection
|
||||
lblSellCurrentFilters=Sell Displayed Cards
|
||||
lblSellAllConfirm=You are attempting to sell {0} cards for {1} gold. Selling cards is irreversible. Are you sure you want to proceed?
|
||||
lblCracked=Fissuré!
|
||||
lblTake=Prendre
|
||||
lblRefund=Remboursement
|
||||
|
||||
@@ -3442,6 +3442,8 @@ lblShowNoSell=Mostra Non Vendita
|
||||
lblShowAll=Mostra Tutto
|
||||
lblHideCollection=Nascondi Collezione
|
||||
lblShowCollection=Mostra Collezione
|
||||
lblSellCurrentFilters=Sell Displayed Cards
|
||||
lblSellAllConfirm=You are attempting to sell {0} cards for {1} gold. Selling cards is irreversible. Are you sure you want to proceed?
|
||||
lblCracked=Incrinato!
|
||||
lblTake=Prendere
|
||||
lblRefund=Rimborso
|
||||
|
||||
@@ -3438,6 +3438,8 @@ lblShowNoSell=ノーセールを表示
|
||||
lblShowAll=すべて表示
|
||||
lblHideCollection=コレクションを非表示にする
|
||||
lblShowCollection=ショーコレクション
|
||||
lblSellCurrentFilters=Sell Displayed Cards
|
||||
lblSellAllConfirm=You are attempting to sell {0} cards for {1} gold. Selling cards is irreversible. Are you sure you want to proceed?
|
||||
lblCracked=ひび割れた!
|
||||
lblTake=取る
|
||||
lblRefund=返金
|
||||
|
||||
@@ -3528,6 +3528,8 @@ lblShowNoSell=Mostrar Não-Venda
|
||||
lblShowAll=Mostrar Tudo
|
||||
lblHideCollection=Ocultar Coleção
|
||||
lblShowCollection=Mostrar Coleção
|
||||
lblSellCurrentFilters=Sell Displayed Cards
|
||||
lblSellAllConfirm=You are attempting to sell {0} cards for {1} gold. Selling cards is irreversible. Are you sure you want to proceed?
|
||||
lblCracked=Rachado!
|
||||
lblTake=Pegar
|
||||
lblRefund=Reembolso
|
||||
|
||||
@@ -3429,6 +3429,8 @@ lblShowNoSell=显示不卖
|
||||
lblShowAll=显示全部
|
||||
lblHideCollection=隐藏收藏
|
||||
lblShowCollection=展会系列
|
||||
lblSellCurrentFilters=Sell Displayed Cards
|
||||
lblSellAllConfirm=You are attempting to sell {0} cards for {1} gold. Selling cards is irreversible. Are you sure you want to proceed?
|
||||
lblCracked=破裂了!
|
||||
lblTake=拿
|
||||
lblRefund=退款
|
||||
|
||||
Reference in New Issue
Block a user