mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
update missing migration
This commit is contained in:
@@ -112,7 +112,7 @@ public class FDeckChooser extends FScreen {
|
||||
deckChooser.optionPane = new FOptionPane(null, null, title, null, container, ImmutableList.of(Forge.getLocalizer().getInstance().getMessage("lblOK"), Forge.getLocalizer().getInstance().getMessage("lblCancel")), 0, result -> {
|
||||
if (result == 0) {
|
||||
if (callback != null) {
|
||||
callback.run(deckChooser.getDeck());
|
||||
callback.accept(deckChooser.getDeck());
|
||||
}
|
||||
}
|
||||
}) {
|
||||
|
||||
@@ -561,25 +561,22 @@ public class FDeckEditor extends TabPageScreen<FDeckEditor> {
|
||||
if (editorConfig.getGameType() != null && editorConfig.hasInfiniteCardPool()) {
|
||||
addItem(new FMenuItem(localizer.getMessage("lblImportFromClipboard"), Forge.hdbuttons ? FSkinImage.HDIMPORT : FSkinImage.OPEN, e -> {
|
||||
FDeckImportDialog dialog = new FDeckImportDialog(!deck.isEmpty(), FDeckEditor.this.editorConfig);
|
||||
dialog.setCallback(new Callback<>() {
|
||||
@Override
|
||||
public void run(Deck importedDeck) {
|
||||
if (deck != null && importedDeck.hasName()) {
|
||||
deck.setName(importedDeck.getName());
|
||||
setHeaderText(importedDeck.getName());
|
||||
dialog.setCallback(importedDeck -> {
|
||||
if (deck != null && importedDeck.hasName()) {
|
||||
deck.setName(importedDeck.getName());
|
||||
setHeaderText(importedDeck.getName());
|
||||
}
|
||||
if (dialog.createNewDeck()) {
|
||||
for (Entry<DeckSection, CardPool> section : importedDeck) {
|
||||
DeckSectionPage page = getPageForSection(section.getKey());
|
||||
if (page != null)
|
||||
page.setCards(section.getValue());
|
||||
}
|
||||
if (dialog.createNewDeck()) {
|
||||
for (Entry<DeckSection, CardPool> section : importedDeck) {
|
||||
DeckSectionPage page = getPageForSection(section.getKey());
|
||||
if (page != null)
|
||||
page.setCards(section.getValue());
|
||||
}
|
||||
} else {
|
||||
for (Entry<DeckSection, CardPool> section : importedDeck) {
|
||||
DeckSectionPage page = getPageForSection(section.getKey());
|
||||
if (page != null)
|
||||
page.addCards(section.getValue());
|
||||
}
|
||||
} else {
|
||||
for (Entry<DeckSection, CardPool> section : importedDeck) {
|
||||
DeckSectionPage page = getPageForSection(section.getKey());
|
||||
if (page != null)
|
||||
page.addCards(section.getValue());
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1828,16 +1825,13 @@ public class FDeckEditor extends TabPageScreen<FDeckEditor> {
|
||||
sortedOptions.add(option);
|
||||
}
|
||||
}
|
||||
GuiChoose.oneOrNone(Forge.getLocalizer().getMessage("lblSelectPreferredArt") + " " + card.getName(), sortedOptions, new Callback<>() {
|
||||
@Override
|
||||
public void run(PaperCard result) {
|
||||
if (result != null) {
|
||||
if (result != card) {
|
||||
cardManager.replaceAll(card, result);
|
||||
}
|
||||
prefs.setPreferredArt(result.getEdition(), result.getArtIndex());
|
||||
CardPreferences.save();
|
||||
GuiChoose.oneOrNone(Forge.getLocalizer().getMessage("lblSelectPreferredArt") + " " + card.getName(), sortedOptions, result -> {
|
||||
if (result != null) {
|
||||
if (result != card) {
|
||||
cardManager.replaceAll(card, result);
|
||||
}
|
||||
prefs.setPreferredArt(result.getEdition(), result.getArtIndex());
|
||||
CardPreferences.save();
|
||||
}
|
||||
});
|
||||
}));
|
||||
|
||||
@@ -52,7 +52,7 @@ public class GuiDownloader extends FDialog {
|
||||
service.setCancel(true);
|
||||
hide();
|
||||
if (callback != null) {
|
||||
callback.run(getButton(0).getText() == "OK"); //determine result based on whether download finished
|
||||
callback.accept(getButton(0).getText() == "OK"); //determine result based on whether download finished
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -77,8 +77,8 @@ public class FFileChooser extends FDialog {
|
||||
refreshFileList();
|
||||
return;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} catch (Exception e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
FOptionPane.showErrorDialog(Forge.getLocalizer().getMessage("lblEnterFolderNameNotValid", result), Forge.getLocalizer().getMessage("lblInvalidName"));
|
||||
});
|
||||
@@ -229,8 +229,8 @@ public class FFileChooser extends FDialog {
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
catch (Exception e2) {
|
||||
e2.printStackTrace();
|
||||
}
|
||||
FOptionPane.showErrorDialog(Forge.getLocalizer().getMessage("lblEnterNameNotValid", result), Forge.getLocalizer().getMessage("lblInvalidName"));
|
||||
});
|
||||
@@ -259,8 +259,8 @@ public class FFileChooser extends FDialog {
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
catch (Exception e3) {
|
||||
e3.printStackTrace();
|
||||
}
|
||||
FOptionPane.showErrorDialog(Forge.getLocalizer().getMessage("lblCouldBotDeleteFile"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user