mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
Merge branch 'Card-Forge:master' into fixes20250816
This commit is contained in:
@@ -552,26 +552,16 @@ public final class CardEdition implements Comparable<CardEdition> {
|
||||
|
||||
public List<PrintSheet> getPrintSheetsBySection() {
|
||||
final CardDb cardDb = StaticData.instance().getCommonCards();
|
||||
Map<String, Integer> cardToIndex = new HashMap<>();
|
||||
|
||||
List<PrintSheet> sheets = Lists.newArrayList();
|
||||
for (String sectionName : cardMap.keySet()) {
|
||||
if (sectionName.equals(EditionSectionWithCollectorNumbers.CONJURED.getName())) {
|
||||
for (Map.Entry<String, java.util.Collection<EditionEntry>> section : cardMap.asMap().entrySet()) {
|
||||
if (section.getKey().equals(EditionSectionWithCollectorNumbers.CONJURED.getName())) {
|
||||
continue;
|
||||
}
|
||||
PrintSheet sheet = new PrintSheet(String.format("%s %s", this.getCode(), sectionName));
|
||||
PrintSheet sheet = new PrintSheet(String.format("%s %s", this.getCode(), section.getKey()));
|
||||
|
||||
List<EditionEntry> cards = cardMap.get(sectionName);
|
||||
for (EditionEntry card : cards) {
|
||||
int index = 1;
|
||||
if (cardToIndex.containsKey(card.name)) {
|
||||
index = cardToIndex.get(card.name) + 1;
|
||||
}
|
||||
|
||||
cardToIndex.put(card.name, index);
|
||||
|
||||
PaperCard pCard = cardDb.getCard(card.name, this.getCode(), index);
|
||||
sheet.add(pCard);
|
||||
for (EditionEntry card : section.getValue()) {
|
||||
sheet.add(cardDb.getCard(card.name, this.getCode(), card.collectorNumber));
|
||||
}
|
||||
|
||||
sheets.add(sheet);
|
||||
|
||||
@@ -437,6 +437,7 @@ public class AdventureDeckEditor extends FDeckEditor {
|
||||
cardManager.setBtnAdvancedSearchOptions(true);
|
||||
cardManager.setCatalogDisplay(true);
|
||||
cardManager.setPool(getCardPool(), false); //Need to update this early for the caption.
|
||||
this.updateCaption();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -470,7 +471,7 @@ public class AdventureDeckEditor extends FDeckEditor {
|
||||
));
|
||||
}
|
||||
if(parentScreen instanceof AdventureDeckEditor adventureEditor && adventureEditor.getCatalogPage() != null) {
|
||||
CollectionCatalogPage catalogPage = (CollectionCatalogPage) adventureEditor.getCatalogPage();
|
||||
CatalogPage catalogPage = adventureEditor.getCatalogPage();
|
||||
int autoSellCount = cardManager.getItemCount(card);
|
||||
int amountInCollection = player.getCards().count(card);
|
||||
int safeToSellCount = amountInCollection - player.getCopiesUsedInDecks(card);
|
||||
|
||||
@@ -1793,7 +1793,7 @@ public class FDeckEditor extends TabPageScreen<FDeckEditor> {
|
||||
DeckSection destination = DeckSection.matchingSection(card);
|
||||
final DeckSectionPage destinationPage = parentScreen.getPageForSection(destination);
|
||||
|
||||
if (!needsCommander() && !canOnlyBePartnerCommander(card)) {
|
||||
if (!needsCommander() && !canOnlyBePartnerCommander(card) && destinationPage != null) {
|
||||
addMoveCardMenuItem(menu, card, this, destinationPage);
|
||||
if (canSideboard(card) && destination != DeckSection.Sideboard) {
|
||||
addMoveCardMenuItem(menu, card, this, parentScreen.getSideboardPage());
|
||||
|
||||
@@ -41,6 +41,9 @@ public class NewDraftScreen extends LaunchScreen {
|
||||
|
||||
@Override
|
||||
protected void startMatch() {
|
||||
// initialize custom cubes first to fill the menus, will be instant if preloaded
|
||||
LoadingOverlay.show(Forge.getLocalizer().getMessage("lblLoadingNewDraft"), true, BoosterDraft::initializeCustomDrafts);
|
||||
|
||||
//must run in game thread to prevent blocking UI thread
|
||||
ThreadUtil.invokeInGameThread(() -> {
|
||||
final LimitedPoolType poolType = SGuiChoose.oneOrNone(Forge.getLocalizer().getMessage("lblChooseDraftFormat"), LimitedPoolType.values(true));
|
||||
@@ -49,11 +52,7 @@ public class NewDraftScreen extends LaunchScreen {
|
||||
final BoosterDraft draft = BoosterDraft.createDraft(poolType);
|
||||
if (draft == null) { return; }
|
||||
|
||||
FThreads.invokeInEdtLater(() ->
|
||||
LoadingOverlay.show(Forge.getLocalizer().getMessage("lblLoadingNewDraft"), true,
|
||||
() -> Forge.openScreen(new DraftingProcessScreen(draft, FDeckEditor.EditorConfigDraft))
|
||||
)
|
||||
);
|
||||
FThreads.invokeInEdtLater(() -> Forge.openScreen(new DraftingProcessScreen(draft, FDeckEditor.EditorConfigDraft)));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user