Added content downloaders for achievement images.

This commit is contained in:
Krazy
2015-09-11 03:38:18 +00:00
parent 02a8aa6075
commit 1c71ff6941
4 changed files with 53 additions and 42 deletions

View File

@@ -1,17 +1,13 @@
package forge.screens.home.settings;
import javax.swing.SwingUtilities;
import forge.UiCommand;
import forge.download.GuiDownloadPicturesLQ;
import forge.download.GuiDownloadPrices;
import forge.download.GuiDownloadQuestImages;
import forge.download.GuiDownloadSetPicturesLQ;
import forge.download.GuiDownloader;
import forge.download.*;
import forge.error.BugReporter;
import forge.gui.ImportDialog;
import forge.gui.framework.ICDoc;
import javax.swing.*;
/**
* Controls the utilities submenu in the home UI.
*
@@ -42,6 +38,11 @@ public enum CSubmenuDownloaders implements ICDoc {
new GuiDownloader(new GuiDownloadQuestImages()).show();
}
};
private final UiCommand cmdAchievementImages = new UiCommand() {
@Override public void run() {
new GuiDownloader(new GuiDownloadAchievementImages()).show();
}
};
private final UiCommand cmdDownloadPrices = new UiCommand() {
@Override public void run() {
new GuiDownloader(new GuiDownloadPrices()).show();
@@ -76,6 +77,7 @@ public enum CSubmenuDownloaders implements ICDoc {
view.setDownloadPicsCommand(cmdPicDownload);
view.setDownloadSetPicsCommand(cmdSetDownload);
view.setDownloadQuestImagesCommand(cmdQuestImages);
view.setDownloadAchievementImagesCommand(cmdAchievementImages);
view.setReportBugCommand(cmdReportBug);
view.setImportPicturesCommand(cmdImportPictures);
view.setHowToPlayCommand(cmdHowToPlay);

View File

@@ -41,6 +41,7 @@ public enum VSubmenuDownloaders implements IVSubmenu<CSubmenuDownloaders> {
private final FLabel btnDownloadSetPics = _makeButton("Download LQ Set Pictures");
private final FLabel btnDownloadPics = _makeButton("Download LQ Card Pictures");
private final FLabel btnDownloadQuestImages = _makeButton("Download Quest Images");
private final FLabel btnDownloadAchievementImages = _makeButton("Download Achievement Images");
private final FLabel btnReportBug = _makeButton("Report a Bug");
private final FLabel btnImportPictures = _makeButton("Import Data");
private final FLabel btnHowToPlay = _makeButton("How To Play");
@@ -50,7 +51,7 @@ public enum VSubmenuDownloaders implements IVSubmenu<CSubmenuDownloaders> {
/**
* Constructor.
*/
private VSubmenuDownloaders() {
VSubmenuDownloaders() {
final String constraintsLBL = "w 90%!, h 20px!, center, gap 0 0 3px 8px";
final String constraintsBTN = "h 30px!, w 50%!, center";
@@ -65,6 +66,9 @@ public enum VSubmenuDownloaders implements IVSubmenu<CSubmenuDownloaders> {
pnlContent.add(btnDownloadQuestImages, constraintsBTN);
pnlContent.add(_makeLabel("Download tokens and icons used in Quest mode."), constraintsLBL);
pnlContent.add(btnDownloadAchievementImages, constraintsBTN);
pnlContent.add(_makeLabel("Download achievement images to really make your trophies stand out."), constraintsLBL);
pnlContent.add(btnDownloadPrices, constraintsBTN);
pnlContent.add(_makeLabel("Download up-to-date price list for in-game card shops."), constraintsLBL);
@@ -106,6 +110,7 @@ public enum VSubmenuDownloaders implements IVSubmenu<CSubmenuDownloaders> {
public void setDownloadPicsCommand(UiCommand command) { btnDownloadPics.setCommand(command); }
public void setDownloadSetPicsCommand(UiCommand command) { btnDownloadSetPics.setCommand(command); }
public void setDownloadQuestImagesCommand(UiCommand command) { btnDownloadQuestImages.setCommand(command); }
public void setDownloadAchievementImagesCommand(UiCommand command) { btnDownloadAchievementImages.setCommand(command); }
public void setReportBugCommand(UiCommand command) { btnReportBug.setCommand(command); }
public void setImportPicturesCommand(UiCommand command) { btnImportPictures.setCommand(command); }
public void setHowToPlayCommand(UiCommand command) { btnHowToPlay.setCommand(command); }

View File

@@ -1,5 +1,6 @@
package forge.screens.settings;
import forge.download.*;
import org.apache.commons.lang3.StringUtils;
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
@@ -8,11 +9,6 @@ import forge.Graphics;
import forge.assets.FSkinColor;
import forge.assets.FSkinFont;
import forge.assets.FSkinImage;
import forge.download.GuiDownloadPicturesLQ;
import forge.download.GuiDownloadPrices;
import forge.download.GuiDownloadQuestImages;
import forge.download.GuiDownloadService;
import forge.download.GuiDownloadSetPicturesLQ;
import forge.properties.ForgeProfileProperties;
import forge.screens.TabPageScreen.TabPage;
import forge.toolbox.FFileChooser;
@@ -56,6 +52,13 @@ public class FilesPage extends TabPage<SettingsScreen> {
return new GuiDownloadQuestImages();
}
}, 0);
lstItems.addItem(new ContentDownloader("Download Achievement Images",
"Download achievement images to really make your trophies stand out.") {
@Override
protected GuiDownloadService createService() {
return new GuiDownloadAchievementImages();
}
}, 0);
lstItems.addItem(new ContentDownloader("Download Card Prices",
"Download up-to-date price list for in-game card shops.") {
@Override
@@ -98,7 +101,7 @@ public class FilesPage extends TabPage<SettingsScreen> {
protected String label;
protected String description;
public FilesItem(String label0, String description0) {
FilesItem(String label0, String description0) {
label = label0;
description = description0;
}
@@ -136,7 +139,7 @@ public class FilesPage extends TabPage<SettingsScreen> {
}
private abstract class ContentDownloader extends FilesItem {
public ContentDownloader(String label0, String description0) {
ContentDownloader(String label0, String description0) {
super(label0, description0);
}
@@ -148,7 +151,7 @@ public class FilesPage extends TabPage<SettingsScreen> {
}
private abstract class StorageOption extends FilesItem {
public StorageOption(String name0, String dir0) {
StorageOption(String name0, String dir0) {
super(name0, dir0);
}

View File

@@ -39,6 +39,7 @@ public final class ForgeConstants {
public static final String IMAGE_LIST_QUEST_BOOSTERBOXES_FILE = LISTS_DIR + "boosterbox-images.txt";
public static final String IMAGE_LIST_QUEST_PRECONS_FILE = LISTS_DIR + "precon-images.txt";
public static final String IMAGE_LIST_QUEST_TOURNAMENTPACKS_FILE = LISTS_DIR + "tournamentpack-images.txt";
public static final String IMAGE_LIST_ACHIEVEMENTS_FILE = LISTS_DIR + "achievement-images.txt";
public static final String NET_DECKS_LIST_FILE = LISTS_DIR + "net-decks.txt";
public static final String NET_DECKS_COMMANDER_LIST_FILE = LISTS_DIR + "net-decks-commander.txt";