mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
Clipboard .mtga deck importing & fixes to .mtga and .dck importers (#9321)
This commit is contained in:
parent
4728bac28e
commit
17deba2df3
4 changed files with 46 additions and 22 deletions
|
|
@ -68,7 +68,14 @@ public class DeckImportClipboardDialog extends MageDialog {
|
|||
}
|
||||
|
||||
private void onOK() {
|
||||
tmpPath = DeckUtil.writeTextToTempFile(editData.getText());
|
||||
String decklist = editData.getText();
|
||||
decklist = decklist.replace(FORMAT_TEXT, "");
|
||||
// This dialog also accepts a paste in .mtga format
|
||||
if (decklist.startsWith("Deck\n")) { // An .mtga list always starts with the first line being "Deck". This kind of paste is processed as .mtga
|
||||
tmpPath = DeckUtil.writeTextToTempFile("cbimportdeck", ".mtga", decklist);
|
||||
} else { // If the paste is not .mtga format, it's processed as plaintext
|
||||
tmpPath = DeckUtil.writeTextToTempFile(decklist);
|
||||
}
|
||||
this.removeDialog();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue