mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
translate some text
This commit is contained in:
@@ -810,10 +810,10 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
||||
final int fetchNum = Math.min(player.getCardsIn(ZoneType.Library).size(), 4);
|
||||
CardCollectionView shown = !decider.hasKeyword("LimitSearchLibrary") ? player.getCardsIn(ZoneType.Library) : player.getCardsIn(ZoneType.Library, fetchNum);
|
||||
// Look at whole library before moving onto choosing a card
|
||||
delayedReveal = new DelayedReveal(shown, ZoneType.Library, PlayerView.get(player), source.getName() + " - " + Localizer.getInstance().getMessage("lblLookingCardIn") + " ");
|
||||
delayedReveal = new DelayedReveal(shown, ZoneType.Library, PlayerView.get(player), CardTranslation.getTranslatedName(source.getName()) + " - " + Localizer.getInstance().getMessage("lblLookingCardIn") + " ");
|
||||
}
|
||||
else if (origin.contains(ZoneType.Hand) && player.isOpponentOf(decider)) {
|
||||
delayedReveal = new DelayedReveal(player.getCardsIn(ZoneType.Hand), ZoneType.Hand, PlayerView.get(player), source.getName() + " - " + Localizer.getInstance().getMessage("lblLookingCardIn") + " ");
|
||||
delayedReveal = new DelayedReveal(player.getCardsIn(ZoneType.Hand), ZoneType.Hand, PlayerView.get(player), CardTranslation.getTranslatedName(source.getName()) + " - " + Localizer.getInstance().getMessage("lblLookingCardIn") + " ");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import forge.util.Lang;
|
||||
import forge.util.TextUtil;
|
||||
import forge.util.collect.FCollectionView;
|
||||
import forge.util.Localizer;
|
||||
import forge.util.CardTranslation;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -146,7 +147,7 @@ public class DigEffect extends SpellAbilityEffect {
|
||||
}
|
||||
else if (!sa.hasParam("NoLooking")) {
|
||||
// show the user the revealed cards
|
||||
delayedReveal = new DelayedReveal(top, srcZone, PlayerView.get(p), host.getName() + " - " + Localizer.getInstance().getMessage("lblLookingCardIn") + " ");
|
||||
delayedReveal = new DelayedReveal(top, srcZone, PlayerView.get(p), CardTranslation.getTranslatedName(host.getName()) + " - " + Localizer.getInstance().getMessage("lblLookingCardIn") + " ");
|
||||
|
||||
if (noMove) {
|
||||
// Let the activating player see the cards even if they're not moved
|
||||
@@ -198,7 +199,7 @@ public class DigEffect extends SpellAbilityEffect {
|
||||
// Optional abilities that use a dialog box to prompt the user to skip the ability (e.g. Explorer's Scope, Quest for Ula's Temple)
|
||||
if (optional && mayBeSkipped && !valid.isEmpty()) {
|
||||
String prompt = !optionalAbilityPrompt.isEmpty() ? optionalAbilityPrompt : Localizer.getInstance().getMessage("lblWouldYouLikeProceedWithOptionalAbility") + " " + sa.getHostCard() + "?\n\n(" + sa.getDescription() + ")";
|
||||
if (!p.getController().confirmAction(sa, null, TextUtil.fastReplace(prompt, "CARDNAME", sa.getHostCard().getName()))) {
|
||||
if (!p.getController().confirmAction(sa, null, TextUtil.fastReplace(prompt, "CARDNAME", CardTranslation.getTranslatedName(sa.getHostCard().getName())))) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import java.awt.event.WindowEvent;
|
||||
import java.awt.event.WindowFocusListener;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import forge.util.Localizer;
|
||||
|
||||
import javax.swing.AbstractListModel;
|
||||
import javax.swing.Icon;
|
||||
@@ -113,7 +114,7 @@ public class CardListViewer extends FDialog {
|
||||
|
||||
this.addWindowFocusListener(new CardListFocuser());
|
||||
|
||||
final FButton btnOK = new FButton("OK");
|
||||
final FButton btnOK = new FButton(Localizer.getInstance().getMessage("lblOK"));
|
||||
btnOK.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(final ActionEvent e) {
|
||||
|
||||
@@ -46,6 +46,8 @@ import forge.toolbox.FMouseAdapter;
|
||||
import forge.toolbox.FOptionPane;
|
||||
import forge.toolbox.FScrollPane;
|
||||
|
||||
import forge.util.Localizer;
|
||||
|
||||
/**
|
||||
* A simple class that shows a list of choices in a dialog. Two properties
|
||||
* influence the behavior of a list chooser: minSelection and maxSelection.
|
||||
@@ -60,7 +62,7 @@ import forge.toolbox.FScrollPane;
|
||||
* disabled.</li>
|
||||
* <li>The dialog was "committed" if "OK" was clicked or a choice was double
|
||||
* clicked.</li>
|
||||
* <li>The dialog was "canceled" if "Cancel" or "X" was clicked.</li>
|
||||
* <li>The dialog was "canceled" if Localizer.getInstance().getMessage("lblCancel") or "X" was clicked.</li>
|
||||
* <li>If the dialog was canceled, the selection will be empty.</li>
|
||||
* <li>
|
||||
* </ul>
|
||||
@@ -91,9 +93,9 @@ public class ListChooser<T> {
|
||||
|
||||
final ImmutableList<String> options;
|
||||
if (minChoices == 0) {
|
||||
options = ImmutableList.of("OK","Cancel");
|
||||
options = ImmutableList.of(Localizer.getInstance().getMessage("lblOK"),Localizer.getInstance().getMessage("lblCancel"));
|
||||
} else {
|
||||
options = ImmutableList.of("OK");
|
||||
options = ImmutableList.of(Localizer.getInstance().getMessage("lblOK"));
|
||||
}
|
||||
|
||||
if (maxChoices == 1 || minChoices == -1) {
|
||||
|
||||
@@ -21,6 +21,7 @@ import forge.toolbox.FSkin;
|
||||
import forge.toolbox.FSkin.SkinnedPanel;
|
||||
import forge.toolbox.FTextField;
|
||||
import forge.toolbox.LayoutHelper;
|
||||
import forge.util.Localizer;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
@@ -89,7 +90,7 @@ public class AdvancedSearchFilter<T extends InventoryItem> extends ItemFilter<T>
|
||||
GuiUtils.addSeparator(menu);
|
||||
}
|
||||
|
||||
GuiUtils.addMenuItem(menu, "Edit Expression", null, new Runnable() {
|
||||
GuiUtils.addMenuItem(menu, Localizer.getInstance().getMessage("lblEditExpression"), null, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
edit();
|
||||
@@ -97,7 +98,7 @@ public class AdvancedSearchFilter<T extends InventoryItem> extends ItemFilter<T>
|
||||
});
|
||||
|
||||
if (hasFilters) {
|
||||
GuiUtils.addMenuItem(menu, "Clear Filter", null, new Runnable() {
|
||||
GuiUtils.addMenuItem(menu, Localizer.getInstance().getMessage("lblClearFilter"), null, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
reset();
|
||||
@@ -173,7 +174,7 @@ public class AdvancedSearchFilter<T extends InventoryItem> extends ItemFilter<T>
|
||||
}
|
||||
|
||||
private boolean show() {
|
||||
optionPane = new FOptionPane(null, "Advanced Search", null, scroller, ImmutableList.of("OK", "Cancel"), 0);
|
||||
optionPane = new FOptionPane(null, Localizer.getInstance().getMessage("lblAdvancedSearch"), null, scroller, ImmutableList.of(Localizer.getInstance().getMessage("lblOK"), Localizer.getInstance().getMessage("lblCancel")), 0);
|
||||
optionPane.addComponentListener(new ComponentAdapter() {
|
||||
@Override
|
||||
public void componentShown(ComponentEvent e) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import forge.gui.SOverlayUtils;
|
||||
import forge.model.FModel;
|
||||
import forge.toolbox.*;
|
||||
import forge.util.TextUtil;
|
||||
import forge.util.Localizer;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -24,7 +25,7 @@ public class DialogChooseSets {
|
||||
private Runnable okCallback;
|
||||
|
||||
private final List<FCheckBox> choices = new ArrayList<>();
|
||||
private final FCheckBox cbWantReprints = new FCheckBox("Display compatible reprints from more recent sets");
|
||||
private final FCheckBox cbWantReprints = new FCheckBox(Localizer.getInstance().getMessage("lblDisplayRecentSetRepints"));
|
||||
|
||||
// lists are of set codes (e.g. "2ED")
|
||||
public DialogChooseSets(Collection<String> preselectedSets, Collection<String> unselectableSets, boolean showWantReprintsCheckbox) {
|
||||
@@ -76,21 +77,21 @@ public class DialogChooseSets {
|
||||
optionsPanel.setVisible(false);
|
||||
optionsPanel.setOpaque(false);
|
||||
optionsPanel.add(new JSeparator(SwingConstants.HORIZONTAL), "w 100%, span 2, growx");
|
||||
optionsPanel.add(new FLabel.Builder().text("Select Random Sets").fontSize(17).fontStyle(Font.BOLD).build(), "h 40!, span 2");
|
||||
optionsPanel.add(new FLabel.Builder().text(Localizer.getInstance().getMessage("lblSelectRandomSets")).fontSize(17).fontStyle(Font.BOLD).build(), "h 40!, span 2");
|
||||
|
||||
JPanel leftOptionsPanel = new JPanel(new MigLayout("insets 10, gap 5, center, wrap 2"));
|
||||
leftOptionsPanel.setOpaque(false);
|
||||
leftOptionsPanel.add(new FLabel.Builder().text("Number to Select:").fontSize(14).fontStyle(Font.BOLD).build(), " span 2");
|
||||
leftOptionsPanel.add(new FLabel.Builder().text("Core:").build());
|
||||
leftOptionsPanel.add(new FLabel.Builder().text(Localizer.getInstance().getMessage("lblSelectNumber") + ":").fontSize(14).fontStyle(Font.BOLD).build(), " span 2");
|
||||
leftOptionsPanel.add(new FLabel.Builder().text(Localizer.getInstance().getMessage("lblCore") + ":").build());
|
||||
leftOptionsPanel.add(coreField, "w 40!");
|
||||
leftOptionsPanel.add(new FLabel.Builder().text("Expansion:").build());
|
||||
leftOptionsPanel.add(new FLabel.Builder().text(Localizer.getInstance().getMessage("lblExpansion") + ":").build());
|
||||
leftOptionsPanel.add(expansionField, "w 40!");
|
||||
leftOptionsPanel.add(new FLabel.Builder().text("Other:").build());
|
||||
leftOptionsPanel.add(otherField, "w 40!");
|
||||
|
||||
JPanel rightOptionsPanel = new JPanel(new MigLayout("insets 10, gap 25 5, center, wrap 2"));
|
||||
rightOptionsPanel.setOpaque(false);
|
||||
rightOptionsPanel.add(new FLabel.Builder().text("Format Restrictions:").fontSize(14).fontStyle(Font.BOLD).build(), "span 2");
|
||||
rightOptionsPanel.add(new FLabel.Builder().text(Localizer.getInstance().getMessage("lblFormatRestrictions") +":").fontSize(14).fontStyle(Font.BOLD).build(), "span 2");
|
||||
|
||||
ButtonGroup formatButtonGroup = new ButtonGroup();
|
||||
List<GameFormat> gameFormats = new ArrayList<>();
|
||||
@@ -98,7 +99,7 @@ public class DialogChooseSets {
|
||||
|
||||
gameFormats.forEach(item -> {
|
||||
if (item.getName().equals("Legacy")) {
|
||||
FRadioButton button = new FRadioButton("Legacy/Vintage");
|
||||
FRadioButton button = new FRadioButton(Localizer.getInstance().getMessage("lblLegacyOrVintage"));
|
||||
button.setActionCommand(item.getName());
|
||||
formatButtonGroup.add(button);
|
||||
rightOptionsPanel.add(button);
|
||||
@@ -110,12 +111,12 @@ public class DialogChooseSets {
|
||||
}
|
||||
});
|
||||
|
||||
FRadioButton button = new FRadioButton("Modern Card Frame");
|
||||
FRadioButton button = new FRadioButton(Localizer.getInstance().getMessage("lblModernCardFrame"));
|
||||
button.setActionCommand("Modern Card Frame");
|
||||
formatButtonGroup.add(button);
|
||||
rightOptionsPanel.add(button);
|
||||
|
||||
FRadioButton noFormatSelectionButton = new FRadioButton("No Format Restriction");
|
||||
FRadioButton noFormatSelectionButton = new FRadioButton(Localizer.getInstance().getMessage("lblNoFormatRestriction"));
|
||||
noFormatSelectionButton.setActionCommand("No Format Restriction");
|
||||
formatButtonGroup.add(noFormatSelectionButton);
|
||||
rightOptionsPanel.add(noFormatSelectionButton);
|
||||
@@ -124,7 +125,7 @@ public class DialogChooseSets {
|
||||
optionsPanel.add(leftOptionsPanel, "w 33%:40%:78%");
|
||||
optionsPanel.add(rightOptionsPanel, "w 33%:60%:78%");
|
||||
|
||||
FButton randomSelectionButton = new FButton("Randomize Sets");
|
||||
FButton randomSelectionButton = new FButton(Localizer.getInstance().getMessage("lblRandomizeSets"));
|
||||
randomSelectionButton.addActionListener(actionEvent -> {
|
||||
|
||||
int numberOfCoreSets = Integer.parseInt(coreField.getText());
|
||||
@@ -214,7 +215,7 @@ public class DialogChooseSets {
|
||||
|
||||
});
|
||||
|
||||
FButton clearSelectionButton = new FButton("Clear Selection");
|
||||
FButton clearSelectionButton = new FButton(Localizer.getInstance().getMessage("lblClearSelection"));
|
||||
clearSelectionButton.addActionListener(actionEvent -> {
|
||||
for (FCheckBox coreSet : coreSets) {
|
||||
coreSet.setSelected(false);
|
||||
@@ -228,13 +229,13 @@ public class DialogChooseSets {
|
||||
panel.repaintSelf();
|
||||
});
|
||||
|
||||
FButton showOptionsButton = new FButton("Show Options");
|
||||
FButton showOptionsButton = new FButton(Localizer.getInstance().getMessage("lblShowOptions"));
|
||||
showOptionsButton.addActionListener(actionEvent -> {
|
||||
optionsPanel.setVisible(true);
|
||||
showOptionsButton.setVisible(false);
|
||||
});
|
||||
|
||||
FButton hideOptionsButton = new FButton("Hide Options");
|
||||
FButton hideOptionsButton = new FButton(Localizer.getInstance().getMessage("lblHideOptions"));
|
||||
hideOptionsButton.addActionListener(actionEvent -> {
|
||||
optionsPanel.setVisible(false);
|
||||
showOptionsButton.setVisible(true);
|
||||
@@ -254,12 +255,12 @@ public class DialogChooseSets {
|
||||
|
||||
optionsPanel.add(new JSeparator(SwingConstants.HORIZONTAL), "w 100%, span 2, growx");
|
||||
|
||||
panel.add(new FLabel.Builder().text("Choose sets").fontSize(20).build(), "center, span, wrap, gaptop 10");
|
||||
panel.add(new FLabel.Builder().text(Localizer.getInstance().getMessage("lblChooseSets")).fontSize(20).build(), "center, span, wrap, gaptop 10");
|
||||
|
||||
String constraints = "aligny top";
|
||||
panel.add(makeCheckBoxList(coreSets, "Core sets", true), constraints);
|
||||
panel.add(makeCheckBoxList(expansionSets, "Expansions", false), constraints);
|
||||
panel.add(makeCheckBoxList(otherSets, "Other sets", false), constraints);
|
||||
panel.add(makeCheckBoxList(coreSets, Localizer.getInstance().getMessage("lblCoreSets"), true), constraints);
|
||||
panel.add(makeCheckBoxList(expansionSets, Localizer.getInstance().getMessage("lblExpansions"), false), constraints);
|
||||
panel.add(makeCheckBoxList(otherSets, Localizer.getInstance().getMessage("lblOtherSets"), false), constraints);
|
||||
panel.add(showOptionsButton, "center, w 230!, h 30!, gap 10 0 20 0, span 3, hidemode 3");
|
||||
panel.add(optionsPanel, "center, w 100, span 3, growx, hidemode 3");
|
||||
|
||||
@@ -273,7 +274,7 @@ public class DialogChooseSets {
|
||||
}
|
||||
};
|
||||
|
||||
FButton btnOk = new FButton("OK");
|
||||
FButton btnOk = new FButton(Localizer.getInstance().getMessage("lblOK"));
|
||||
btnOk.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent arg0) {
|
||||
@@ -282,7 +283,7 @@ public class DialogChooseSets {
|
||||
}
|
||||
});
|
||||
|
||||
FButton btnCancel = new FButton("Cancel");
|
||||
FButton btnCancel = new FButton(Localizer.getInstance().getMessage("lblCancel"));
|
||||
btnCancel.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
||||
@@ -77,7 +77,7 @@ public enum VSubmenuSealed implements IVSubmenu<CSubmenuSealed> {
|
||||
|
||||
private final FLabel btnDirections = new FLabel.Builder()
|
||||
.fontSize(16).opaque(true).hoverable(true)
|
||||
.text("How To Play").fontAlign(SwingConstants.CENTER).build();
|
||||
.text(localizer.getMessage("lblHowtoPlay")).fontAlign(SwingConstants.CENTER).build();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
@@ -181,15 +181,7 @@ public enum VSubmenuSealed implements IVSubmenu<CSubmenuSealed> {
|
||||
final JPanel overlay = SOverlayUtils.genericOverlay();
|
||||
final int w = overlay.getWidth();
|
||||
|
||||
final String instructions = "SEALED DECK MODE INSTRUCTIONS"
|
||||
+ "\r\n\r\n"
|
||||
+ "In Sealed Deck tournaments, each player receives six booster packs"
|
||||
+ "from which to build their deck."
|
||||
+ "\r\n\r\n"
|
||||
+ "Depending on which sets are to be used in a sealed deck event, "
|
||||
+ "the distribution of packs can vary greatly."
|
||||
+ "\r\n\r\n"
|
||||
+ "Credit: Wikipedia";
|
||||
final String instructions = localizer.getMessage("lblSealedModeInstruction");
|
||||
|
||||
// Init directions text pane
|
||||
final SkinnedTextPane tpnDirections = new SkinnedTextPane();
|
||||
@@ -207,7 +199,7 @@ public enum VSubmenuSealed implements IVSubmenu<CSubmenuSealed> {
|
||||
StyleConstants.setAlignment(center, StyleConstants.ALIGN_CENTER);
|
||||
doc.setParagraphAttributes(0, doc.getLength(), center, false);
|
||||
|
||||
final JButton btnCloseBig = new FButton("OK");
|
||||
final JButton btnCloseBig = new FButton(localizer.getMessage("lblOK"));
|
||||
btnCloseBig.setBounds(new Rectangle((w / 2 - 100), 510, 200, 30));
|
||||
btnCloseBig.addActionListener(new ActionListener() { @Override
|
||||
public void actionPerformed(final ActionEvent arg0) { SOverlayUtils.hideOverlay(); } });
|
||||
|
||||
@@ -186,7 +186,7 @@ public enum VSubmenuDownloaders implements IVSubmenu<CSubmenuDownloaders> {
|
||||
p.setOpaque(false);
|
||||
p.setBackgroundTexture(FSkin.getIcon(FSkinProp.BG_TEXTURE));
|
||||
|
||||
final FButton btnClose = new FButton("OK");
|
||||
final FButton btnClose = new FButton(localizer.getMessage("lblOK"));
|
||||
btnClose.addActionListener(new ActionListener() { @Override
|
||||
public void actionPerformed(final ActionEvent arg0) { SOverlayUtils.hideOverlay(); } });
|
||||
|
||||
|
||||
@@ -126,6 +126,7 @@ import forge.util.ITriggerEvent;
|
||||
import forge.util.collect.FCollection;
|
||||
import forge.util.collect.FCollectionView;
|
||||
import forge.util.gui.SOptionPane;
|
||||
import forge.util.Localizer;
|
||||
import forge.view.FView;
|
||||
import forge.view.arcane.CardPanel;
|
||||
import forge.view.arcane.FloatingZone;
|
||||
@@ -460,53 +461,53 @@ public final class CMatchUI
|
||||
public Iterable<PlayerZoneUpdate> tempShowZones(final PlayerView controller, final Iterable<PlayerZoneUpdate> zonesToUpdate) {
|
||||
for (final PlayerZoneUpdate update : zonesToUpdate) {
|
||||
final PlayerView player = update.getPlayer();
|
||||
for (final ZoneType zone : update.getZones()) {
|
||||
switch (zone) {
|
||||
case Battlefield: // always shown
|
||||
break;
|
||||
case Hand: // controller hand always shown
|
||||
if (controller != player) {
|
||||
FloatingZone.show(this,player,zone);
|
||||
}
|
||||
break;
|
||||
case Library:
|
||||
case Graveyard:
|
||||
case Exile:
|
||||
case Flashback:
|
||||
case Command:
|
||||
FloatingZone.show(this,player,zone);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return zonesToUpdate; //pfps should return only the newly shown zones
|
||||
for (final ZoneType zone : update.getZones()) {
|
||||
switch (zone) {
|
||||
case Battlefield: // always shown
|
||||
break;
|
||||
case Hand: // controller hand always shown
|
||||
if (controller != player) {
|
||||
FloatingZone.show(this,player,zone);
|
||||
}
|
||||
break;
|
||||
case Library:
|
||||
case Graveyard:
|
||||
case Exile:
|
||||
case Flashback:
|
||||
case Command:
|
||||
FloatingZone.show(this,player,zone);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return zonesToUpdate; //pfps should return only the newly shown zones
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hideZones(final PlayerView controller, final Iterable<PlayerZoneUpdate> zonesToUpdate) {
|
||||
if ( zonesToUpdate != null ) {
|
||||
for (final PlayerZoneUpdate update : zonesToUpdate) {
|
||||
final PlayerView player = update.getPlayer();
|
||||
for (final ZoneType zone : update.getZones()) {
|
||||
switch (zone) {
|
||||
case Battlefield: // always shown
|
||||
break;
|
||||
case Hand: // the controller's hand should never be temporarily shown, but ...
|
||||
case Library:
|
||||
case Graveyard:
|
||||
case Exile:
|
||||
case Flashback:
|
||||
case Command:
|
||||
FloatingZone.hide(this,player,zone);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( zonesToUpdate != null ) {
|
||||
for (final PlayerZoneUpdate update : zonesToUpdate) {
|
||||
final PlayerView player = update.getPlayer();
|
||||
for (final ZoneType zone : update.getZones()) {
|
||||
switch (zone) {
|
||||
case Battlefield: // always shown
|
||||
break;
|
||||
case Hand: // the controller's hand should never be temporarily shown, but ...
|
||||
case Library:
|
||||
case Graveyard:
|
||||
case Exile:
|
||||
case Flashback:
|
||||
case Command:
|
||||
FloatingZone.hide(this,player,zone);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Player's mana pool changes
|
||||
@@ -550,7 +551,7 @@ public final class CMatchUI
|
||||
}
|
||||
break;
|
||||
default:
|
||||
FloatingZone.refresh(c.getController(),zone); // in case the card is visible in the zone
|
||||
FloatingZone.refresh(c.getController(),zone); // in case the card is visible in the zone
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -561,18 +562,18 @@ public final class CMatchUI
|
||||
super.setSelectables(cards);
|
||||
// update zones on tabletop and floating zones - non-selectable cards may be rendered differently
|
||||
FThreads.invokeInEdtNowOrLater(new Runnable() {
|
||||
@Override public final void run() {
|
||||
for (final PlayerView p : getGameView().getPlayers()) {
|
||||
if ( p.getCards(ZoneType.Battlefield) != null ) {
|
||||
updateCards(p.getCards(ZoneType.Battlefield));
|
||||
}
|
||||
if ( p.getCards(ZoneType.Hand) != null ) {
|
||||
updateCards(p.getCards(ZoneType.Hand));
|
||||
}
|
||||
}
|
||||
FloatingZone.refreshAll();
|
||||
}
|
||||
});
|
||||
@Override public final void run() {
|
||||
for (final PlayerView p : getGameView().getPlayers()) {
|
||||
if ( p.getCards(ZoneType.Battlefield) != null ) {
|
||||
updateCards(p.getCards(ZoneType.Battlefield));
|
||||
}
|
||||
if ( p.getCards(ZoneType.Hand) != null ) {
|
||||
updateCards(p.getCards(ZoneType.Hand));
|
||||
}
|
||||
}
|
||||
FloatingZone.refreshAll();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -580,18 +581,18 @@ public final class CMatchUI
|
||||
super.clearSelectables();
|
||||
// update zones on tabletop and floating zones - non-selectable cards may be rendered differently
|
||||
FThreads.invokeInEdtNowOrLater(new Runnable() {
|
||||
@Override public final void run() {
|
||||
for (final PlayerView p : getGameView().getPlayers()) {
|
||||
if ( p.getCards(ZoneType.Battlefield) != null ) {
|
||||
updateCards(p.getCards(ZoneType.Battlefield));
|
||||
}
|
||||
if ( p.getCards(ZoneType.Hand) != null ) {
|
||||
updateCards(p.getCards(ZoneType.Hand));
|
||||
}
|
||||
}
|
||||
FloatingZone.refreshAll();
|
||||
}
|
||||
});
|
||||
@Override public final void run() {
|
||||
for (final PlayerView p : getGameView().getPlayers()) {
|
||||
if ( p.getCards(ZoneType.Battlefield) != null ) {
|
||||
updateCards(p.getCards(ZoneType.Battlefield));
|
||||
}
|
||||
if ( p.getCards(ZoneType.Hand) != null ) {
|
||||
updateCards(p.getCards(ZoneType.Hand));
|
||||
}
|
||||
}
|
||||
FloatingZone.refreshAll();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -857,7 +858,7 @@ public final class CMatchUI
|
||||
if (abilities.size() == 1) {
|
||||
return abilities.get(0);
|
||||
}
|
||||
return GuiChoose.oneOrNone("Choose ability to play", abilities);
|
||||
return GuiChoose.oneOrNone(Localizer.getInstance().getMessage("lblChooseAbilityToPlay"), abilities);
|
||||
}
|
||||
|
||||
if (abilities.isEmpty()) {
|
||||
@@ -871,7 +872,7 @@ public final class CMatchUI
|
||||
}
|
||||
|
||||
//show menu if mouse was trigger for ability
|
||||
final JPopupMenu menu = new JPopupMenu("Abilities");
|
||||
final JPopupMenu menu = new JPopupMenu(Localizer.getInstance().getMessage("lblAbilities"));
|
||||
|
||||
boolean enabled;
|
||||
int firstEnabled = -1;
|
||||
@@ -1071,7 +1072,7 @@ public final class CMatchUI
|
||||
if (delayedReveal != null) {
|
||||
reveal(delayedReveal.getMessagePrefix(), delayedReveal.getCards()); //TODO: Merge this into search dialog
|
||||
}
|
||||
return (List<GameEntityView>) order(title,"Selected", optionList.size() - max, optionList.size() - min, optionList, null, null, false);
|
||||
return (List<GameEntityView>) order(title,Localizer.getInstance().getMessage("lblSelected"), optionList.size() - max, optionList.size() - min, optionList, null, null, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1256,7 +1257,7 @@ public final class CMatchUI
|
||||
numSmallImages++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If current effect is a triggered ability, I want to show the triggering card if present
|
||||
SpellAbility sourceSA = (SpellAbility) si.getTriggeringObject(AbilityKey.SourceSA);
|
||||
@@ -1281,7 +1282,7 @@ public final class CMatchUI
|
||||
addSmallImageToStackModalPanel(gev, mainPanel, numSmallImages);
|
||||
}
|
||||
|
||||
FOptionPane.showOptionDialog(null, "Forge", null, mainPanel, ImmutableList.of("OK"));
|
||||
FOptionPane.showOptionDialog(null, "Forge", null, mainPanel, ImmutableList.of(Localizer.getInstance().getMessage("lblOK")));
|
||||
// here the user closed the modal - time to update the next notifiable stack index
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import forge.toolbox.FList;
|
||||
import forge.toolbox.FOptionPane;
|
||||
import forge.toolbox.FScrollPane;
|
||||
import forge.view.FDialog;
|
||||
import forge.util.Localizer;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class VAutoYields extends FDialog {
|
||||
@@ -32,7 +33,7 @@ public class VAutoYields extends FDialog {
|
||||
|
||||
public VAutoYields(final CMatchUI matchUI) {
|
||||
super();
|
||||
setTitle("Auto-Yields");
|
||||
setTitle(Localizer.getInstance().getMessage("lblAutoYields"));
|
||||
|
||||
autoYields = new ArrayList<>();
|
||||
for (final String autoYield : matchUI.getAutoYields()) {
|
||||
@@ -47,7 +48,7 @@ public class VAutoYields extends FDialog {
|
||||
|
||||
listScroller = new FScrollPane(lstAutoYields, true);
|
||||
|
||||
chkDisableAll = new FCheckBox("Disable All Auto Yields", matchUI.getDisableAutoYields());
|
||||
chkDisableAll = new FCheckBox(Localizer.getInstance().getMessage("lblDisableAllAutoYields"), matchUI.getDisableAutoYields());
|
||||
chkDisableAll.addChangeListener(new ChangeListener() {
|
||||
@Override
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
@@ -55,14 +56,14 @@ public class VAutoYields extends FDialog {
|
||||
}
|
||||
});
|
||||
|
||||
btnOk = new FButton("OK");
|
||||
btnOk = new FButton(Localizer.getInstance().getMessage("lblOK"));
|
||||
btnOk.setCommand(new UiCommand() {
|
||||
@Override
|
||||
public void run() {
|
||||
setVisible(false);
|
||||
}
|
||||
});
|
||||
btnRemove = new FButton("Remove Yield");
|
||||
btnRemove = new FButton(Localizer.getInstance().getMessage("lblRemoveYield"));
|
||||
btnRemove.setCommand(new UiCommand() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -115,7 +116,7 @@ public class VAutoYields extends FDialog {
|
||||
setVisible(true);
|
||||
dispose();
|
||||
} else {
|
||||
FOptionPane.showMessageDialog("There are no active auto-yields.", "No Auto-Yields", FOptionPane.INFORMATION_ICON);
|
||||
FOptionPane.showMessageDialog(Localizer.getInstance().getMessage("lblNoActiveAutoYield"), Localizer.getInstance().getMessage("lblNoAutoYield"), FOptionPane.INFORMATION_ICON);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.google.common.collect.ImmutableList;
|
||||
import forge.assets.FSkinProp;
|
||||
import forge.toolbox.FSkin.SkinImage;
|
||||
import forge.view.FDialog;
|
||||
import forge.util.Localizer;
|
||||
|
||||
/**
|
||||
* Class to replace JOptionPane using skinned dialogs
|
||||
@@ -49,7 +50,7 @@ public class FOptionPane extends FDialog {
|
||||
}
|
||||
|
||||
public static void showMessageDialog(final String message, final String title, final SkinImage icon) {
|
||||
showOptionDialog(message, title, icon, ImmutableList.of("OK"), 0);
|
||||
showOptionDialog(message, title, icon, ImmutableList.of(Localizer.getInstance().getMessage("lblOK")), 0);
|
||||
}
|
||||
|
||||
public static boolean showConfirmDialog(final String message) {
|
||||
@@ -57,11 +58,11 @@ public class FOptionPane extends FDialog {
|
||||
}
|
||||
|
||||
public static boolean showConfirmDialog(final String message, final String title) {
|
||||
return showConfirmDialog(message, title, "Yes", "No", true);
|
||||
return showConfirmDialog(message, title, Localizer.getInstance().getMessage("lblYes"), Localizer.getInstance().getMessage("lblNo"), true);
|
||||
}
|
||||
|
||||
public static boolean showConfirmDialog(final String message, final String title, final boolean defaultYes) {
|
||||
return showConfirmDialog(message, title, "Yes", "No", defaultYes);
|
||||
return showConfirmDialog(message, title, Localizer.getInstance().getMessage("lblYes"), Localizer.getInstance().getMessage("lblNo"), defaultYes);
|
||||
}
|
||||
|
||||
public static boolean showConfirmDialog(final String message, final String title, final String yesButtonText, final String noButtonText) {
|
||||
@@ -124,7 +125,7 @@ public class FOptionPane extends FDialog {
|
||||
inputField = cbInput;
|
||||
}
|
||||
|
||||
final FOptionPane optionPane = new FOptionPane(message, title, icon, inputField, ImmutableList.of("OK", "Cancel"), -1);
|
||||
final FOptionPane optionPane = new FOptionPane(message, title, icon, inputField, ImmutableList.of(Localizer.getInstance().getMessage("lblOK"), Localizer.getInstance().getMessage("lblCancel")), -1);
|
||||
optionPane.setDefaultFocus(inputField);
|
||||
inputField.addKeyListener(new KeyAdapter() { //hook so pressing Enter on field accepts dialog
|
||||
@Override
|
||||
|
||||
@@ -27,14 +27,14 @@ public class GameEntityPicker extends TabPageScreen<GameEntityPicker> {
|
||||
|
||||
public GameEntityPicker(String title, Collection<? extends GameEntityView> choiceList, Collection<CardView> revealList, String revealListCaption, FImage revealListImage, boolean isOptional, final Callback<GameEntityView> callback) {
|
||||
super(new PickerTab[] {
|
||||
new PickerTab(choiceList, "Choices", FSkinImage.DECKLIST, 1),
|
||||
new PickerTab(choiceList, Localizer.getInstance().getMessage("Choices"), FSkinImage.DECKLIST, 1),
|
||||
new PickerTab(revealList, revealListCaption, revealListImage, 0)
|
||||
}, false);
|
||||
|
||||
setHeight(FOptionPane.getMaxDisplayObjHeight());
|
||||
|
||||
optionPane = new FOptionPane(null, null, title, null, this,
|
||||
isOptional ? ImmutableList.of("OK", "Cancel") : ImmutableList.of("OK"), 0, new Callback<Integer>() {
|
||||
isOptional ? ImmutableList.of(Localizer.getInstance().getMessage("lblOK"), Localizer.getInstance().getMessage("lblCancel")) : ImmutableList.of(Localizer.getInstance().getMessage("lblOK")), 0, new Callback<Integer>() {
|
||||
@Override
|
||||
public void run(Integer result) {
|
||||
if (result == 0) {
|
||||
|
||||
@@ -11,13 +11,14 @@ import forge.toolbox.FEvent;
|
||||
import forge.toolbox.FEvent.FEventHandler;
|
||||
import forge.toolbox.FOptionPane;
|
||||
import forge.util.TextBounds;
|
||||
import forge.util.Localizer;
|
||||
|
||||
public class VAutoYields extends FDialog {
|
||||
private final FChoiceList<String> lstAutoYields;
|
||||
private final FCheckBox chkDisableAll;
|
||||
|
||||
public VAutoYields() {
|
||||
super("Auto-Yields", 2);
|
||||
super(Localizer.getInstance().getMessage("lblAutoYields"), 2);
|
||||
List<String> autoYields = new ArrayList<>();
|
||||
for (String autoYield : MatchController.instance.getAutoYields()) {
|
||||
autoYields.add(autoYield);
|
||||
@@ -33,20 +34,20 @@ public class VAutoYields extends FDialog {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
chkDisableAll = add(new FCheckBox("Disable All Auto Yields", MatchController.instance.getDisableAutoYields()));
|
||||
chkDisableAll = add(new FCheckBox(Localizer.getInstance().getMessage("lblDisableAllAutoYields"), MatchController.instance.getDisableAutoYields()));
|
||||
chkDisableAll.setCommand(new FEventHandler() {
|
||||
@Override
|
||||
public void handleEvent(FEvent e) {
|
||||
MatchController.instance.setDisableAutoYields(chkDisableAll.isSelected());
|
||||
}
|
||||
});
|
||||
initButton(0, "OK", new FEventHandler() {
|
||||
initButton(0, Localizer.getInstance().getMessage("lblOK"), new FEventHandler() {
|
||||
@Override
|
||||
public void handleEvent(FEvent e) {
|
||||
hide();
|
||||
}
|
||||
});
|
||||
initButton(1, "Remove Yield", new FEventHandler() {
|
||||
initButton(1, Localizer.getInstance().getMessage("lblRemoveYield"), new FEventHandler() {
|
||||
@Override
|
||||
public void handleEvent(FEvent e) {
|
||||
String selected = lstAutoYields.getSelectedItem();
|
||||
@@ -68,7 +69,7 @@ public class VAutoYields extends FDialog {
|
||||
super.show();
|
||||
}
|
||||
else {
|
||||
FOptionPane.showMessageDialog("There are no active auto-yields.", "No Auto-Yields", FOptionPane.INFORMATION_ICON);
|
||||
FOptionPane.showMessageDialog(Localizer.getInstance().getMessage("lblNoActiveAutoYield"), Localizer.getInstance().getMessage("lblNoAutoYield"), FOptionPane.INFORMATION_ICON);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import forge.toolbox.FEvent.FEventHandler;
|
||||
import forge.toolbox.FLabel;
|
||||
import forge.toolbox.FScrollPane;
|
||||
import forge.util.Utils;
|
||||
import forge.util.Localizer;
|
||||
|
||||
public class ConquestRewardDialog extends FScrollPane {
|
||||
private static final float PADDING = Utils.scale(5);
|
||||
@@ -177,7 +178,7 @@ public class ConquestRewardDialog extends FScrollPane {
|
||||
|
||||
add(ConquestRewardDialog.this);
|
||||
|
||||
initButton(0, "OK", new FEventHandler() {
|
||||
initButton(0, Localizer.getInstance().getMessage("lblOK"), new FEventHandler() {
|
||||
@Override
|
||||
public void handleEvent(FEvent e) {
|
||||
hide();
|
||||
@@ -186,7 +187,7 @@ public class ConquestRewardDialog extends FScrollPane {
|
||||
}
|
||||
}
|
||||
});
|
||||
initButton(1, "Skip", new FEventHandler() {
|
||||
initButton(1, Localizer.getInstance().getMessage("lblSkip"), new FEventHandler() {
|
||||
@Override
|
||||
public void handleEvent(FEvent e) {
|
||||
animation.skip();
|
||||
|
||||
@@ -191,7 +191,7 @@ public class FOptionPane extends FDialog {
|
||||
container.add(inputField);
|
||||
container.setHeight(inputField.getHeight() + padTop + PADDING);
|
||||
|
||||
final FOptionPane optionPane = new FOptionPane(message, null, title, null, container, ImmutableList.of("OK", "Cancel"), 0, new Callback<Integer>() {
|
||||
final FOptionPane optionPane = new FOptionPane(message, null, title, null, container, ImmutableList.of(Localizer.getInstance().getMessage("lblOK"), Localizer.getInstance().getMessage("lblCancel")), 0, new Callback<Integer>() {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void run(final Integer result) {
|
||||
|
||||
@@ -20,6 +20,7 @@ import forge.quest.QuestEventDuel;
|
||||
import forge.quest.QuestEventDuelManager;
|
||||
import forge.quest.QuestWorld;
|
||||
import forge.util.Aggregates;
|
||||
import forge.util.Localizer;
|
||||
|
||||
public class ConquestChaosBattle extends ConquestBattle {
|
||||
private final QuestWorld world;
|
||||
@@ -122,20 +123,20 @@ public class ConquestChaosBattle extends ConquestBattle {
|
||||
if (game.isMatchOver()) {
|
||||
view.getBtnContinue().setVisible(false);
|
||||
if (game.isMatchWonBy(humanPlayer)) {
|
||||
view.getBtnQuit().setText("Great!");
|
||||
view.getBtnQuit().setText(Localizer.getInstance().getMessage("lblGreat") + "!");
|
||||
model.getChaosBattleRecord().addWin();
|
||||
setConquered(true);
|
||||
}
|
||||
else {
|
||||
view.getBtnQuit().setText("OK");
|
||||
view.getBtnQuit().setText(Localizer.getInstance().getMessage("lblOK"));
|
||||
model.getChaosBattleRecord().addLoss();
|
||||
}
|
||||
model.saveData();
|
||||
}
|
||||
else {
|
||||
view.getBtnContinue().setVisible(true);
|
||||
view.getBtnContinue().setText("Continue");
|
||||
view.getBtnQuit().setText("Quit");
|
||||
view.getBtnContinue().setText(Localizer.getInstance().getMessage("btnContinue"));
|
||||
view.getBtnQuit().setText(Localizer.getInstance().getMessage("btnQuit"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,8 @@ import forge.util.FileUtil;
|
||||
import forge.util.XmlReader;
|
||||
import forge.util.XmlWriter;
|
||||
import forge.util.gui.SOptionPane;
|
||||
import forge.util.Localizer;
|
||||
import forge.util.CardTranslation;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
@@ -265,15 +267,15 @@ public final class ConquestData {
|
||||
int count = cards.size();
|
||||
if (count == 0) { return false; }
|
||||
|
||||
String title = count == 1 ? "Exile Card" : "Exile " + count + " Cards";
|
||||
String cardStr = (count == 1 ? "card" : "cards");
|
||||
String title = count == 1 ? Localizer.getInstance().getMessage("lblExileCard") : Localizer.getInstance().getMessage("lblExileNCard", String.valueOf(count));
|
||||
String cardStr = (count == 1 ? Localizer.getInstance().getMessage("lblCard") : Localizer.getInstance().getMessage("lblCards"));
|
||||
|
||||
List<ConquestCommander> commandersBeingExiled = null;
|
||||
|
||||
StringBuilder message = new StringBuilder("Exile the following " + cardStr + " to receive {AE}" + value + "?\n");
|
||||
StringBuilder message = new StringBuilder(Localizer.getInstance().getMessage("lblExileFollowCardsToReceiveNAE", cardStr, "{AE}", String.valueOf(value)));
|
||||
for (PaperCard card : cards) {
|
||||
if (planeswalker == card) {
|
||||
SOptionPane.showMessageDialog("Current planeswalker cannot be exiled.", title, SOptionPane.INFORMATION_ICON);
|
||||
SOptionPane.showMessageDialog(Localizer.getInstance().getMessage("lblCurrentPlaneswalkerCannotBeExiled"), title, SOptionPane.INFORMATION_ICON);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -281,7 +283,7 @@ public final class ConquestData {
|
||||
for (ConquestCommander commander : commanders) {
|
||||
if (commander.getCard() == card) {
|
||||
if (!commander.getDeck().getMain().isEmpty()) {
|
||||
SOptionPane.showMessageDialog("Cannot exile a commander with a defined deck.", title, SOptionPane.INFORMATION_ICON);
|
||||
SOptionPane.showMessageDialog(Localizer.getInstance().getMessage("lblCannotCommanderWithDefinedDeck"), title, SOptionPane.INFORMATION_ICON);
|
||||
return false;
|
||||
}
|
||||
if (commandersBeingExiled == null) {
|
||||
@@ -290,19 +292,19 @@ public final class ConquestData {
|
||||
commandersBeingExiled.add(commander); //cache commander to make it easier to remove later
|
||||
}
|
||||
if (commander.getDeck().getMain().contains(card)) {
|
||||
commandersUsingCard.append("\n").append(commander.getName());
|
||||
commandersUsingCard.append("\n").append(CardTranslation.getTranslatedName(commander.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
if (commandersUsingCard.length() > 0) {
|
||||
SOptionPane.showMessageDialog(card.getName() + " is in use by the following commanders and cannot be exiled:\n" + commandersUsingCard, title, SOptionPane.INFORMATION_ICON);
|
||||
SOptionPane.showMessageDialog(Localizer.getInstance().getMessage("lblCommandersCardCannotBeExiledByCard", CardTranslation.getTranslatedName(card.getName()), commandersUsingCard), title, SOptionPane.INFORMATION_ICON);
|
||||
return false;
|
||||
}
|
||||
|
||||
message.append("\n").append(card.getName());
|
||||
message.append("\n").append(CardTranslation.getTranslatedName(card.getName()));
|
||||
}
|
||||
|
||||
if (SOptionPane.showConfirmDialog(message.toString(), title, "OK", "Cancel")) {
|
||||
if (SOptionPane.showConfirmDialog(message.toString(), title, Localizer.getInstance().getMessage("lblOK"), Localizer.getInstance().getMessage("lblCancel"))) {
|
||||
if (exiledCards.addAll(cards)) {
|
||||
if (commandersBeingExiled != null) {
|
||||
commanders.removeAll(commandersBeingExiled);
|
||||
@@ -319,18 +321,18 @@ public final class ConquestData {
|
||||
int count = cards.size();
|
||||
if (count == 0) { return false; }
|
||||
|
||||
String title = count == 1 ? "Retrieve Card" : "Retrieve " + count + " Cards";
|
||||
String cardStr = (count == 1 ? "card" : "cards");
|
||||
String title = count == 1 ? Localizer.getInstance().getMessage("lblRetrieveCard") : Localizer.getInstance().getMessage("lblRetrieveNCard", String.valueOf(count));
|
||||
String cardStr = (count == 1 ? Localizer.getInstance().getMessage("lblCard") : Localizer.getInstance().getMessage("lblCards"));
|
||||
if (aetherShards < cost) {
|
||||
SOptionPane.showMessageDialog("Not enough shards to retrieve " + cardStr + ".", title, SOptionPane.INFORMATION_ICON);
|
||||
SOptionPane.showMessageDialog(Localizer.getInstance().getMessage("lblNotEnoughShardsToRetrieveCards", cardStr), title, SOptionPane.INFORMATION_ICON);
|
||||
return false;
|
||||
}
|
||||
|
||||
StringBuilder message = new StringBuilder("Spend {AE}" + cost + " to retrieve the following " + cardStr + " from exile?\n");
|
||||
StringBuilder message = new StringBuilder(Localizer.getInstance().getMessage("lblSpendAECostToRetrieveCardsFromExile", "{AE}", String.valueOf(cost), cardStr));
|
||||
for (PaperCard card : cards) {
|
||||
message.append("\n").append(card.getName());
|
||||
}
|
||||
if (SOptionPane.showConfirmDialog(message.toString(), title, "OK", "Cancel")) {
|
||||
if (SOptionPane.showConfirmDialog(message.toString(), title, Localizer.getInstance().getMessage("lblOK"), Localizer.getInstance().getMessage("lblCancel"))) {
|
||||
if (exiledCards.removeAll(cards)) {
|
||||
for (PaperCard card : cards) {
|
||||
if (card.getRules().canBeCommander()) { //add back commander for card if needed
|
||||
@@ -492,14 +494,14 @@ public final class ConquestData {
|
||||
commanderCount = commanders.size();
|
||||
}
|
||||
|
||||
view.getLblAEtherShards().setText("Aether Shards: " + aetherShards);
|
||||
view.getLblPlaneswalkEmblems().setText("Planeswalk Emblems: " + planeswalkEmblems);
|
||||
view.getLblTotalWins().setText("Total Wins: " + wins);
|
||||
view.getLblTotalLosses().setText("Total Losses: " + losses);
|
||||
view.getLblConqueredEvents().setText("Conquered Events: " + formatRatio(conqueredCount, totalEventCount));
|
||||
view.getLblUnlockedCards().setText("Unlocked Cards: " + formatRatio(unlockedCardCount, totalCardCount));
|
||||
view.getLblCommanders().setText("Commanders: " + formatRatio(commanderCount, totalCommanderCount));
|
||||
view.getLblPlaneswalkers().setText("Planeswalkers: " + formatRatio(planeswalkerCount, totalPlaneswalkerCount));
|
||||
view.getLblAEtherShards().setText(Localizer.getInstance().getMessage("lblAetherShards") + ": " + aetherShards);
|
||||
view.getLblPlaneswalkEmblems().setText(Localizer.getInstance().getMessage("lblPlaneswalkEmblems") + ": " + planeswalkEmblems);
|
||||
view.getLblTotalWins().setText(Localizer.getInstance().getMessage("lblTotalWins") + ": " + wins);
|
||||
view.getLblTotalLosses().setText(Localizer.getInstance().getMessage("lblTotalLosses") + ": " + losses);
|
||||
view.getLblConqueredEvents().setText(Localizer.getInstance().getMessage("lblConqueredEvents") + ": " + formatRatio(conqueredCount, totalEventCount));
|
||||
view.getLblUnlockedCards().setText(Localizer.getInstance().getMessage("lblUnlockedCards") + ": " + formatRatio(unlockedCardCount, totalCardCount));
|
||||
view.getLblCommanders().setText(Localizer.getInstance().getMessage("lblCommanders") + ": " + formatRatio(commanderCount, totalCommanderCount));
|
||||
view.getLblPlaneswalkers().setText(Localizer.getInstance().getMessage("lblPlaneswalkers") + ": " + formatRatio(planeswalkerCount, totalPlaneswalkerCount));
|
||||
}
|
||||
|
||||
private String formatRatio(int numerator, int denominator) {
|
||||
|
||||
@@ -25,6 +25,7 @@ import forge.quest.data.QuestPreferences.DifficultyPrefs;
|
||||
import forge.quest.data.QuestPreferences.QPref;
|
||||
import forge.util.MyRandom;
|
||||
import forge.util.TextUtil;
|
||||
import forge.util.Localizer;
|
||||
import forge.util.gui.SGuiChoose;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
@@ -72,15 +73,15 @@ public class QuestWinLoseController {
|
||||
|
||||
final boolean matchIsNotOver = !lastGame.isMatchOver();
|
||||
if (matchIsNotOver) {
|
||||
view.getBtnQuit().setText("Quit (-15 Credits)");
|
||||
view.getBtnQuit().setText(Localizer.getInstance().getMessage("lblQuitByPayCredits"));
|
||||
}
|
||||
else {
|
||||
view.getBtnContinue().setVisible(false);
|
||||
if (wonMatch) {
|
||||
view.getBtnQuit().setText("Great!");
|
||||
view.getBtnQuit().setText(Localizer.getInstance().getMessage("lblGreat") + "!");
|
||||
}
|
||||
else {
|
||||
view.getBtnQuit().setText("OK");
|
||||
view.getBtnQuit().setText(Localizer.getInstance().getMessage("lblOK"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,10 +161,10 @@ public class QuestWinLoseController {
|
||||
private void anteReport(final List<PaperCard> cardsWon, final List<PaperCard> cardsLost) {
|
||||
// Generate Swing components and attach.
|
||||
if (cardsWon != null && !cardsWon.isEmpty()) {
|
||||
view.showCards("Spoils! Cards won from ante", cardsWon);
|
||||
view.showCards(Localizer.getInstance().getMessage("lblSpoilsWonAnteCard"), cardsWon);
|
||||
}
|
||||
if (cardsLost != null && !cardsLost.isEmpty()) {
|
||||
view.showCards("Looted! Cards lost to ante", cardsLost);
|
||||
view.showCards(Localizer.getInstance().getMessage("lblLootedLostAnteCard"), cardsLost);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -385,7 +386,7 @@ public class QuestWinLoseController {
|
||||
sb.append(TextUtil.concatWithSpace(String.valueOf(credTotal), "credits in total."));
|
||||
qData.getAssets().addCredits(credTotal);
|
||||
|
||||
view.showMessage(sb.toString(), "Gameplay Results", FSkinProp.ICO_QUEST_GOLD);
|
||||
view.showMessage(sb.toString(), Localizer.getInstance().getMessage("lblGameplayResults"), FSkinProp.ICO_QUEST_GOLD);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -468,12 +469,12 @@ public class QuestWinLoseController {
|
||||
}
|
||||
|
||||
if (addDraftToken) {
|
||||
view.showMessage("For achieving a 25 win streak, you have been awarded a draft token!\nUse these tokens to generate new tournaments.", "Bonus Draft Token Reward", FSkinProp.ICO_QUEST_COIN);
|
||||
view.showMessage(Localizer.getInstance().getMessage("lblAchieving25WinStreakAwarded"), Localizer.getInstance().getMessage("lblBonusDraftTokenReward"), FSkinProp.ICO_QUEST_COIN);
|
||||
qData.getAchievements().addDraftToken();
|
||||
}
|
||||
|
||||
if (!cardsWon.isEmpty()) {
|
||||
view.showCards("You have achieved a " + (currentStreak == 0 ? "50" : currentStreak) + " win streak and won " + cardsWon.size() + " " + typeWon + " card" + ((cardsWon.size() != 1) ? "s" : "") + "!", cardsWon);
|
||||
view.showCards(Localizer.getInstance().getMessage("lblAchievedNWinStreakWinMCards", (currentStreak == 0 ? "50" : String.valueOf(currentStreak)), String.valueOf(cardsWon.size()), typeWon), cardsWon);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -486,7 +487,7 @@ public class QuestWinLoseController {
|
||||
*/
|
||||
private void awardJackpot() {
|
||||
final List<PaperCard> cardsWon = qData.getCards().addRandomRare(10);
|
||||
view.showCards("You just won 10 random rares!", cardsWon);
|
||||
view.showCards(Localizer.getInstance().getMessage("lblJustWonTenRandomRares"), cardsWon);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -515,13 +516,13 @@ public class QuestWinLoseController {
|
||||
|
||||
Collections.sort(formats);
|
||||
|
||||
final GameFormat selected = SGuiChoose.getChoices("Choose bonus booster format", 1, 1, formats, pref, null).get(0);
|
||||
final GameFormat selected = SGuiChoose.getChoices(Localizer.getInstance().getMessage("lblChooseBonusBoosterFormat"), 1, 1, formats, pref, null).get(0);
|
||||
FModel.getQuestPreferences().setPref(QPref.BOOSTER_FORMAT, selected.toString());
|
||||
|
||||
cardsWon = qData.getCards().generateQuestBooster(selected.getFilterPrinted());
|
||||
qData.getCards().addAllCards(cardsWon);
|
||||
|
||||
title = "Bonus booster pack from the \"" + selected.getName() + "\" format!";
|
||||
title = Localizer.getInstance().getMessage("lblBonusFormatBoosterPack", selected.getName());
|
||||
|
||||
} else {
|
||||
|
||||
@@ -566,7 +567,7 @@ public class QuestWinLoseController {
|
||||
maxChoices--;
|
||||
}
|
||||
|
||||
final CardEdition chooseEd = SGuiChoose.one("Choose bonus booster set", options);
|
||||
final CardEdition chooseEd = SGuiChoose.one(Localizer.getInstance().getMessage("lblChooseBonusBoosterSet"), options);
|
||||
|
||||
if (customBooster) {
|
||||
List<PaperCard> cards = FModel.getMagicDb().getCommonCards().getAllCards(Predicates.printedInSet(chooseEd.getCode()));
|
||||
@@ -578,7 +579,7 @@ public class QuestWinLoseController {
|
||||
}
|
||||
|
||||
qData.getCards().addAllCards(cardsWon);
|
||||
title = "Bonus " + chooseEd.getName() + " Booster Pack!";
|
||||
title = Localizer.getInstance().getMessage("lblBonusSetBoosterPack", chooseEd.getName());
|
||||
|
||||
}
|
||||
|
||||
@@ -606,18 +607,14 @@ public class QuestWinLoseController {
|
||||
private void awardChallengeWin() {
|
||||
final long questRewardCredits = ((QuestEventChallenge) qEvent).getCreditsReward();
|
||||
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append("Challenge completed.\n\n");
|
||||
sb.append("Challenge bounty: ").append(questRewardCredits).append(" credits.");
|
||||
|
||||
String winMessage = ((QuestEventChallenge)qEvent).getWinMessage();
|
||||
if (!winMessage.isEmpty()) {
|
||||
view.showMessage(winMessage.replace("\\n", "\n"), "Congratulations", FSkinProp.ICO_QUEST_NOTES);
|
||||
view.showMessage(winMessage.replace("\\n", "\n"), Localizer.getInstance().getMessage("lblCongratulations"), FSkinProp.ICO_QUEST_NOTES);
|
||||
}
|
||||
|
||||
qData.getAssets().addCredits(questRewardCredits);
|
||||
|
||||
view.showMessage(sb.toString(), "Challenge Rewards for \"" + qEvent.getTitle() + "\"", FSkinProp.ICO_QUEST_BOX);
|
||||
view.showMessage(Localizer.getInstance().getMessage("lblChallengeCompletedBountyIS", String.valueOf(questRewardCredits)), Localizer.getInstance().getMessage("lblChallengeRewardsForEvent", qEvent.getTitle()), FSkinProp.ICO_QUEST_BOX);
|
||||
|
||||
awardSpecialReward(null);
|
||||
}
|
||||
@@ -676,7 +673,7 @@ public class QuestWinLoseController {
|
||||
|
||||
private void penalizeLoss() {
|
||||
final int x = FModel.getQuestPreferences().getPrefInt(QPref.PENALTY_LOSS);
|
||||
view.showMessage("You lose! You have lost " + x + " credits.", "Gameplay Results", FSkinProp.ICO_QUEST_HEART);
|
||||
view.showMessage(Localizer.getInstance().getMessage("lblYouHaveLostNCredits", String.valueOf(x)), Localizer.getInstance().getMessage("lblGameplayResults"), FSkinProp.ICO_QUEST_HEART);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableList;
|
||||
|
||||
import forge.GuiBase;
|
||||
import forge.assets.FSkinProp;
|
||||
import forge.util.Localizer;
|
||||
|
||||
public class SOptionPane {
|
||||
public static final FSkinProp QUESTION_ICON = FSkinProp.ICO_QUESTION;
|
||||
@@ -30,7 +31,7 @@ public class SOptionPane {
|
||||
}
|
||||
|
||||
public static void showMessageDialog(final String message, final String title, final FSkinProp icon) {
|
||||
showOptionDialog(message, title, icon, ImmutableList.of("OK"), 0);
|
||||
showOptionDialog(message, title, icon, ImmutableList.of(Localizer.getInstance().getMessage("lblOK")), 0);
|
||||
}
|
||||
|
||||
public static boolean showConfirmDialog(final String message) {
|
||||
@@ -38,11 +39,11 @@ public class SOptionPane {
|
||||
}
|
||||
|
||||
public static boolean showConfirmDialog(final String message, final String title) {
|
||||
return showConfirmDialog(message, title, "Yes", "No", true);
|
||||
return showConfirmDialog(message, title, Localizer.getInstance().getMessage("lblYes"), Localizer.getInstance().getMessage("lblNo"), true);
|
||||
}
|
||||
|
||||
public static boolean showConfirmDialog(final String message, final String title, final boolean defaultYes) {
|
||||
return showConfirmDialog(message, title, "Yes", "No", defaultYes);
|
||||
return showConfirmDialog(message, title, Localizer.getInstance().getMessage("lblYes"), Localizer.getInstance().getMessage("lblNo"), defaultYes);
|
||||
}
|
||||
|
||||
public static boolean showConfirmDialog(final String message, final String title, final String yesButtonText, final String noButtonText) {
|
||||
|
||||
Reference in New Issue
Block a user