reintegrated download images dialog to gui
parent
a9094bc5a2
commit
41b21a8c9e
|
@ -60,13 +60,13 @@ public class DownloadImageFiles extends ArrayList<DownloadImageFile> {
|
|||
final File cardsPathFile=new File(gamePathFile,"hqcards");
|
||||
for (final MagicCardDefinition cardDefinition : CardDefinitions.getInstance().getCards()) {
|
||||
|
||||
final String imageUrl=cardDefinition.getImageUrl();
|
||||
if (imageUrl!=null) {
|
||||
final String imageURL=cardDefinition.getImageURL();
|
||||
if (imageURL!=null) {
|
||||
final File imageFile=new File(cardsPathFile,cardDefinition.getImageName()+".jpg");
|
||||
if (!imageFile.exists()) {
|
||||
add(new DownloadImageFile(imageFile,new URL(imageUrl)));
|
||||
add(new DownloadImageFile(imageFile,new URL(imageURL)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,4 +92,4 @@ public class HighQualityCardImagesProvider implements CardImagesProvider {
|
|||
|
||||
return INSTANCE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,6 +57,7 @@ public class MagicCardDefinition {
|
|||
|
||||
private final String name;
|
||||
private final String fullName;
|
||||
private String imageURL;
|
||||
private int index=-1;
|
||||
private int value=0;
|
||||
private int removal=0;
|
||||
|
@ -133,6 +134,14 @@ public class MagicCardDefinition {
|
|||
|
||||
return isBasic()?2:1;
|
||||
}
|
||||
|
||||
public void setImageURL(final String imageURL) {
|
||||
this.imageURL = imageURL;
|
||||
}
|
||||
|
||||
public String getImageURL() {
|
||||
return imageURL;
|
||||
}
|
||||
|
||||
public void setValue(final int value) {
|
||||
|
||||
|
@ -593,4 +602,4 @@ public class MagicCardDefinition {
|
|||
return IconImages.SPELL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,8 @@ public class MagicFrame extends JFrame implements ActionListener {
|
|||
private JMenuItem playGameItem;
|
||||
private JMenuItem resetGameItem;
|
||||
private JMenuItem concedeGameItem;
|
||||
private JMenuItem preferencesItem;
|
||||
private JMenuItem downloadImagesItem;
|
||||
private JMenuItem preferencesItem;
|
||||
private JMenuItem quitItem;
|
||||
private JMenuItem cardExplorerItem;
|
||||
private JMenuItem keywordsItem;
|
||||
|
@ -238,7 +239,11 @@ public class MagicFrame extends JFrame implements ActionListener {
|
|||
|
||||
tournamentMenu.addSeparator();
|
||||
|
||||
preferencesItem=new JMenuItem("Preferences...");
|
||||
downloadImagesItem = new JMenuItem("Download images");
|
||||
downloadImagesItem.addActionListener(this);
|
||||
tournamentMenu.add(downloadImagesItem);
|
||||
|
||||
preferencesItem=new JMenuItem("Preferences");
|
||||
preferencesItem.addActionListener(this);
|
||||
tournamentMenu.add(preferencesItem);
|
||||
|
||||
|
@ -464,6 +469,8 @@ public class MagicFrame extends JFrame implements ActionListener {
|
|||
resetGame();
|
||||
} else if (source==concedeGameItem) {
|
||||
concedeGame();
|
||||
} else if (source==downloadImagesItem) {
|
||||
new DownloadImagesDialog(this);
|
||||
} else if (source==preferencesItem) {
|
||||
new PreferencesDialog(this);
|
||||
} else if (source==quitItem) {
|
||||
|
@ -474,4 +481,4 @@ public class MagicFrame extends JFrame implements ActionListener {
|
|||
openKeywords();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,8 +28,8 @@ public class VersionPanel extends JPanel implements ActionListener {
|
|||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static final String VERSION = "1.13";
|
||||
private static final String VERSION_TEXT = "Magarena Limited Edition "+VERSION+" by ubeefx";
|
||||
private static final String VERSION = "1.14";
|
||||
private static final String VERSION_TEXT = "Magarena " + VERSION;
|
||||
|
||||
private static final Border LOGO_BORDER=BorderFactory.createMatteBorder(2,2,2,2,new Color(0x8C,0x78,0x53));
|
||||
|
||||
|
@ -112,4 +112,4 @@ public class VersionPanel extends JPanel implements ActionListener {
|
|||
frame.loadTournament();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue