mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
Merge remote-tracking branch 'upstream/master' into display_localization_cardname
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
#!/bin/sh
|
||||
cd "`dirname \"$0\"`"
|
||||
java -Xmx1024m -jar $project.build.finalName$
|
||||
cd $(dirname "${0}")
|
||||
java -Xmx4096m -Dfile.encoding=UTF-8 -jar $project.build.finalName$
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#!/bin/sh
|
||||
cd "`dirname \"$0\"`"
|
||||
java -Xmx1024m -jar $project.build.finalName$
|
||||
cd $(dirname "${0}")
|
||||
java -Xmx4096m -Dfile.encoding=UTF-8 -jar $project.build.finalName$
|
||||
|
||||
@@ -82,7 +82,7 @@ public class DeckStarRenderer extends ItemCellRenderer {
|
||||
}
|
||||
else if (DeckPreferences.getPrefs(deck).getStarCount() == 0) {
|
||||
this.setToolTipText("Click to add " + deck.getName() + " to your favorites");
|
||||
skinImage = FSkin.getImage(FSkinProp.IMG_STAR_OUTINE);
|
||||
skinImage = FSkin.getImage(FSkinProp.IMG_STAR_OUTLINE);
|
||||
}
|
||||
else { //TODO: consider supporting more than 1 star
|
||||
this.setToolTipText("Click to remove " + deck.getName() + " from your favorites");
|
||||
|
||||
@@ -83,7 +83,7 @@ public class StarRenderer extends ItemCellRenderer {
|
||||
}
|
||||
else if (CardPreferences.getPrefs(card).getStarCount() == 0) {
|
||||
this.setToolTipText("Click to add " + card.getName() + " to your favorites");
|
||||
skinImage = FSkin.getImage(FSkinProp.IMG_STAR_OUTINE);
|
||||
skinImage = FSkin.getImage(FSkinProp.IMG_STAR_OUTLINE);
|
||||
}
|
||||
else { //TODO: consider supporting more than 1 star
|
||||
this.setToolTipText("Click to remove " + card.getName() + " from your favorites");
|
||||
|
||||
@@ -103,7 +103,7 @@ public final class CEditorConstructed extends CDeckEditor<Deck> {
|
||||
case TinyLeaders:
|
||||
allSections.add(DeckSection.Commander);
|
||||
|
||||
commanderFilter = CardRulesPredicates.Presets.CAN_BE_COMMANDER;
|
||||
commanderFilter = CardRulesPredicates.Presets.CAN_BE_TINY_LEADERS_COMMANDER;
|
||||
commanderPool = ItemPool.createFrom(FModel.getMagicDb().getCommonCards().getAllCards(Predicates.compose(commanderFilter, PaperCard.FN_GET_RULES)), PaperCard.class);
|
||||
normalPool = ItemPool.createFrom(FModel.getMagicDb().getCommonCards().getAllCards(), PaperCard.class);
|
||||
|
||||
|
||||
@@ -23,6 +23,13 @@ public enum CSubmenuDownloaders implements ICDoc {
|
||||
VSubmenuDownloaders.SINGLETON_INSTANCE.showLicensing();
|
||||
}
|
||||
};
|
||||
private final UiCommand cmdCheckForUpdates = new UiCommand() {
|
||||
@Override
|
||||
public void run() {
|
||||
new AutoUpdater(false).attemptToUpdate();
|
||||
}
|
||||
};
|
||||
|
||||
private final UiCommand cmdPicDownload = new UiCommand() {
|
||||
@Override public void run() {
|
||||
new GuiDownloader(new GuiDownloadPicturesLQ()).show();
|
||||
@@ -84,6 +91,7 @@ public enum CSubmenuDownloaders implements ICDoc {
|
||||
@Override
|
||||
public void initialize() {
|
||||
final VSubmenuDownloaders view = VSubmenuDownloaders.SINGLETON_INSTANCE;
|
||||
view.setCheckForUpdatesCommand(cmdCheckForUpdates);
|
||||
view.setDownloadPicsCommand(cmdPicDownload);
|
||||
view.setDownloadPicsHQCommand(cmdPicDownloadHQ);
|
||||
view.setDownloadSetPicsCommand(cmdSetDownload);
|
||||
|
||||
@@ -3,6 +3,7 @@ package forge.screens.home.settings;
|
||||
import forge.*;
|
||||
import forge.ai.AiProfileUtil;
|
||||
import forge.control.FControl.CloseAction;
|
||||
import forge.download.AutoUpdater;
|
||||
import forge.game.GameLogEntryType;
|
||||
import forge.gui.framework.FScreen;
|
||||
import forge.gui.framework.ICDoc;
|
||||
@@ -225,6 +226,7 @@ public enum CSubmenuPreferences implements ICDoc {
|
||||
initializeGameLogVerbosityComboBox();
|
||||
initializeCloseActionComboBox();
|
||||
initializeDefaultFontSizeComboBox();
|
||||
initializeAutoUpdaterComboBox();
|
||||
initializeMulliganRuleComboBox();
|
||||
initializeAiProfilesComboBox();
|
||||
initializeStackAdditionsComboBox();
|
||||
@@ -378,6 +380,16 @@ public enum CSubmenuPreferences implements ICDoc {
|
||||
panel.setComboBox(comboBox, selectedItem);
|
||||
}
|
||||
|
||||
private void initializeAutoUpdaterComboBox() {
|
||||
// TODO: Ideally we would filter out update paths based on the type of Forge people have
|
||||
final String[] updatePaths = AutoUpdater.updateChannels;
|
||||
final FPref updatePreference = FPref.AUTO_UPDATE;
|
||||
final FComboBoxPanel<String> panel = this.view.getCbpAutoUpdater();
|
||||
final FComboBox<String> comboBox = createComboBox(updatePaths, updatePreference);
|
||||
final String selectedItem = this.prefs.getPref(updatePreference);
|
||||
panel.setComboBox(comboBox, selectedItem);
|
||||
}
|
||||
|
||||
private void initializeMulliganRuleComboBox() {
|
||||
final String [] choices = MulliganDefs.getMulliganRuleNames();
|
||||
final FPref userSetting = FPref.MULLIGAN_RULE;
|
||||
|
||||
@@ -55,6 +55,7 @@ public enum VSubmenuDownloaders implements IVSubmenu<CSubmenuDownloaders> {
|
||||
private final JPanel pnlContent = new JPanel(new MigLayout("insets 0, gap 0, wrap, ay center"));
|
||||
private final FScrollPane scrContent = new FScrollPane(pnlContent, false);
|
||||
|
||||
private final FLabel btnCheckForUpdates = _makeButton(localizer.getMessage("btnCheckForUpdates"));
|
||||
private final FLabel btnDownloadSetPics = _makeButton(localizer.getMessage("btnDownloadSetPics"));
|
||||
private final FLabel btnDownloadPics = _makeButton(localizer.getMessage("btnDownloadPics"));
|
||||
private final FLabel btnDownloadPicsHQ = _makeButton(localizer.getMessage("btnDownloadPicsHQ"));
|
||||
@@ -80,6 +81,9 @@ public enum VSubmenuDownloaders implements IVSubmenu<CSubmenuDownloaders> {
|
||||
|
||||
if (javaRecentEnough()) {
|
||||
|
||||
pnlContent.add(btnCheckForUpdates, constraintsBTN);
|
||||
pnlContent.add(_makeLabel(localizer.getMessage("lblCheckForUpdates")), constraintsLBL);
|
||||
|
||||
pnlContent.add(btnDownloadPics, constraintsBTN);
|
||||
pnlContent.add(_makeLabel(localizer.getMessage("lblDownloadPics")), constraintsLBL);
|
||||
|
||||
@@ -162,6 +166,7 @@ public enum VSubmenuDownloaders implements IVSubmenu<CSubmenuDownloaders> {
|
||||
return EMenuGroup.SETTINGS;
|
||||
}
|
||||
|
||||
public void setCheckForUpdatesCommand(UiCommand command) { btnCheckForUpdates.setCommand(command); }
|
||||
public void setDownloadPicsCommand(UiCommand command) { btnDownloadPics.setCommand(command); }
|
||||
public void setDownloadPicsHQCommand(UiCommand command) { btnDownloadPicsHQ.setCommand(command); }
|
||||
public void setDownloadSetPicsCommand(UiCommand command) { btnDownloadSetPics.setCommand(command); }
|
||||
|
||||
@@ -25,8 +25,8 @@ import java.awt.event.FocusAdapter;
|
||||
import java.awt.event.FocusEvent;
|
||||
import java.awt.event.KeyAdapter;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
@@ -123,6 +123,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
||||
private final FComboBoxPanel<String> cbpCounterDisplayLocation =new FComboBoxPanel<>(localizer.getMessage("cbpCounterDisplayLocation")+":");
|
||||
private final FComboBoxPanel<String> cbpGraveyardOrdering = new FComboBoxPanel<>(localizer.getMessage("cbpGraveyardOrdering")+":");
|
||||
private final FComboBoxPanel<String> cbpDefaultLanguage = new FComboBoxPanel<>(localizer.getMessage("cbpSelectLanguage")+":");
|
||||
private final FComboBoxPanel<String> cbpAutoUpdater = new FComboBoxPanel<>(localizer.getMessage("cbpAutoUpdater")+":");
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
@@ -157,6 +158,10 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
||||
pnlPrefs.add(new SectionLabel(localizer.getMessage("GeneralConfiguration")), sectionConstraints);
|
||||
|
||||
// language
|
||||
|
||||
pnlPrefs.add(cbpAutoUpdater, comboBoxConstraints);
|
||||
pnlPrefs.add(new NoteLabel(localizer.getMessage("nlAutoUpdater")), descriptionConstraints);
|
||||
|
||||
pnlPrefs.add(cbpDefaultLanguage, comboBoxConstraints);
|
||||
pnlPrefs.add(new NoteLabel(localizer.getMessage("nlSelectLanguage")), descriptionConstraints);
|
||||
|
||||
@@ -531,6 +536,10 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
||||
}
|
||||
}
|
||||
|
||||
public final FComboBoxPanel<String> getCbpAutoUpdater() {
|
||||
return cbpAutoUpdater;
|
||||
}
|
||||
|
||||
/** @return {@link javax.swing.JCheckBox} */
|
||||
public final JCheckBox getCbCompactMainMenu() {
|
||||
return cbCompactMainMenu;
|
||||
|
||||
@@ -1162,7 +1162,7 @@ public class FSkin {
|
||||
}
|
||||
|
||||
final Localizer localizer = Localizer.getInstance();
|
||||
FView.SINGLETON_INSTANCE.setSplashProgessBarMessage(localizer.getMessage("splash.loading.processingimagesprites") + ": ", 8);
|
||||
FView.SINGLETON_INSTANCE.setSplashProgessBarMessage(localizer.getMessage("splash.loading.processingimagesprites") + ": ", 12);
|
||||
|
||||
// Grab and test various sprite files.
|
||||
final String defaultDir = ForgeConstants.DEFAULT_SKINS_DIR;
|
||||
|
||||
@@ -81,7 +81,7 @@ public final class Main {
|
||||
break;
|
||||
|
||||
default:
|
||||
System.out.println("Unknown mode.\nKnown mode is 'sim' ");
|
||||
System.out.println("Unknown mode.\nKnown mode is 'sim', 'parse' ");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -486,7 +486,7 @@ public class PlayerControllerForTests extends PlayerController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object vote(SpellAbility sa, String prompt, List<Object> options, ListMultimap<Object, Player> votes) {
|
||||
public Object vote(SpellAbility sa, String prompt, List<Object> options, ListMultimap<Object, Player> votes, Player forPlayer) {
|
||||
return chooseItem(options);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user