mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
Sell lands down to 50 when selling all extras in the card shop
This commit is contained in:
@@ -431,15 +431,16 @@ public final class CEditorQuestCardShop extends ACEditorBase<InventoryItem, Deck
|
|||||||
this.getTableCatalog().setDeck(cardsForSale);
|
this.getTableCatalog().setDeck(cardsForSale);
|
||||||
this.getTableDeck().setDeck(ownedItems);
|
this.getTableDeck().setDeck(ownedItems);
|
||||||
|
|
||||||
VCurrentDeck.SINGLETON_INSTANCE.getBtnRemove4().setText("Sell excess cards");
|
VCurrentDeck.SINGLETON_INSTANCE.getBtnRemove4().setText("Sell all extras");
|
||||||
VCurrentDeck.SINGLETON_INSTANCE.getBtnRemove4().setToolTipText("Sell extra non-basic land cards of which you have more than four copies");
|
VCurrentDeck.SINGLETON_INSTANCE.getBtnRemove4().setToolTipText("Sell unneeded extra copies of all cards");
|
||||||
VCurrentDeck.SINGLETON_INSTANCE.getBtnRemove4().setCommand(new Command() {
|
VCurrentDeck.SINGLETON_INSTANCE.getBtnRemove4().setCommand(new Command() {
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
List<Map.Entry<InventoryItem, Integer>> cardsToRemove = new LinkedList<Map.Entry<InventoryItem,Integer>>();
|
List<Map.Entry<InventoryItem, Integer>> cardsToRemove = new LinkedList<Map.Entry<InventoryItem,Integer>>();
|
||||||
for (Map.Entry<InventoryItem, Integer> item : getTableDeck().getCards()) {
|
for (Map.Entry<InventoryItem, Integer> item : getTableDeck().getCards()) {
|
||||||
if (4 < item.getValue() && CardRarity.BasicLand != ((CardPrinted)item.getKey()).getRarity()) {
|
int numToKeep = CardRarity.BasicLand == ((CardPrinted)item.getKey()).getRarity() ? 50 : 4;
|
||||||
cardsToRemove.add(Pair.of(item.getKey(), item.getValue() - 4));
|
if (numToKeep < item.getValue()) {
|
||||||
|
cardsToRemove.add(Pair.of(item.getKey(), item.getValue() - numToKeep));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
removeCards(cardsToRemove);
|
removeCards(cardsToRemove);
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ public enum VCurrentDeck implements IVDoc<CCurrentDeck>, ITableContainer {
|
|||||||
private final FLabel btnRemove = new FLabel.Builder()
|
private final FLabel btnRemove = new FLabel.Builder()
|
||||||
.fontSize(14)
|
.fontSize(14)
|
||||||
.text("Remove card")
|
.text("Remove card")
|
||||||
.tooltip("Remove selected card to current deck (or double click the row)")
|
.tooltip("Remove selected card from current deck (or double click the row or hit the spacebar)")
|
||||||
.icon(FSkin.getIcon(FSkin.InterfaceIcons.ICO_MINUS))
|
.icon(FSkin.getIcon(FSkin.InterfaceIcons.ICO_MINUS))
|
||||||
.iconScaleAuto(false).hoverable(true).build();
|
.iconScaleAuto(false).hoverable(true).build();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user