mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
Fix auto-sell not being removed from adventure collection
This commit is contained in:
@@ -266,7 +266,14 @@ public class AdventureDeckEditor extends FDeckEditor {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void refresh() {
|
public void refresh() {
|
||||||
cardManager.setPool(Current.player().getSellableCards());
|
cardManager.setPool(getCardPool());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemPool<PaperCard> getCardPool() {
|
||||||
|
ItemPool<PaperCard> pool = Current.player().getSellableCards();
|
||||||
|
pool.removeAll(Current.player().autoSellCards);
|
||||||
|
return pool;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sellAllByFilter() {
|
public void sellAllByFilter() {
|
||||||
@@ -319,6 +326,13 @@ public class AdventureDeckEditor extends FDeckEditor {
|
|||||||
scheduleRefresh();
|
scheduleRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemPool<PaperCard> getCardPool() {
|
||||||
|
ItemPool<PaperCard> pool = super.getCardPool();
|
||||||
|
pool.removeAll(Current.player().autoSellCards);
|
||||||
|
return pool;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void buildMenu(final FDropDownMenu menu, final PaperCard card) {
|
protected void buildMenu(final FDropDownMenu menu, final PaperCard card) {
|
||||||
super.buildMenu(menu, card);
|
super.buildMenu(menu, card);
|
||||||
@@ -444,6 +458,12 @@ public class AdventureDeckEditor extends FDeckEditor {
|
|||||||
return Current.player().getAutoSellCards();
|
return Current.player().getAutoSellCards();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void refresh() {
|
||||||
|
super.refresh();
|
||||||
|
//Used when executing an auto-sell.
|
||||||
|
this.updateCaption();
|
||||||
|
}
|
||||||
|
|
||||||
protected boolean isShop() {
|
protected boolean isShop() {
|
||||||
return parentScreen.getEditorConfig() instanceof ShopConfig;
|
return parentScreen.getEditorConfig() instanceof ShopConfig;
|
||||||
@@ -637,10 +657,12 @@ public class AdventureDeckEditor extends FDeckEditor {
|
|||||||
public void refresh() {
|
public void refresh() {
|
||||||
FThreads.invokeInBackgroundThread(() -> {
|
FThreads.invokeInBackgroundThread(() -> {
|
||||||
for (TabPage<FDeckEditor> page : tabPages) {
|
for (TabPage<FDeckEditor> page : tabPages) {
|
||||||
if (page instanceof CatalogPage)
|
if (page instanceof CollectionAutoSellPage p)
|
||||||
((CatalogPage) page).scheduleRefresh();
|
p.refresh();
|
||||||
else if (page instanceof CardManagerPage)
|
else if (page instanceof CatalogPage p)
|
||||||
((CardManagerPage) page).refresh();
|
p.scheduleRefresh();
|
||||||
|
else if (page instanceof CardManagerPage p)
|
||||||
|
p.refresh();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import forge.model.FModel;
|
|||||||
import forge.screens.FScreen;
|
import forge.screens.FScreen;
|
||||||
import forge.toolbox.FOptionPane;
|
import forge.toolbox.FOptionPane;
|
||||||
import forge.util.Callback;
|
import forge.util.Callback;
|
||||||
|
import forge.util.ItemPool;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DeckEditScene
|
* DeckEditScene
|
||||||
@@ -79,7 +80,9 @@ public class ShopScene extends ForgeScene {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void doAutosell() {
|
private void doAutosell() {
|
||||||
AdventurePlayer.current().doBulkSell(AdventurePlayer.current().autoSellCards);
|
ItemPool<PaperCard> autoSellCards = AdventurePlayer.current().autoSellCards;
|
||||||
|
AdventurePlayer.current().doBulkSell(autoSellCards);
|
||||||
|
autoSellCards.clear();
|
||||||
if (screen != null)
|
if (screen != null)
|
||||||
screen.refresh();
|
screen.refresh();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user