rename UiString to MText.

master
lodici 2016-10-26 09:46:59 +01:00
parent 80f0a840e2
commit 6245037367
145 changed files with 780 additions and 811 deletions

View File

@ -1,6 +1,6 @@
package magic.data;
import magic.translate.UiString;
import magic.translate.MText;
public enum CardLegality {
Legal(CardLegalityStrings._S1),
@ -12,7 +12,7 @@ public enum CardLegality {
private final String description;
private CardLegality(String aString) {
this.description = UiString.get(aString);
this.description = MText.get(aString);
}
public String getDescription() {

View File

@ -10,7 +10,7 @@ import magic.model.MagicCardDefinition;
import magic.model.MagicColor;
import magic.model.MagicManaCost;
import magic.model.MagicRarity;
import magic.translate.UiString;
import magic.translate.MText;
public class CardStatistics {
@ -47,15 +47,13 @@ public class CardStatistics {
);
public static final int MANA_CURVE_SIZE = MANA_CURVE_TEXT.size();
public static final List<String> TYPE_NAMES = Collections.unmodifiableList(
Arrays.asList(
UiString.get(_S1),
UiString.get(_S2),
UiString.get(_S3),
UiString.get(_S4),
UiString.get(_S5),
UiString.get(_S6),
UiString.get(_S7)
public static final List<String> TYPE_NAMES = Collections.unmodifiableList(Arrays.asList(MText.get(_S1),
MText.get(_S2),
MText.get(_S3),
MText.get(_S4),
MText.get(_S5),
MText.get(_S6),
MText.get(_S7)
)
);
public static final int NR_OF_TYPES = TYPE_NAMES.size();

View File

@ -5,7 +5,7 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.EnumSet;
import java.util.Set;
import magic.translate.UiString;
import magic.translate.MText;
/**
* Ways to group decks.
@ -29,7 +29,7 @@ public enum DeckType {
private final String deckTypeCaption;
private DeckType(final String caption) {
this.deckTypeCaption = UiString.get(caption);
this.deckTypeCaption = MText.get(caption);
}
@Override

View File

@ -5,7 +5,7 @@ import java.util.ArrayList;
import java.util.stream.Collectors;
import magic.model.MagicCardDefinition;
import magic.model.MagicDeck;
import magic.translate.UiString;
import magic.translate.MText;
import magic.utility.DeckUtils;
public abstract class MagicFormat {
@ -46,7 +46,7 @@ public abstract class MagicFormat {
public static final MagicFormat ALL = new MagicFormat() {
@Override
public String getName() {
return UiString.get(_S1);
return MText.get(_S1);
}
@Override

View File

@ -5,7 +5,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.EnumSet;
import magic.translate.UiString;
import magic.translate.MText;
public enum MagicColor {
@ -27,7 +27,7 @@ public enum MagicColor {
this.name = name;
this.symbol = symbol;
this.mask = 1 << ordinal();
this.displayName = UiString.get(name);
this.displayName = MText.get(name);
}
/**

View File

@ -1,7 +1,7 @@
package magic.model;
import magic.data.MagicIcon;
import magic.translate.UiString;
import magic.translate.MText;
public enum MagicPlayerZone {
@ -14,7 +14,7 @@ public enum MagicPlayerZone {
private final MagicIcon zoneIcon;
private MagicPlayerZone(final String name, final MagicIcon icon) {
this.zoneName = UiString.get(name);
this.zoneName = MText.get(name);
this.zoneIcon = icon;
}

View File

@ -1,7 +1,7 @@
package magic.model;
import java.util.EnumSet;
import magic.translate.UiString;
import magic.translate.MText;
public enum MagicRarity {
@ -17,7 +17,7 @@ public enum MagicRarity {
private final String displayName;
private MagicRarity(final String aName, final char c) {
this.displayName = UiString.get(aName);
this.displayName = MText.get(aName);
this.c = c;
}

View File

@ -5,7 +5,7 @@ import java.util.EnumSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import magic.translate.UiString;
import magic.translate.MText;
public enum MagicType {
@ -66,7 +66,7 @@ public enum MagicType {
private final String displayName;
private MagicType(final String aName) {
this.displayName = UiString.get(aName);
this.displayName = MText.get(aName);
mask = 1 << ordinal();
}

View File

@ -18,7 +18,7 @@ import java.util.List;
import java.util.Set;
import magic.model.IUIGameController;
import magic.translate.StringContext;
import magic.translate.UiString;
import magic.translate.MText;
public class MagicPlayChoice extends MagicChoice {
@ -30,9 +30,9 @@ public class MagicPlayChoice extends MagicChoice {
private static final String _S_SKIP_MESSAGE = "Right click {f} or Shift+Space to|skip till end of turn.";
private static final String MESSAGE = String.format("%s|%s|[%s]",
UiString.get(_S_PLAY_MESSAGE),
UiString.get(_S_CONTINUE_MESSAGE),
UiString.get(_S_SKIP_MESSAGE)
MText.get(_S_PLAY_MESSAGE),
MText.get(_S_CONTINUE_MESSAGE),
MText.get(_S_SKIP_MESSAGE)
);
private static final MagicChoice INSTANCE=new MagicPlayChoice();
@ -41,7 +41,7 @@ public class MagicPlayChoice extends MagicChoice {
private static final Object[] PASS_CHOICE_RESULTS= {MagicPlayChoiceResult.SKIP};
private MagicPlayChoice() {
super(UiString.get(_S_PLAY_MESSAGE));
super(MText.get(_S_PLAY_MESSAGE));
}
@Override
@ -157,7 +157,7 @@ public class MagicPlayChoice extends MagicChoice {
}
if (validChoices.isEmpty()) {
controller.showMessage(source, UiString.get(_S_CONTINUE_MESSAGE));
controller.showMessage(source, MText.get(_S_CONTINUE_MESSAGE));
} else {
controller.showMessage(source,MESSAGE);
controller.setValidChoices(validChoices,false);

View File

@ -3,7 +3,7 @@ package magic.model.player;
import java.util.Properties;
import magic.ai.MagicAIImpl;
import magic.translate.StringContext;
import magic.translate.UiString;
import magic.translate.MText;
import magic.utility.SortedProperties;
public class AiProfile extends PlayerProfile {
@ -95,16 +95,16 @@ public class AiProfile extends PlayerProfile {
@Override
public String getPlayerTypeLabel() {
return UiString.get(_S1, getAiType());
return MText.get(_S1, getAiType());
}
@Override
public String getPlayerAttributeLabel() {
return UiString.get(_S2, getAiLevel(), getExtraLife());
return MText.get(_S2, getAiLevel(), getExtraLife());
}
@Override
public String getPlayerLabel() {
return UiString.get(_S3, getPlayerName(), getAiLevel(), getAiType().name());
return MText.get(_S3, getPlayerName(), getAiLevel(), getAiType().name());
}
}

View File

@ -1,6 +1,5 @@
package magic.translate;
import magic.translate.StringContext;
import groovy.json.StringEscapeUtils;
import java.io.File;
import java.io.FileInputStream;
@ -25,8 +24,8 @@ import magic.data.GeneralConfig;
import magic.utility.MagicFileSystem;
import magic.utility.MagicSystem;
public final class UiString {
private UiString() { }
public final class MText {
private MText() { }
private static final String UTF_CHAR_SET = "UTF-8";

View File

@ -1,7 +1,7 @@
package magic.ui;
import java.awt.AlphaComposite;
import magic.translate.UiString;
import magic.translate.MText;
import java.awt.Color;
import java.awt.Composite;
import java.awt.Cursor;
@ -118,7 +118,7 @@ public class DuelDecksPanel extends TexturedPanel {
}
String generateTitle(final MagicDeck deck) {
return UiString.get(_S2, deck.getName(), deck.size());
return MText.get(_S2, deck.getName(), deck.size());
}
public MagicDuel getDuel() {
@ -204,8 +204,8 @@ public class DuelDecksPanel extends TexturedPanel {
private ActionBarButton getNewDeckActionBarButton() {
return new ActionBarButton(
MagicImages.getIcon(MagicIcon.RANDOM),
UiString.get(_S15),
UiString.get(_S16),
MText.get(_S15),
MText.get(_S16),
new AbstractAction() {
@Override
public void actionPerformed(final ActionEvent e) {
@ -233,7 +233,7 @@ public class DuelDecksPanel extends TexturedPanel {
private ActionBarButton getSwapDecksButton() {
return new ActionBarButton(
MagicImages.getIcon(MagicIcon.SWAP),
UiString.get(_S7), UiString.get(_S8),
MText.get(_S7), MText.get(_S8),
new AbstractAction() {
@Override
public void actionPerformed(final ActionEvent e) {

View File

@ -17,7 +17,7 @@ import magic.data.DuelConfig;
import magic.data.GeneralConfig;
import magic.model.MagicLogger;
import magic.model.player.PlayerProfiles;
import magic.translate.UiString;
import magic.translate.MText;
import magic.utility.FileIO;
import magic.utility.MagicFileSystem;
import org.apache.commons.io.FileUtils;
@ -44,8 +44,8 @@ public class ImportWorker extends SwingWorker<Boolean, Void> {
private static final String _S12 = "Please see the following file for more details -";
private static final String _S13 = "- mods...";
private static final String OK_STRING = String.format("%s\n", UiString.get(_S3));
private static final String FAIL_STRING = String.format("%s\n", UiString.get(_S1));
private static final String OK_STRING = String.format("%s\n", MText.get(_S3));
private static final String FAIL_STRING = String.format("%s\n", MText.get(_S1));
private static final FileFilter MODS_THEME_FILE_FILTER = (final File file) ->
(file.isFile() && file.getName().endsWith("_theme.zip")) ||
@ -98,8 +98,8 @@ public class ImportWorker extends SwingWorker<Boolean, Void> {
if (!isOk) {
ScreenController.showWarningMessage(String.format("%s\n\n%s\n%s",
UiString.get(_S11),
UiString.get(_S12),
MText.get(_S11),
MText.get(_S12),
"...\\Magarena\\logs\\import.log")
);
}
@ -111,7 +111,7 @@ public class ImportWorker extends SwingWorker<Boolean, Void> {
* have been added since the imported and current versions.
*/
private void updateNewCardsLog() {
setProgressNote(UiString.get(_S2));
setProgressNote(MText.get(_S2));
setProgress(0);
final File scriptsDirectory = this.importDataPath.resolve("scripts").toFile();
final File[] scriptFiles = MagicFileSystem.getSortedScriptFiles(scriptsDirectory);
@ -151,7 +151,7 @@ public class ImportWorker extends SwingWorker<Boolean, Void> {
* (see also {@link migrateModThemes})
*/
private void importThemes() throws IOException {
setProgressNote(UiString.get(_S4));
setProgressNote(MText.get(_S4));
final String directoryName = "themes";
final Path targetPath = MagicFileSystem.getDataPath(MagicFileSystem.DataPath.THEMES);
final Path sourcePath = importDataPath.resolve(directoryName);
@ -168,7 +168,7 @@ public class ImportWorker extends SwingWorker<Boolean, Void> {
* If file already exists then imported version takes precedence.
*/
private void importMods() throws IOException {
setProgressNote(UiString.get(_S13));
setProgressNote(MText.get(_S13));
final String directoryName = "mods";
final Path sourcePath = importDataPath.resolve(directoryName);
if (sourcePath.toFile().exists()) {
@ -198,7 +198,7 @@ public class ImportWorker extends SwingWorker<Boolean, Void> {
* If setting already exists then imported value takes precedence.
*/
private void importPreferences() throws IOException {
setProgressNote(UiString.get(_S5));
setProgressNote(MText.get(_S5));
final String CONFIG_FILENAME = "general.cfg";
@ -250,7 +250,7 @@ public class ImportWorker extends SwingWorker<Boolean, Void> {
* If file already exists then imported version takes precedence.
*/
private void importAvatars() throws IOException {
setProgressNote(UiString.get(_S6));
setProgressNote(MText.get(_S6));
final String directoryName = "avatars";
final Path sourcePath = importDataPath.resolve(directoryName);
if (sourcePath.toFile().exists()) {
@ -266,7 +266,7 @@ public class ImportWorker extends SwingWorker<Boolean, Void> {
* If file already exists then imported version takes precedence.
*/
private void importCustomDecks() throws IOException {
setProgressNote(UiString.get(_S7));
setProgressNote(MText.get(_S7));
final String directoryName = "decks";
final Path sourcePath = importDataPath.resolve(directoryName);
if (sourcePath.toFile().exists()) {
@ -281,7 +281,7 @@ public class ImportWorker extends SwingWorker<Boolean, Void> {
* Delete "players" folder and replace with imported copy.
*/
private void importPlayerProfiles() throws IOException {
setProgressNote(UiString.get(_S8));
setProgressNote(MText.get(_S8));
final String directoryName = "players";
final Path targetPath = MagicFileSystem.getDataPath().resolve(directoryName);
FileUtils.deleteDirectory(targetPath.toFile());
@ -297,7 +297,7 @@ public class ImportWorker extends SwingWorker<Boolean, Void> {
* Delete "duels" folder and replace with imported copy.
*/
private void importNewDuelConfig() {
setProgressNote(UiString.get(_S9));
setProgressNote(MText.get(_S9));
boolean isOk = true;
final String directoryName = "duels";
final Path targetPath = MagicFileSystem.getDataPath().resolve(directoryName);
@ -354,7 +354,7 @@ public class ImportWorker extends SwingWorker<Boolean, Void> {
private void importCardImages() {
setProgressNote(UiString.get(_S10));
setProgressNote(MText.get(_S10));
// skip if user-defined location. This is stored in the general.cfg file.
if (GeneralConfig.getInstance().isCustomCardImagesPath()) {

View File

@ -1,6 +1,6 @@
package magic.ui;
import magic.translate.UiString;
import magic.translate.MText;
import java.nio.file.Path;
import javax.swing.JFileChooser;
import magic.utility.MagicFileSystem;
@ -14,7 +14,7 @@ public class MagarenaDirectoryChooser extends JFileChooser {
public MagarenaDirectoryChooser(Path currentDirectoryPath) {
super(currentDirectoryPath.toFile());
setDialogTitle(UiString.get(_S1));
setDialogTitle(MText.get(_S1));
setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
setAcceptAllFileFilterUsed(false);
}
@ -29,10 +29,9 @@ public class MagarenaDirectoryChooser extends JFileChooser {
if (verifyImportPath(importPath)) {
super.approveSelection();
} else {
ScreenController.showWarningMessage(
String.format("<html><b>%s</b><br>%s</html>",
UiString.get(_S2),
UiString.get(_S3))
ScreenController.showWarningMessage(String.format("<html><b>%s</b><br>%s</html>",
MText.get(_S2),
MText.get(_S3))
);
}
}

View File

@ -1,6 +1,6 @@
package magic.ui;
import magic.translate.UiString;
import magic.translate.MText;
import java.awt.dnd.DropTarget;
import java.awt.event.KeyEvent;
import java.awt.event.WindowAdapter;
@ -53,7 +53,7 @@ public class MagicFrame extends MagicStickyFrame implements IDragDropListener {
ToolTipManager.sharedInstance().setInitialDelay(400);
// Setup frame.
this.setTitle(String.format("%s [%s]", frameTitle, UiString.get(_S1)));
this.setTitle(String.format("%s [%s]", frameTitle, MText.get(_S1)));
this.setIconImage(MagicImages.APP_LOGO);
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
addWindowListeners();
@ -113,7 +113,7 @@ public class MagicFrame extends MagicStickyFrame implements IDragDropListener {
duel.load(duelFile);
showDuel();
} else {
ScreenController.showWarningMessage(UiString.get(_S2));
ScreenController.showWarningMessage(MText.get(_S2));
}
}
@ -129,8 +129,7 @@ public class MagicFrame extends MagicStickyFrame implements IDragDropListener {
MagicDeckConstructionRule.getRulesText(MagicDeckConstructionRule.checkDeck(deck));
if (brokenRulesText.length() > 0) {
ScreenController.showWarningMessage(
String.format("%s\n\n%s", UiString.get(_S3, playerName), brokenRulesText));
ScreenController.showWarningMessage(String.format("%s\n\n%s", MText.get(_S3, playerName), brokenRulesText));
return false;
}
@ -164,12 +163,11 @@ public class MagicFrame extends MagicStickyFrame implements IDragDropListener {
if (!confirmQuitToDesktop) {
doShutdownMagarena();
} else {
final String message = String.format("%s\n", UiString.get(_S4));
final String message = String.format("%s\n", MText.get(_S4));
final Object[] params = {message};
final int n = JOptionPane.showConfirmDialog(
contentPanel,
final int n = JOptionPane.showConfirmDialog(contentPanel,
params,
UiString.get(_S5),
MText.get(_S5),
JOptionPane.YES_NO_OPTION);
if (n == JOptionPane.YES_OPTION) {
doShutdownMagarena();
@ -245,7 +243,7 @@ public class MagicFrame extends MagicStickyFrame implements IDragDropListener {
return true;
} catch (IOException ex) {
ScreenController.showWarningMessage(String.format("%s\n\n%s",
UiString.get(_S6),
MText.get(_S6),
ex.getMessage())
);
}
@ -259,12 +257,11 @@ public class MagicFrame extends MagicStickyFrame implements IDragDropListener {
return;
}
final String message = String.format("%s\n", UiString.get("Replace background image?"));
final String message = String.format("%s\n", MText.get("Replace background image?"));
final Object[] params = {message};
final int response = JOptionPane.showConfirmDialog(
contentPanel,
final int response = JOptionPane.showConfirmDialog(contentPanel,
params,
UiString.get("Confirmation required..."),
MText.get("Confirmation required..."),
JOptionPane.YES_NO_OPTION);
if (response == JOptionPane.YES_OPTION) {

View File

@ -13,7 +13,7 @@ import magic.model.MagicDuel;
import magic.model.MagicGame;
import magic.model.player.IPlayerProfileListener;
import magic.model.player.PlayerProfile;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.dialog.DuelSidebarLayoutDialog;
import magic.ui.dialog.prefs.PreferencesDialog;
import magic.ui.helpers.MouseHelper;
@ -118,12 +118,12 @@ public final class ScreenController {
}
public static void showInfoMessage(final String message) {
JOptionPane.showMessageDialog(mainFrame, message, UiString.get(_S2), JOptionPane.INFORMATION_MESSAGE);
JOptionPane.showMessageDialog(mainFrame, message, MText.get(_S2), JOptionPane.INFORMATION_MESSAGE);
}
public static void showWarningMessage(final String message) {
MagicSound.BEEP.play();
JOptionPane.showMessageDialog(mainFrame, message, UiString.get(_S3), JOptionPane.WARNING_MESSAGE);
JOptionPane.showMessageDialog(mainFrame, message, MText.get(_S3), JOptionPane.WARNING_MESSAGE);
}
public static void showDuelSidebarDialog(final IUIGameController controller) {

View File

@ -1,7 +1,7 @@
package magic.ui;
import magic.ui.helpers.UrlHelper;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.utility.MagicStyle;
import java.awt.Color;
import java.awt.Component;
@ -68,24 +68,24 @@ public abstract class ScreenOptionsOverlay extends TexturedPanel implements IThe
private void addGeneralOptionsMenu() {
menu = new MenuPanel(UiString.get(_S1));
menu = new MenuPanel(MText.get(_S1));
// Help stuff.
menu.addMenuItem(UiString.get(_S2), new AbstractAction() {
menu.addMenuItem(MText.get(_S2), new AbstractAction() {
@Override
public void actionPerformed(final ActionEvent e) {
ScreenController.showReadMeScreen();
hideOverlay();
}
});
menu.addMenuItem(UiString.get(_S3), new AbstractAction() {
menu.addMenuItem(MText.get(_S3), new AbstractAction() {
@Override
public void actionPerformed(final ActionEvent e) {
UrlHelper.openURL(UrlHelper.URL_USERGUIDE);
hideOverlay();
}
});
menu.addMenuItem(UiString.get(_S4), new AbstractAction() {
menu.addMenuItem(MText.get(_S4), new AbstractAction() {
@Override
public void actionPerformed(final ActionEvent e) {
ScreenController.showKeywordsScreen();
@ -95,7 +95,7 @@ public abstract class ScreenOptionsOverlay extends TexturedPanel implements IThe
menu.addBlankItem();
if (showPreferencesOption()) {
menu.addMenuItem(UiString.get(_S5), new AbstractAction() {
menu.addMenuItem(MText.get(_S5), new AbstractAction() {
@Override
public void actionPerformed(final ActionEvent e) {
hideAllMenuPanels();
@ -106,14 +106,14 @@ public abstract class ScreenOptionsOverlay extends TexturedPanel implements IThe
menu.addBlankItem();
}
menu.addMenuItem(UiString.get(_S6), new AbstractAction() {
menu.addMenuItem(MText.get(_S6), new AbstractAction() {
@Override
public void actionPerformed(final ActionEvent e) {
ScreenController.showMainMenuScreen();
hideOverlay();
}
});
menu.addMenuItem(UiString.get(_S7), new AbstractAction() {
menu.addMenuItem(MText.get(_S7), new AbstractAction() {
@Override
public void actionPerformed(final ActionEvent e) {
ScreenController.getFrame().quitToDesktop(false);
@ -122,7 +122,7 @@ public abstract class ScreenOptionsOverlay extends TexturedPanel implements IThe
if (showGeneralCloseMenuOption()) {
menu.addBlankItem();
menu.addMenuItem(new MenuButton(UiString.get(_S8), new AbstractAction() {
menu.addMenuItem(new MenuButton(MText.get(_S8), new AbstractAction() {
@Override
public void actionPerformed(final ActionEvent e) {
hideOverlay();

View File

@ -1,6 +1,6 @@
package magic.ui;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.helpers.ImageHelper;
import java.awt.Component;
import java.awt.Desktop;
@ -38,20 +38,20 @@ public class UiExceptionHandler extends FileExceptionHandler {
// By specifying a frame the JOptionPane will be shown in the taskbar.
// Otherwise if the dialog is hidden it is easy to forget it is still open.
final JFrame frame = new JFrame(UiString.get(_S1));
final JFrame frame = new JFrame(MText.get(_S1));
frame.setUndecorated(true);
frame.setVisible(true);
frame.setLocationRelativeTo(null);
String prompt = UiString.get(_S2);
String prompt = MText.get(_S2);
if (Desktop.isDesktopSupported()) {
prompt += String.format("\n\n%s\n%s", UiString.get(_S3), UiString.get(_S4));
final int action = JOptionPane.showConfirmDialog(frame, prompt, UiString.get(_S1), JOptionPane.OK_OPTION, JOptionPane.ERROR_MESSAGE, null);
prompt += String.format("\n\n%s\n%s", MText.get(_S3), MText.get(_S4));
final int action = JOptionPane.showConfirmDialog(frame, prompt, MText.get(_S1), JOptionPane.OK_OPTION, JOptionPane.ERROR_MESSAGE, null);
if (action == JOptionPane.YES_OPTION) {
Desktop.getDesktop().open(MagicFileSystem.getDataPath(MagicFileSystem.DataPath.LOGS).toFile());
}
} else {
JOptionPane.showMessageDialog(frame, prompt, UiString.get(_S1), JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(frame, prompt, MText.get(_S1), JOptionPane.ERROR_MESSAGE);
}
} catch (Exception e) {

View File

@ -13,7 +13,7 @@ import javax.swing.JTextField;
import magic.ai.MagicAIImpl;
import magic.model.player.AiProfile;
import magic.model.player.PlayerProfile;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.dialog.button.CancelButton;
import magic.ui.dialog.button.SaveButton;
import magic.ui.widget.SliderPanel;
@ -37,13 +37,13 @@ public class AiPropertiesDialog extends MagicDialog {
public AiPropertiesDialog(final AiProfile profile) {
super(UiString.get(_S1), new Dimension(400, 260));
super(MText.get(_S1), new Dimension(400, 260));
this.playerProfile = profile == null ? new AiProfile() : profile;
playerNameTextField = new JTextField(playerProfile.getPlayerName());
lifeSliderPanel = new SliderPanel(UiString.get(_S2), 0, 10, 1, playerProfile.getExtraLife());
aiLevelSliderPanel = new SliderPanel(UiString.get(_S3), 1, 8, 1, playerProfile.getAiLevel());
lifeSliderPanel = new SliderPanel(MText.get(_S2), 0, 10, 1, playerProfile.getExtraLife());
aiLevelSliderPanel = new SliderPanel(MText.get(_S3), 1, 8, 1, playerProfile.getAiLevel());
aiComboBox = new JComboBox<>();
aiComboBox.setModel(new DefaultComboBoxModel<>(MagicAIImpl.SUPPORTED_AIS));
@ -121,14 +121,14 @@ public class AiPropertiesDialog extends MagicDialog {
private JPanel getAiTypePanel() {
final JPanel panel = new JPanel(new MigLayout("insets 0"));
panel.add(new JLabel(UiString.get(_S6)));
panel.add(new JLabel(MText.get(_S6)));
panel.add(aiComboBox, "w 100%, left");
return panel;
}
private JPanel getPlayerNamePanel() {
final JPanel panel = new JPanel(new MigLayout("insets 0"));
panel.add(new JLabel(UiString.get(_S7)));
panel.add(new JLabel(MText.get(_S7)));
panel.add(playerNameTextField, "w 100%, left");
return panel;
}

View File

@ -15,7 +15,7 @@ import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import magic.data.DeckType;
import magic.firemind.FiremindJsonReader;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.dialog.button.CancelButton;
import magic.ui.dialog.button.SaveButton;
import magic.ui.FontsAndBorders;
@ -39,7 +39,7 @@ public class DeckChooserDialog extends MagicDialog {
public DeckChooserDialog(final DeckType aDeckType, final String aDeckName) {
super(UiString.get(_S2), new Dimension(300, 180));
super(MText.get(_S2), new Dimension(300, 180));
deckTypeCombo = getDeckTypeComboBox();
deckTypeCombo.setSelectedItem(aDeckType);

View File

@ -20,7 +20,7 @@ import javax.swing.SpinnerNumberModel;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.text.NumberFormatter;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.FontsAndBorders;
import magic.ui.widget.deck.DeckFilter;
import magic.ui.widget.deck.DeckFilter.NumericFilter;
@ -49,13 +49,13 @@ public class DecksFilterDialog extends MagicDialog {
private final JTextField cardNameFilterText = new JTextField();
private final JTextField deckNameFilterText = new JTextField();
private final JTextField deckDescFilterText = new JTextField();
private final JButton saveButton = new SaveButton(UiString.get(_S1));
private final JButton resetButton = new JButton(UiString.get(_S2));
private final JButton saveButton = new SaveButton(MText.get(_S1));
private final JButton resetButton = new JButton(MText.get(_S2));
// CTR
public DecksFilterDialog() {
super(UiString.get(_S3), new Dimension(400, 300));
super(MText.get(_S3), new Dimension(400, 300));
if (filterHistory.size() > 0) {
deckFilter = filterHistory.get(historyIndex-1);
@ -116,13 +116,13 @@ public class DecksFilterDialog extends MagicDialog {
private void refreshLayout() {
final JPanel panel = getDialogContentPanel();
panel.setLayout(new MigLayout("flowx, wrap 2"));
panel.add(getFilterCaptionLabel(UiString.get(_S4)), "alignx right");
panel.add(getFilterCaptionLabel(MText.get(_S4)), "alignx right");
panel.add(deckSizeFilterPanel, "w 100%");
panel.add(getFilterCaptionLabel(UiString.get(_S5)), "alignx right");
panel.add(getFilterCaptionLabel(MText.get(_S5)), "alignx right");
panel.add(deckNameFilterText, "w 100%");
panel.add(getFilterCaptionLabel(UiString.get(_S6)), "alignx right");
panel.add(getFilterCaptionLabel(MText.get(_S6)), "alignx right");
panel.add(deckDescFilterText, "w 100%");
panel.add(getFilterCaptionLabel(UiString.get(_S7)), "alignx right");
panel.add(getFilterCaptionLabel(MText.get(_S7)), "alignx right");
panel.add(cardNameFilterText, "w 100%");
panel.add(getButtonPanel(), "w 100%, h 40!, pushy, aligny bottom, spanx");
}

View File

@ -13,7 +13,7 @@ import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import magic.data.MagicFormat;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.dialog.button.CancelButton;
import magic.ui.dialog.button.SaveButton;
import magic.ui.widget.SliderPanel;
@ -44,11 +44,11 @@ public class DuelPropertiesDialog extends MagicDialog {
final MagicFormat cube
) {
super(UiString.get(_S1), new Dimension(380, 260));
super(MText.get(_S1), new Dimension(380, 260));
lifeSliderPanel = new SliderPanel(UiString.get(_S2), (MagicSystem.isDevMode() ? 1 : 10), 30, 5, initialLife, false);
handSizeSliderPanel = new SliderPanel(UiString.get(_S3), 6, 8, 1, handSize);
winsSliderPanel = new SliderPanel(UiString.get(_S4), 1, 11, 2, maxGames);
lifeSliderPanel = new SliderPanel(MText.get(_S2), (MagicSystem.isDevMode() ? 1 : 10), 30, 5, initialLife, false);
handSizeSliderPanel = new SliderPanel(MText.get(_S3), 6, 8, 1, handSize);
winsSliderPanel = new SliderPanel(MText.get(_S4), 1, 11, 2, maxGames);
cubeComboBox = new JComboBox<>(MagicFormat.getDuelFormatsArray());
cubeComboBox.setLightWeightPopupEnabled(false);
@ -81,7 +81,7 @@ public class DuelPropertiesDialog extends MagicDialog {
private JPanel getCubePanel() {
final JPanel panel = new JPanel(new MigLayout());
final JLabel lbl = new JLabel(UiString.get(_S5));
final JLabel lbl = new JLabel(MText.get(_S5));
lbl.setFont(lbl.getFont().deriveFont(Font.BOLD));
panel.add(lbl);
panel.add(cubeComboBox, "w 100%");

View File

@ -12,7 +12,7 @@ import javax.swing.JPanel;
import javax.swing.ListSelectionModel;
import magic.data.GeneralConfig;
import magic.model.IUIGameController;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.theme.Theme;
import magic.ui.utility.MagicStyle;
import magic.ui.dialog.button.CancelButton;
@ -38,7 +38,7 @@ public class DuelSidebarLayoutDialog extends MagicDialog {
// CTR
public DuelSidebarLayoutDialog(final IUIGameController controller) {
super(UiString.get(_S1), new Dimension(280, 260));
super(MText.get(_S1), new Dimension(280, 260));
this.controller = controller;
currentLayout = GeneralConfig.getInstance().getDuelSidebarLayout();
setLookAndFeel();
@ -116,7 +116,7 @@ public class DuelSidebarLayoutDialog extends MagicDialog {
}
private JButton getMoveUpButton() {
final JButton btn = new JButton(UiString.get(_S4));
final JButton btn = new JButton(MText.get(_S4));
btn.addActionListener(new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
@ -133,7 +133,7 @@ public class DuelSidebarLayoutDialog extends MagicDialog {
}
private JButton getMoveDownButton() {
final JButton btn = new JButton(UiString.get(_S5));
final JButton btn = new JButton(MText.get(_S5));
btn.addActionListener(new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {

View File

@ -1,6 +1,6 @@
package magic.ui.dialog;
import magic.translate.UiString;
import magic.translate.MText;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
@ -82,7 +82,7 @@ public class FiremindWorkerDialog extends JDialog implements ActionListener, Pro
}
private void setLookAndFeel() {
setTitle(UiString.get(_S1));
setTitle(MText.get(_S1));
setResizable(false);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setSize(360, 460);
@ -104,7 +104,7 @@ public class FiremindWorkerDialog extends JDialog implements ActionListener, Pro
cancelButton.setFocusable(false);
cancelButton.addActionListener(this);
// background button
backgroundButton.setText(UiString.get(_S3));
backgroundButton.setText(MText.get(_S3));
backgroundButton.setFocusable(false);
backgroundButton.addActionListener(this);
// layout

View File

@ -19,7 +19,7 @@ import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities;
import magic.test.TestGameBuilder;
import magic.ui.ScreenController;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.dialog.button.CancelButton;
import magic.utility.MagicSystem;
import net.miginfocom.swing.MigLayout;
@ -33,7 +33,7 @@ public class GameStateRunner
public GameStateRunner() {
super(UiString.get("Test Classes (double-click to select)"), new Dimension(500, 460));
super(MText.get("Test Classes (double-click to select)"), new Dimension(500, 460));
setLookAndFeel();
refreshLayout();
@ -54,7 +54,7 @@ public class GameStateRunner
private String[] getListOfTestClasses() throws IOException, URISyntaxException {
final List<String> classes = new ArrayList<>();
for (final String c : UiString.getClassNamesInPackage(MagicSystem.getJarFile(), "magic.test")) {
for (final String c : MText.getClassNamesInPackage(MagicSystem.getJarFile(), "magic.test")) {
final String longClassName = c.substring(0, c.length() - ".class".length());
final String shortClassName = longClassName.substring(longClassName.lastIndexOf(".") + 1);
final boolean isValid = shortClassName.startsWith("Test")

View File

@ -11,7 +11,7 @@ import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import magic.data.DeckGenerator;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.dialog.button.CancelButton;
import magic.ui.dialog.button.SaveButton;
import magic.ui.FontsAndBorders;
@ -37,7 +37,7 @@ public class RandomDeckGeneratorDialog extends MagicDialog implements ChangeList
private static final String _S13 = "Lands:";
private boolean isCancelled = false;
private final JButton saveButton = new SaveButton(UiString.get(_S1));
private final JButton saveButton = new SaveButton(MText.get(_S1));
private final int cardPoolSize;
private DeckGenerator deckGenerator = new DeckGenerator();
@ -56,7 +56,7 @@ public class RandomDeckGeneratorDialog extends MagicDialog implements ChangeList
// CTR
public RandomDeckGeneratorDialog(final int cardPoolSize, final int defaultDeckSize) {
super(UiString.get(_S5), new Dimension(460, 340));
super(MText.get(_S5), new Dimension(460, 340));
this.cardPoolSize = cardPoolSize;
@ -64,15 +64,15 @@ public class RandomDeckGeneratorDialog extends MagicDialog implements ChangeList
deckSizeSlider.addChangeListener(this);
spellsSlider = new SliderPanel("", 0, 100, 1, 60, false);
spellsSlider.setToolTipText(UiString.get(_S2));
spellsSlider.setToolTipText(MText.get(_S2));
spellsSlider.addChangeListener(this);
creaturesSlider = new SliderPanel("", 0, 100, 1, 66, false);
creaturesSlider.setToolTipText(UiString.get(_S3));
creaturesSlider.setToolTipText(MText.get(_S3));
creaturesSlider.addChangeListener(this);
maxColorsSlider = new SliderPanel("", 1, 3, 1, 2, true);
maxColorsSlider.setToolTipText(UiString.get(_S4));
maxColorsSlider.setToolTipText(MText.get(_S4));
maxColorsSlider.addChangeListener(this);
refreshLayout();
@ -113,26 +113,26 @@ public class RandomDeckGeneratorDialog extends MagicDialog implements ChangeList
final JPanel panel = getDialogContentPanel();
panel.setLayout(new MigLayout("flowx, wrap 2"));
panel.add(getFilterCaptionLabel(UiString.get(_S6)), "alignx right");
panel.add(getFilterCaptionLabel(MText.get(_S6)), "alignx right");
panel.add(new JLabel(Integer.toString(cardPoolSize)), "w 100%");
panel.add(getFilterCaptionLabel(UiString.get(_S7)), "alignx right");
panel.add(getFilterCaptionLabel(MText.get(_S7)), "alignx right");
panel.add(deckSizeSlider, "w 100%");
panel.add(getFilterCaptionLabel(UiString.get(_S8)), "alignx right");
panel.add(getFilterCaptionLabel(MText.get(_S8)), "alignx right");
panel.add(spellsSlider, "w 100%");
panel.add(getFilterCaptionLabel(UiString.get(_S9)), "alignx right");
panel.add(getFilterCaptionLabel(MText.get(_S9)), "alignx right");
panel.add(creaturesSlider, "w 100%");
panel.add(getFilterCaptionLabel(UiString.get(_S10)), "alignx right");
panel.add(getFilterCaptionLabel(MText.get(_S10)), "alignx right");
panel.add(maxColorsSlider, "w 100%");
panel.add(getFilterCaptionLabel(UiString.get(_S11)), "alignx right, gaptop 10");
panel.add(getFilterCaptionLabel(MText.get(_S11)), "alignx right, gaptop 10");
panel.add(spellsLabel, "w 100%");
panel.add(getFilterCaptionLabel(UiString.get(_S12)), "alignx right");
panel.add(getFilterCaptionLabel(MText.get(_S12)), "alignx right");
panel.add(creaturesLabel, "w 100%");
panel.add(getFilterCaptionLabel(UiString.get(_S13)), "alignx right");
panel.add(getFilterCaptionLabel(MText.get(_S13)), "alignx right");
panel.add(landsLabel, "w 100%");
panel.add(getButtonPanel(), "w 100%, h 30!, pushy, aligny bottom, spanx");

View File

@ -2,7 +2,7 @@ package magic.ui.dialog.button;
import magic.data.MagicIcon;
import magic.ui.MagicImages;
import magic.translate.UiString;
import magic.translate.MText;
@SuppressWarnings("serial")
public class CancelButton extends MagicDialogButton {
@ -11,7 +11,7 @@ public class CancelButton extends MagicDialogButton {
private static final String _S1 = "Cancel";
public CancelButton() {
super(UiString.get(_S1));
super(MText.get(_S1));
setIcon(MagicImages.getIcon(MagicIcon.BANNED));
}

View File

@ -2,7 +2,7 @@ package magic.ui.dialog.button;
import magic.data.MagicIcon;
import magic.ui.MagicImages;
import magic.translate.UiString;
import magic.translate.MText;
@SuppressWarnings("serial")
public class CloseButton extends MagicDialogButton {
@ -11,7 +11,7 @@ public class CloseButton extends MagicDialogButton {
private static final String _S1 = "Close";
public CloseButton() {
super(UiString.get(_S1));
super(MText.get(_S1));
setIcon(MagicImages.getIcon(MagicIcon.BANNED));
}

View File

@ -2,7 +2,7 @@ package magic.ui.dialog.button;
import magic.data.MagicIcon;
import magic.ui.MagicImages;
import magic.translate.UiString;
import magic.translate.MText;
@SuppressWarnings("serial")
public class SaveButton extends MagicDialogButton {
@ -16,7 +16,7 @@ public class SaveButton extends MagicDialogButton {
}
public SaveButton() {
this(UiString.get(_S1));
this(MText.get(_S1));
}
}

View File

@ -7,7 +7,7 @@ import java.util.Map;
import javax.swing.JCheckBox;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.widget.duel.animation.AnimationFx;
import net.miginfocom.swing.MigLayout;
@ -42,16 +42,16 @@ class AnimationFlagsPanel extends JPanel {
this.listener = aListener;
createCheckBox(AnimationFx.DRAW_CARD, UiString.asHtml(_S1), UiString.get(_S2));
createCheckBox(AnimationFx.PLAY_CARD, UiString.asHtml(_S3), UiString.get(_S4));
createCheckBox(AnimationFx.FLIP_CARD, UiString.asHtml(_S5), UiString.get(_S6));
createCheckBox(AnimationFx.CARD_SHADOW, UiString.asHtml(_S7), UiString.get(_S8));
createCheckBox(AnimationFx.STATIC_ARROW, UiString.asHtml(_S9), UiString.get(_S10));
createCheckBox(AnimationFx.ELASTIC_ARROW, UiString.asHtml(_S20), UiString.get(_S21));
createCheckBox(AnimationFx.ZBUTTON_PULSE, UiString.asHtml(_S11), UiString.get(_S16));
createCheckBox(AnimationFx.AVATAR_PULSE, UiString.asHtml(_S12), UiString.get(_S17));
createCheckBox(AnimationFx.NEW_TURN_MSG, UiString.asHtml(_S13), UiString.get(_S18));
createCheckBox(AnimationFx.CARD_FADEIN, UiString.asHtml(_S14), UiString.get(_S15));
createCheckBox(AnimationFx.DRAW_CARD, MText.asHtml(_S1), MText.get(_S2));
createCheckBox(AnimationFx.PLAY_CARD, MText.asHtml(_S3), MText.get(_S4));
createCheckBox(AnimationFx.FLIP_CARD, MText.asHtml(_S5), MText.get(_S6));
createCheckBox(AnimationFx.CARD_SHADOW, MText.asHtml(_S7), MText.get(_S8));
createCheckBox(AnimationFx.STATIC_ARROW, MText.asHtml(_S9), MText.get(_S10));
createCheckBox(AnimationFx.ELASTIC_ARROW, MText.asHtml(_S20), MText.get(_S21));
createCheckBox(AnimationFx.ZBUTTON_PULSE, MText.asHtml(_S11), MText.get(_S16));
createCheckBox(AnimationFx.AVATAR_PULSE, MText.asHtml(_S12), MText.get(_S17));
createCheckBox(AnimationFx.NEW_TURN_MSG, MText.asHtml(_S13), MText.get(_S18));
createCheckBox(AnimationFx.CARD_FADEIN, MText.asHtml(_S14), MText.get(_S15));
setLayout(new MigLayout("flowx, wrap 2, insets 0, gapy 6, gapx 10"));
for (JCheckBox cb : cbMap.values()) {

View File

@ -6,7 +6,7 @@ import javax.swing.JCheckBox;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import magic.data.GeneralConfig;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.widget.SliderPanel;
import net.miginfocom.swing.MigLayout;
@ -54,8 +54,8 @@ class AnimationsPanel extends JPanel {
}
private JCheckBox getAnimateCheckbox(MouseListener aListener, JPanel panel) {
final JCheckBox cb = new JCheckBox(UiString.get(_S70), CONFIG.getAnimateGameplay());
cb.setToolTipText(UiString.get(_S71));
final JCheckBox cb = new JCheckBox(MText.get(_S70), CONFIG.getAnimateGameplay());
cb.setToolTipText(MText.get(_S71));
cb.setFocusable(false);
cb.addMouseListener(aListener);
cb.addChangeListener((ChangeEvent e) -> {
@ -65,24 +65,24 @@ class AnimationsPanel extends JPanel {
}
private SliderPanel getNewTurnAlertSlider(MouseListener aListener) {
final SliderPanel sp = new SliderPanel(UiString.get(_S1), 1, 10, 1, CONFIG.getNewTurnAlertDuration() / 1000);
sp.setToolTipText(UiString.get(_S2));
final SliderPanel sp = new SliderPanel(MText.get(_S1), 1, 10, 1, CONFIG.getNewTurnAlertDuration() / 1000);
sp.setToolTipText(MText.get(_S2));
sp.addMouseListener(aListener);
sp.setFontBold(false);
return sp;
}
private SliderPanel getNonLandPreviewSlider(MouseListener aListener) {
final SliderPanel sp = new SliderPanel(UiString.get(_S3), 1, 20, 1, CONFIG.getNonLandPreviewDuration() / 1000);
sp.setToolTipText(UiString.get(_S4));
final SliderPanel sp = new SliderPanel(MText.get(_S3), 1, 20, 1, CONFIG.getNonLandPreviewDuration() / 1000);
sp.setToolTipText(MText.get(_S4));
sp.addMouseListener(aListener);
sp.setFontBold(false);
return sp;
}
private SliderPanel getLandPreviewSlider(MouseListener aListener) {
final SliderPanel sp = new SliderPanel(UiString.get(_S5), 1, 20, 1, CONFIG.getLandPreviewDuration() / 1000);
sp.setToolTipText(UiString.get(_S6));
final SliderPanel sp = new SliderPanel(MText.get(_S5), 1, 20, 1, CONFIG.getLandPreviewDuration() / 1000);
sp.setToolTipText(MText.get(_S6));
sp.addMouseListener(aListener);
sp.setFontBold(false);
return sp;

View File

@ -4,7 +4,7 @@ import java.awt.event.MouseListener;
import javax.swing.JLabel;
import javax.swing.JPanel;
import magic.data.GeneralConfig;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.MagicSound;
import magic.ui.FontsAndBorders;
import net.miginfocom.swing.MigLayout;
@ -25,19 +25,19 @@ class AudioPanel extends JPanel {
AudioPanel(MouseListener aListener) {
uiVolumeSlider = new VolumeSliderPanel(config.getUiVolume(), MagicSound.ALERT);
uiVolumeSlider.setToolTipText(UiString.get(_S9));
uiVolumeSlider.setToolTipText(MText.get(_S9));
uiVolumeSlider.setFocusable(false);
uiVolumeSlider.addMouseListener(aListener);
gameVolumeSlider = new VolumeSliderPanel(config.getGameVolume(), MagicSound.COMBAT);
gameVolumeSlider.setToolTipText(UiString.get(_S11));
gameVolumeSlider.setToolTipText(MText.get(_S11));
gameVolumeSlider.setFocusable(false);
gameVolumeSlider.addMouseListener(aListener);
setLayout(new MigLayout("flowy, gapy 0, insets 16"));
add(getCaptionLabel(UiString.get(_S1)));
add(getCaptionLabel(MText.get(_S1)));
add(uiVolumeSlider, "w 100%");
add(getCaptionLabel(UiString.get(_S2)), "gaptop 16");
add(getCaptionLabel(MText.get(_S2)), "gaptop 16");
add(gameVolumeSlider, " w 100%");
addMouseListener(aListener);
}

View File

@ -6,7 +6,7 @@ import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import magic.data.GeneralConfig;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.widget.SliderPanel;
import net.miginfocom.swing.MigLayout;
@ -37,31 +37,31 @@ class GameplayImagesPanel extends JPanel {
GameplayImagesPanel(final MouseListener aListener) {
// Card highlight setting.
final JLabel highlightLabel = new JLabel(UiString.get(_S41));
final JLabel highlightLabel = new JLabel(MText.get(_S41));
final String[] Highlightchoices = {
UiString.get(_S42),
UiString.get(_S43),
UiString.get(_S44),
UiString.get(_S45)
MText.get(_S42),
MText.get(_S43),
MText.get(_S44),
MText.get(_S45)
};
highlightComboBox = new JComboBox<>(Highlightchoices);
highlightComboBox.setSelectedItem(CONFIG.getHighlight());
highlightComboBox.setToolTipText(UiString.get(_S46));
highlightComboBox.setToolTipText(MText.get(_S46));
highlightComboBox.setFocusable(false);
highlightComboBox.addMouseListener(aListener);
mouseWheelPopupCheckBox = new JCheckBox(UiString.get(_S28), CONFIG.isMouseWheelPopup());
mouseWheelPopupCheckBox = new JCheckBox(MText.get(_S28), CONFIG.isMouseWheelPopup());
mouseWheelPopupCheckBox.setFocusable(false);
mouseWheelPopupCheckBox.setToolTipText(UiString.get(_S29));
mouseWheelPopupCheckBox.setToolTipText(MText.get(_S29));
mouseWheelPopupCheckBox.addMouseListener(aListener);
popupDelaySlider = new SliderPanel(UiString.get(_S30), 0, 5000, 100, CONFIG.getPopupDelay());
popupDelaySlider.setToolTipText(UiString.get(_S31));
popupDelaySlider = new SliderPanel(MText.get(_S30), 0, 5000, 100, CONFIG.getPopupDelay());
popupDelaySlider.setToolTipText(MText.get(_S31));
popupDelaySlider.addMouseListener(aListener);
pauseGamePopupCheckBox = new JCheckBox(UiString.get(_S34), CONFIG.isGamePausedOnPopup());
pauseGamePopupCheckBox = new JCheckBox(MText.get(_S34), CONFIG.isGamePausedOnPopup());
pauseGamePopupCheckBox.setFocusable(false);
pauseGamePopupCheckBox.setToolTipText(UiString.get(_S35));
pauseGamePopupCheckBox.setToolTipText(MText.get(_S35));
pauseGamePopupCheckBox.addMouseListener(aListener);
setLayout(new MigLayout("flowx, wrap 2, insets 16, gapy 10"));

View File

@ -5,7 +5,7 @@ import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import magic.data.GeneralConfig;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.screen.images.download.DirectoryChooser;
import magic.ui.FontsAndBorders;
import net.miginfocom.swing.MigLayout;
@ -40,7 +40,7 @@ class GeneralPanel extends JPanel {
GeneralPanel(MouseListener aListener) {
langPanel = new TranslationPanel();
langPanel.setToolTipText(UiString.get(_S56));
langPanel.setToolTipText(MText.get(_S56));
langPanel.setFocusable(false);
langPanel.addMouseListener(aListener);
@ -51,38 +51,38 @@ class GeneralPanel extends JPanel {
preferredSizePanel = new PreferredSizePanel(aListener);
preferredSizePanel.setFocusable(false);
imagesOnDemandCheckbox = new JCheckBox(UiString.get(_S1), config.getImagesOnDemand());
imagesOnDemandCheckbox.setToolTipText(UiString.get(_S2));
imagesOnDemandCheckbox = new JCheckBox(MText.get(_S1), config.getImagesOnDemand());
imagesOnDemandCheckbox.setToolTipText(MText.get(_S2));
imagesOnDemandCheckbox.setFocusable(false);
imagesOnDemandCheckbox.addMouseListener(aListener);
splitViewDeckEditorCheckBox = new JCheckBox(UiString.get(_S57), config.isSplitViewDeckEditor());
splitViewDeckEditorCheckBox.setToolTipText(UiString.get(_S58));
splitViewDeckEditorCheckBox = new JCheckBox(MText.get(_S57), config.isSplitViewDeckEditor());
splitViewDeckEditorCheckBox.setToolTipText(MText.get(_S58));
splitViewDeckEditorCheckBox.setFocusable(false);
splitViewDeckEditorCheckBox.addMouseListener(aListener);
previewCardOnSelectCheckBox = new JCheckBox(UiString.get(_S59), config.isPreviewCardOnSelect());
previewCardOnSelectCheckBox.setToolTipText(UiString.get(_S60));
previewCardOnSelectCheckBox = new JCheckBox(MText.get(_S59), config.isPreviewCardOnSelect());
previewCardOnSelectCheckBox.setToolTipText(MText.get(_S60));
previewCardOnSelectCheckBox.setFocusable(false);
previewCardOnSelectCheckBox.addMouseListener(aListener);
missingCardDataCheckbox = new JCheckBox(UiString.get(_S61), config.showMissingCardData());
missingCardDataCheckbox.setToolTipText(UiString.get(_S62));
missingCardDataCheckbox = new JCheckBox(MText.get(_S61), config.showMissingCardData());
missingCardDataCheckbox.setToolTipText(MText.get(_S62));
missingCardDataCheckbox.setFocusable(false);
missingCardDataCheckbox.addMouseListener(aListener);
setLayout(new MigLayout("flowy, gapy 4, insets 16"));
// lang
add(getCaptionLabel(UiString.get(_S63)));
add(getCaptionLabel(MText.get(_S63)));
add(langPanel, "w 100%");
// images
add(getCaptionLabel(UiString.get(UiString.get(_S83))), "gaptop 10");
add(getCaptionLabel(MText.get(MText.get(_S83))), "gaptop 10");
add(imagesFolderChooser, "w 100%");
add(preferredSizePanel, "w 100%");
add(imagesOnDemandCheckbox);
// explorer & editor
add(getCaptionLabel(UiString.get(_S64)), "gaptop 10");
add(getCaptionLabel(MText.get(_S64)), "gaptop 10");
add(splitViewDeckEditorCheckBox);
add(previewCardOnSelectCheckBox);
add(missingCardDataCheckbox);

View File

@ -2,7 +2,7 @@ package magic.ui.dialog.prefs;
import java.awt.Dimension;
import magic.data.GeneralConfig;
import magic.translate.UiString;
import magic.translate.MText;
public enum ImageSizePresets {
@ -26,7 +26,7 @@ public enum ImageSizePresets {
@Override
public String toString() {
if (this == SIZE_ORIGINAL) {
return UiString.get(_S1);
return MText.get(_S1);
} else {
return String.format("%d x %d", size.width, size.height);
}

View File

@ -36,7 +36,7 @@ import javax.swing.SwingUtilities;
import javax.swing.ToolTipManager;
import javax.swing.text.NumberFormatter;
import magic.data.GeneralConfig;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.MagicFrame;
import magic.ui.MagicImages;
import magic.ui.ScreenController;
@ -119,7 +119,7 @@ public class PreferencesDialog
super(frame, true);
this.isGamePlayMode = isGamePlayMode;
this.setTitle(UiString.get(_S79));
this.setTitle(MText.get(_S79));
this.setSize(460, 530);
this.setLocationRelativeTo(ScreenController.getFrame());
this.setResizable(false);
@ -171,15 +171,15 @@ public class PreferencesDialog
private JTabbedPane getTabbedSettingsPane() {
final JTabbedPane tabbedPane = new JTabbedPane();
if (isGamePlayMode) {
tabbedPane.addTab(UiString.get(_S4), getGameplaySettingsTabbedPane());
tabbedPane.addTab(UiString.get(_S5), themesPanel);
tabbedPane.addTab(UiString.get(_S6), audioPanel);
tabbedPane.addTab(MText.get(_S4), getGameplaySettingsTabbedPane());
tabbedPane.addTab(MText.get(_S5), themesPanel);
tabbedPane.addTab(MText.get(_S6), audioPanel);
} else {
tabbedPane.addTab(UiString.get(_S3), generalPanel);
tabbedPane.addTab(UiString.get(_S4), getGameplaySettingsTabbedPane());
tabbedPane.addTab(UiString.get(_S5), themesPanel);
tabbedPane.addTab(UiString.get(_S6), audioPanel);
tabbedPane.addTab(UiString.get(_S7), getNetworkSettingsPanel());
tabbedPane.addTab(MText.get(_S3), generalPanel);
tabbedPane.addTab(MText.get(_S4), getGameplaySettingsTabbedPane());
tabbedPane.addTab(MText.get(_S5), themesPanel);
tabbedPane.addTab(MText.get(_S6), audioPanel);
tabbedPane.addTab(MText.get(_S7), getNetworkSettingsPanel());
}
return tabbedPane;
}
@ -203,11 +203,11 @@ public class PreferencesDialog
}
// layout components
final JPanel panel = new JPanel(new MigLayout("flowx, wrap 2, insets 16, gapy 4"));
panel.add(getCaptionLabel(UiString.get(_S12)));
panel.add(getCaptionLabel(MText.get(_S12)));
panel.add(proxyComboBox, "w 140!");
panel.add(getCaptionLabel(UiString.get(_S13)));
panel.add(getCaptionLabel(MText.get(_S13)));
panel.add(proxyAddressTextField, "w 100%");
panel.add(getCaptionLabel(UiString.get(_S14)));
panel.add(getCaptionLabel(MText.get(_S14)));
panel.add(proxyPortSpinner, "w 60!");
return panel;
}
@ -246,29 +246,29 @@ public class PreferencesDialog
private JScrollPane getGameplaySettingsPanel1() {
hideAIPromptCheckBox = new JCheckBox(getAsHtml(UiString.get(_S15)), config.getHideAiActionPrompt());
hideAIPromptCheckBox.setToolTipText(UiString.get(_S16));
hideAIPromptCheckBox = new JCheckBox(getAsHtml(MText.get(_S15)), config.getHideAiActionPrompt());
hideAIPromptCheckBox.setToolTipText(MText.get(_S16));
setButtonPropertyDefaults(hideAIPromptCheckBox);
mulliganScreenCheckbox = new JCheckBox(getAsHtml(UiString.get(_S17)), config.getMulliganScreenActive());
mulliganScreenCheckbox = new JCheckBox(getAsHtml(MText.get(_S17)), config.getMulliganScreenActive());
setButtonPropertyDefaults(mulliganScreenCheckbox);
touchscreenCheckBox = new JCheckBox(getAsHtml(UiString.get(_S20)), config.isTouchscreen());
touchscreenCheckBox = new JCheckBox(getAsHtml(MText.get(_S20)), config.isTouchscreen());
setButtonPropertyDefaults(touchscreenCheckBox);
skipSingleCheckBox = new JCheckBox(getAsHtml(UiString.get(_S21)), config.getSkipSingle());
skipSingleCheckBox.setToolTipText(UiString.get(_S22));
skipSingleCheckBox = new JCheckBox(getAsHtml(MText.get(_S21)), config.getSkipSingle());
skipSingleCheckBox.setToolTipText(MText.get(_S22));
setButtonPropertyDefaults(skipSingleCheckBox);
alwaysPassCheckBox = new JCheckBox(getAsHtml(UiString.get(_S23)), config.getAlwaysPass());
alwaysPassCheckBox = new JCheckBox(getAsHtml(MText.get(_S23)), config.getAlwaysPass());
setButtonPropertyDefaults(alwaysPassCheckBox);
smartTargetCheckBox = new JCheckBox(getAsHtml(UiString.get(_S24)), config.getSmartTarget());
smartTargetCheckBox.setToolTipText(UiString.get(_S25));
smartTargetCheckBox = new JCheckBox(getAsHtml(MText.get(_S24)), config.getSmartTarget());
smartTargetCheckBox.setToolTipText(MText.get(_S25));
setButtonPropertyDefaults(smartTargetCheckBox);
messageDelaySlider = new SliderPanel(getAsHtml(UiString.get(_S26)), 0, 3000, 500, config.getMessageDelay());
messageDelaySlider.setToolTipText(UiString.get(_S27));
messageDelaySlider = new SliderPanel(getAsHtml(MText.get(_S26)), 0, 3000, 500, config.getMessageDelay());
messageDelaySlider.setToolTipText(MText.get(_S27));
messageDelaySlider.addMouseListener(this);
final ScrollablePanel panel = new ScrollablePanel(new MigLayout("flowy, insets 16, gapy 10"));
@ -334,15 +334,15 @@ public class PreferencesDialog
private boolean setNewTranslation() {
try {
UiString.loadTranslationFile();
MText.loadTranslationFile();
isRestartRequired = true;
return true;
} catch (NumberFormatException ex) {
UiString.disableTranslations();
MText.disableTranslations();
System.err.println(ex);
ScreenController.showWarningMessage(String.format("%s\n%s\n\n%s",
UiString.get(_S80), UiString.get(_S81), ex)
MText.get(_S80), MText.get(_S81), ex)
);
SwingUtilities.invokeLater(new Runnable() {
@Override
@ -378,7 +378,7 @@ public class PreferencesDialog
private boolean validateSettings() {
if (isGamePlayMode == false) {
if (isProxyUpdated && !isProxyValid()) {
ScreenController.showWarningMessage(UiString.get(_S37));
ScreenController.showWarningMessage(MText.get(_S37));
return false;
}
}
@ -491,9 +491,9 @@ public class PreferencesDialog
private JTabbedPane getGameplaySettingsTabbedPane() {
final JTabbedPane tabbedPane = new JTabbedPane();
tabbedPane.addTab(UiString.get(_S3), getGameplaySettingsPanel1());
tabbedPane.addTab(UiString.get(_S68), gameImagesPanel);
tabbedPane.addTab(UiString.get(_S82), animationsPanel);
tabbedPane.addTab(MText.get(_S3), getGameplaySettingsPanel1());
tabbedPane.addTab(MText.get(_S68), gameImagesPanel);
tabbedPane.addTab(MText.get(_S82), animationsPanel);
return tabbedPane;
}

View File

@ -6,7 +6,7 @@ import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import magic.data.GeneralConfig;
import magic.translate.UiString;
import magic.translate.MText;
import net.miginfocom.swing.MigLayout;
@SuppressWarnings("serial")
@ -21,13 +21,13 @@ class PreferredSizePanel extends JPanel {
PreferredSizePanel(MouseListener aListener) {
setLayout(new MigLayout("insets 0"));
add(new JLabel(UiString.get(_S1)));
add(new JLabel(MText.get(_S1)));
add(getSizePresetsCombo(aListener));
addMouseListener(aListener);
}
private String getTooltip() {
return UiString.get(_S2);
return MText.get(_S2);
}
private JComboBox<ImageSizePresets> getSizePresetsCombo(MouseListener aListener) {

View File

@ -11,7 +11,7 @@ import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JPanel;
import magic.data.MagicIcon;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.MagicImages;
import magic.ui.MagicSound;
import magic.ui.helpers.UrlHelper;
@ -56,7 +56,7 @@ class ThemesActionPanel extends JPanel {
private JButton getThemeFolderButton(MouseListener aListener) {
JButton btn = new JButton(getActionIcon(MagicIcon.OPEN));
btn.setToolTipText(String.format("<b>%s</b><br>%s", UiString.get(_S1), UiString.get(_S2)));
btn.setToolTipText(String.format("<b>%s</b><br>%s", MText.get(_S1), MText.get(_S2)));
btn.addMouseListener(aListener);
btn.addActionListener(new AbstractAction() {
@Override
@ -69,7 +69,7 @@ class ThemesActionPanel extends JPanel {
private JButton getMoreThemesButton(MouseListener aListener) {
JButton btn = new JButton(getActionIcon(MagicIcon.OPTIONS));
btn.setToolTipText(String.format("<b>%s</b><br>%s", UiString.get(_S3), UiString.get(_S4)));
btn.setToolTipText(String.format("<b>%s</b><br>%s", MText.get(_S3), MText.get(_S4)));
btn.addMouseListener(aListener);
btn.addActionListener(new AbstractAction() {
@Override

View File

@ -8,7 +8,7 @@ import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import magic.data.GeneralConfig;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.theme.Theme;
import magic.ui.theme.ThemeFactory;
import magic.ui.utility.MagicStyle;
@ -26,7 +26,7 @@ class ThemesPanel extends JPanel {
private static final String _S49 = "custom background";
private static final String _S51 = "highlight color";
private static final String READONLY_COLOR_TIP = String.format("<b>%s</b><br>%s", UiString.get(_S1), UiString.get(_S2));
private static final String READONLY_COLOR_TIP = String.format("<b>%s</b><br>%s", MText.get(_S1), MText.get(_S2));
private static final GeneralConfig CONFIG = GeneralConfig.getInstance();
private final JCheckBox customBackgroundCheckBox;
@ -58,7 +58,7 @@ class ThemesPanel extends JPanel {
themeComboBox.setSelectedItem(selectedTheme.getName());
customBackgroundCheckBox = new JCheckBox("", CONFIG.isCustomBackground());
customBackgroundCheckBox.setToolTipText(UiString.get(_S47));
customBackgroundCheckBox.setToolTipText(MText.get(_S47));
customBackgroundCheckBox.setFocusable(false);
customBackgroundCheckBox.addMouseListener(aListener);
@ -72,7 +72,7 @@ class ThemesPanel extends JPanel {
selectedTheme = aTheme;
rollOverColorButton.setColor(MagicStyle.getRolloverColor(aTheme));
rollOverColorButton.setLocked(false);
rollOverColorButton.setToolTipText(UiString.get(_S3));
rollOverColorButton.setToolTipText(MText.get(_S3));
if (aTheme.hasValue(Theme.COLOR_MOUSEOVER)) {
rollOverColorButton.setToolTipText(READONLY_COLOR_TIP);
rollOverColorButton.setLocked(true);
@ -83,9 +83,9 @@ class ThemesPanel extends JPanel {
JPanel panel = new JPanel();
panel.setLayout(new MigLayout("flowx, wrap 2"));
panel.add(rollOverColorButton, "w 24!");
panel.add(new JLabel(UiString.get(_S51)));
panel.add(new JLabel(MText.get(_S51)));
panel.add(customBackgroundCheckBox, "w 24!");
panel.add(new JLabel(UiString.get(_S49)));
panel.add(new JLabel(MText.get(_S49)));
return panel;
}

View File

@ -25,7 +25,7 @@ import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.SwingUtilities;
import magic.data.GeneralConfig;
import magic.translate.UiString;
import magic.translate.MText;
import magic.exception.DesktopNotSupportedException;
import magic.ui.ScreenController;
import magic.ui.helpers.UrlHelper;
@ -82,7 +82,7 @@ class TranslationPanel extends JPanel {
}
private void setupHelpMenuItem() {
final JMenuItem menu = new JMenuItem(new AbstractAction(UiString.get(UiString.get(_S17))) {
final JMenuItem menu = new JMenuItem(new AbstractAction(MText.get(MText.get(_S17))) {
@Override
public void actionPerformed(ActionEvent e) {
UrlHelper.openURL(UrlHelper.URL_WIKI + "Translating-Magarena");
@ -92,7 +92,7 @@ class TranslationPanel extends JPanel {
}
private void setupExplorerMenuItem() {
final JMenuItem itemReload = new JMenuItem(new AbstractAction(UiString.get(_S14)) {
final JMenuItem itemReload = new JMenuItem(new AbstractAction(MText.get(_S14)) {
@Override
public void actionPerformed(ActionEvent e) {
try {
@ -153,10 +153,10 @@ class TranslationPanel extends JPanel {
}
// 1. Build strings map from UI.
final Map<Long, String> latestStrings = UiString.getUiStringsMap();
final Map<Long, String> latestStrings = MText.getUiStringsMap();
// 2. load map of escaped strings from translation file.
final Map<Long, String> langStrings = UiString.getEscapedStringsMap(langFile);
final Map<Long, String> langStrings = MText.getEscapedStringsMap(langFile);
// 3. remove entries from 2. missing in 1.
final Set<Long> latestKeys = latestStrings.keySet();
@ -168,13 +168,13 @@ class TranslationPanel extends JPanel {
latestStrings.putAll(langStrings);
// 5. save 1. by overwriting existing translation file.
UiString.createTranslationFile(langFile, latestStrings);
MText.createTranslationFile(langFile, latestStrings);
// 6. open file in default txt editor.
try {
DesktopHelper.openFileInDefaultOsEditor(langFile);
} catch (IOException | DesktopNotSupportedException ex) {
ScreenController.showWarningMessage(UiString.get(_S13, ex));
ScreenController.showWarningMessage(MText.get(_S13, ex));
}
}
@ -185,7 +185,7 @@ class TranslationPanel extends JPanel {
}
private void setupEditMenuItem() {
editMenuItem.setAction(new AbstractAction(UiString.get(_S1)) {
editMenuItem.setAction(new AbstractAction(MText.get(_S1)) {
@Override
public void actionPerformed(ActionEvent e) {
getParent().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
@ -206,15 +206,14 @@ class TranslationPanel extends JPanel {
final String lang = (String) languageCombo.getSelectedItem();
final File langFile = MagicFileSystem.getDataPath(MagicFileSystem.DataPath.TRANSLATIONS).resolve(lang + ".txt").toFile();
if (langFile.exists()) {
if (JOptionPane.showOptionDialog(
ScreenController.getFrame(),
String.format("<html>%s</html>", UiString.get(_S2, lang)),
UiString.get(_S3),
if (JOptionPane.showOptionDialog(ScreenController.getFrame(),
String.format("<html>%s</html>", MText.get(_S2, lang)),
MText.get(_S3),
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE,
null,
new String[]{UiString.get(_S15), UiString.get(_S16)},
UiString.get(_S16)
new String[]{MText.get(_S15), MText.get(_S16)},
MText.get(_S16)
) == JOptionPane.YES_OPTION) {
langFile.delete();
refreshLanguageCombo();
@ -223,7 +222,7 @@ class TranslationPanel extends JPanel {
}
private void setupDeleteMenuItem() {
deleteMenuItem.setAction(new AbstractAction(UiString.get(_S4)) {
deleteMenuItem.setAction(new AbstractAction(MText.get(_S4)) {
@Override
public void actionPerformed(ActionEvent e) {
getParent().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
@ -237,16 +236,16 @@ class TranslationPanel extends JPanel {
private void doAddNewTranslationFile() {
try {
final String text = JOptionPane.showInputDialog(null, UiString.get(_S5), UiString.get(_S6), JOptionPane.QUESTION_MESSAGE);
final String text = JOptionPane.showInputDialog(null, MText.get(_S5), MText.get(_S6), JOptionPane.QUESTION_MESSAGE);
if (text != null) {
final String language = text.trim();
if (language.isEmpty() == false && language.equalsIgnoreCase("English") == false) {
File langFile = MagicFileSystem.getDataPath(MagicFileSystem.DataPath.TRANSLATIONS).resolve(language + ".txt").toFile();
if (langFile.exists()) {
ScreenController.showWarningMessage(UiString.get(_S7));
ScreenController.showWarningMessage(MText.get(_S7));
return;
}
UiString.createTranslationFIle(langFile);
MText.createTranslationFIle(langFile);
DesktopHelper.openFileInDefaultOsEditor(langFile);
SwingUtilities.invokeLater(new Runnable() {
@Override
@ -256,20 +255,20 @@ class TranslationPanel extends JPanel {
}
});
} else {
ScreenController.showWarningMessage(UiString.get(_S8));
ScreenController.showWarningMessage(MText.get(_S8));
}
}
} catch (FileNotFoundException ex) {
ScreenController.showWarningMessage(UiString.get(_S9, ex));
ScreenController.showWarningMessage(MText.get(_S9, ex));
} catch (IOException | DesktopNotSupportedException ex) {
ScreenController.showWarningMessage(UiString.get(_S10, ex));
ScreenController.showWarningMessage(MText.get(_S10, ex));
} catch (URISyntaxException ex) {
ScreenController.showWarningMessage(UiString.get(_S11, ex));
ScreenController.showWarningMessage(MText.get(_S11, ex));
}
}
private void setupNewMenuItem() {
newMenuItem.setAction(new AbstractAction(UiString.get(_S12)) {
newMenuItem.setAction(new AbstractAction(MText.get(_S12)) {
@Override
public void actionPerformed(ActionEvent e) {
getParent().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));

View File

@ -4,7 +4,7 @@ import java.awt.Desktop;
import java.io.File;
import java.io.IOException;
import magic.exception.DesktopNotSupportedException;
import magic.translate.UiString;
import magic.translate.MText;
import magic.utility.MagicFileSystem;
import magic.utility.MagicSystem;
@ -48,7 +48,7 @@ public final class DesktopHelper {
Desktop.getDesktop().open(file.getAbsoluteFile());
}
} else {
throw new DesktopNotSupportedException(UiString.get(_S1));
throw new DesktopNotSupportedException(MText.get(_S1));
}
}

View File

@ -4,7 +4,7 @@ import java.util.List;
import javax.swing.SwingWorker;
import magic.cardBuilder.renderers.CardBuilder;
import magic.model.MagicCardDefinition;
import magic.translate.UiString;
import magic.translate.MText;
import magic.utility.MagicSystem;
class ScreenLoaderWorker extends SwingWorker<Void, String> {
@ -30,12 +30,12 @@ class ScreenLoaderWorker extends SwingWorker<Void, String> {
protected Void doInBackground() throws Exception {
if (needsCardData) {
publish(UiString.get(_S1));
publish(MText.get(_S1));
MagicSystem.loadCards.get();
}
if (needsCardBuilder) {
publish(UiString.get(_S2));
publish(MText.get(_S2));
// Force CB to initialize.
CardBuilder.getCardBuilderImage(MagicCardDefinition.UNKNOWN);
}

View File

@ -6,7 +6,7 @@ import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.Timer;
import magic.translate.UiString;
import magic.translate.MText;
import net.miginfocom.swing.MigLayout;
@SuppressWarnings("serial")
@ -25,7 +25,7 @@ class AboutHeaderPanel extends JPanel {
setOpaque(false);
JLabel lbl = new JLabel(UiString.get(_S3));
JLabel lbl = new JLabel(MText.get(_S3));
lbl.setHorizontalAlignment(SwingConstants.CENTER);
lbl.setForeground(Color.WHITE);
lbl.setFont(new Font("Monospaced", Font.PLAIN, 12));
@ -48,10 +48,10 @@ class AboutHeaderPanel extends JPanel {
private String getHeapUtilizationStats() {
final float mb = 1024 * 1024;
final Runtime runtime = Runtime.getRuntime();
String s1 = UiString.get(_S5, (runtime.totalMemory() - runtime.freeMemory()) / mb);
String s2 = UiString.get(_S6, runtime.freeMemory() / mb);
String s3 = UiString.get(_S7, runtime.totalMemory() / mb);
String s4 = UiString.get(_S8, runtime.maxMemory() / mb);
String s1 = MText.get(_S5, (runtime.totalMemory() - runtime.freeMemory()) / mb);
String s2 = MText.get(_S6, runtime.freeMemory() / mb);
String s3 = MText.get(_S7, runtime.totalMemory() / mb);
String s4 = MText.get(_S8, runtime.maxMemory() / mb);
return s1 + " • " + s2 + " • " + s3 + " • " + s4;
}

View File

@ -1,6 +1,6 @@
package magic.ui.screen.about;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.screen.HeaderFooterScreen;
@SuppressWarnings("serial")
@ -10,7 +10,7 @@ public class AboutScreen extends HeaderFooterScreen {
private static final String _S1 = "About...";
public AboutScreen() {
super(UiString.get(_S1));
super(MText.get(_S1));
setHeaderContent(new AboutHeaderPanel());
setMainContent(new AboutContentPanel());
addToFooter(new LicenseButton());

View File

@ -3,7 +3,7 @@ package magic.ui.screen.about;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import magic.data.MagicIcon;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.MagicImages;
import magic.ui.ScreenController;
import magic.ui.screen.widget.ActionBarButton;
@ -18,14 +18,14 @@ class LicenseButton extends ActionBarButton {
LicenseButton() {
super(MagicImages.getIcon(MagicIcon.SCROLL),
UiString.get(_S11),
UiString.get(_S12),
MText.get(_S11),
MText.get(_S12),
new AbstractAction() {
@Override
public void actionPerformed(final ActionEvent e) {
ScreenController.showInfoMessage(String.format("<html><b>%s</b><br>%s<html>",
UiString.get(_S9),
UiString.get(_S10))
MText.get(_S9),
MText.get(_S10))
);
}
}

View File

@ -10,7 +10,7 @@ import javax.swing.AbstractAction;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import magic.model.MagicCardDefinition;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.widget.duel.viewer.CardViewer;
import magic.ui.dialog.prefs.ImageSizePresets;
import magic.ui.widget.M.MScrollPane;
@ -29,7 +29,7 @@ public class CardPanel extends JPanel {
private final CardViewer cardViewer;
private final MScrollPane cardScrollPane;
private final CardDecksPanel decksPanel = new CardDecksPanel();
private final SplitterButton decksButton = new SplitterButton(UiString.get(_S1, 0));
private final SplitterButton decksButton = new SplitterButton(MText.get(_S1, 0));
private boolean isImageVisible = true;
public CardPanel() {
@ -47,22 +47,20 @@ public class CardPanel extends JPanel {
cardScrollPane.setVScrollBarIncrement(10);
decksPanel.setOpaque(false);
decksPanel.addPropertyChangeListener(
CardDecksPanel.CP_DECKS_UPDATED,
decksPanel.addPropertyChangeListener(CardDecksPanel.CP_DECKS_UPDATED,
new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
final int deckCount = (int) evt.getNewValue();
decksButton.setText(UiString.get(_S1, deckCount));
decksButton.setText(MText.get(_S1, deckCount));
decksButton.setForeground(deckCount > 0 ? Color.WHITE : Color.GRAY);
}
}
);
decksButton.setToolTipText(
String.format("<html><b>%s</b><br>%s</html>",
UiString.get(_S2),
UiString.get(_S3)));
decksButton.setToolTipText(String.format("<html><b>%s</b><br>%s</html>",
MText.get(_S2),
MText.get(_S3)));
decksButton.addActionListener(new AbstractAction() {
@Override
@ -98,7 +96,7 @@ public class CardPanel extends JPanel {
}
decksButton.setForeground(Color.GRAY);
decksButton.setText(UiString.get(_S4));
decksButton.setText(MText.get(_S4));
cardViewer.setCard(aCardDef);
decksPanel.setCard(aCardDef);

View File

@ -8,7 +8,7 @@ import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import magic.translate.StringContext;
import magic.translate.UiString;
import magic.translate.MText;
import net.miginfocom.swing.MigLayout;
@SuppressWarnings("serial")
@ -50,10 +50,10 @@ public class ExplorerHeaderPanel extends JPanel {
}
public void refreshTotals(int total, int playable, int missing) {
totals1.setText(UiString.get(_S9,
totals1.setText(MText.get(_S9,
NumberFormat.getInstance().format(total))
);
totals2.setText(UiString.get(_S10,
totals2.setText(MText.get(_S10,
getCountCaption(total, playable),
getCountCaption(total, missing))
);

View File

@ -2,7 +2,7 @@ package magic.ui.screen.card.explorer;
import magic.data.MagicIcon;
import magic.data.MagicSetDefinitions;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.MagicLogs;
import magic.ui.WikiPage;
import magic.ui.screen.widget.MenuButton;
@ -24,7 +24,7 @@ public class ExplorerScreen extends HeaderFooterScreen {
private ExplorerHeaderPanel headerPanel;
public ExplorerScreen() {
super(UiString.get(_S1));
super(MText.get(_S1));
useLoadingScreen(this::initUI);
}
@ -43,15 +43,14 @@ public class ExplorerScreen extends HeaderFooterScreen {
}
private void setFooterButtons() {
addToFooter(
MenuButton.build(this::doShowScriptScreen,
MagicIcon.EDIT, UiString.get(_S3), UiString.get(_S4)
addToFooter(MenuButton.build(this::doShowScriptScreen,
MagicIcon.EDIT, MText.get(_S3), MText.get(_S4)
),
MenuButton.build(this::doSelectRandomCard,
MagicIcon.RANDOM, UiString.get(_S5), UiString.get(_S6)
MagicIcon.RANDOM, MText.get(_S5), MText.get(_S6)
),
MenuButton.build(this::doSwitchLayout,
MagicIcon.LAYOUT, UiString.get(_S7), UiString.get(_S8)
MagicIcon.LAYOUT, MText.get(_S7), MText.get(_S8)
)
);
}

View File

@ -2,7 +2,7 @@ package magic.ui.screen.card.script;
import magic.data.MagicIcon;
import magic.model.MagicCardDefinition;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.helpers.UrlHelper;
import magic.ui.screen.widget.MenuButton;
import magic.utility.MagicSystem;
@ -23,7 +23,7 @@ public class CardScriptScreen extends HeaderFooterScreen {
private final ScriptContentPanel content;
public CardScriptScreen(final MagicCardDefinition card) {
super(UiString.get(_S1));
super(MText.get(_S1));
content = new ScriptContentPanel(card);
setMainContent(content);
setFooterButtons();
@ -32,11 +32,11 @@ public class CardScriptScreen extends HeaderFooterScreen {
private void setFooterButtons() {
addToFooter(MenuButton.build(this::openFiremindWebpage,
MagicIcon.FIREMIND, UiString.get(_S5), UiString.get(_S6))
MagicIcon.FIREMIND, MText.get(_S5), MText.get(_S6))
);
if (MagicSystem.isDevMode()) {
addToFooter(MenuButton.build(this::doReloadScript,
MagicIcon.REFRESH, UiString.get(_S3), UiString.get(_S4))
MagicIcon.REFRESH, MText.get(_S3), MText.get(_S4))
);
}
}

View File

@ -6,7 +6,7 @@ import magic.data.MagicIcon;
import magic.model.MagicCardDefinition;
import magic.model.MagicDeck;
import magic.ui.ScreenController;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.screen.interfaces.IDeckConsumer;
import magic.ui.screen.widget.MenuButton;
import magic.ui.widget.deck.DeckStatusPanel;
@ -29,15 +29,14 @@ public class DeckViewScreen extends HeaderFooterScreen
private final DeckStatusPanel deckStatusPanel = new DeckStatusPanel();
public DeckViewScreen(final MagicDeck deck, final MagicCardDefinition selectedCard) {
super(UiString.get(_S8));
super(MText.get(_S8));
screenContent = new DeckViewPanel(deck, selectedCard);
setMainContent(screenContent);
setHeaderContent(deckStatusPanel);
addToFooter(
MenuButton.build(this::showSampleHand,
MagicIcon.HAND_ICON, UiString.get(_S2), UiString.get(_S3)),
addToFooter(MenuButton.build(this::showSampleHand,
MagicIcon.HAND_ICON, MText.get(_S2), MText.get(_S3)),
MenuButton.build(this::showDeckImageView,
MagicIcon.TILED, UiString.get(_S5), UiString.get(_S6))
MagicIcon.TILED, MText.get(_S5), MText.get(_S6))
);
setDeck(deck);
}
@ -50,7 +49,7 @@ public class DeckViewScreen extends HeaderFooterScreen
if (screenContent.getDeck().size() >= 7) {
ScreenController.showSampleHandScreen(screenContent.getDeck());
} else {
showInvalidActionMessage(UiString.get(_S4));
showInvalidActionMessage(MText.get(_S4));
}
}
@ -58,7 +57,7 @@ public class DeckViewScreen extends HeaderFooterScreen
if (screenContent.getDeck().size() > 0) {
ScreenController.showDeckTiledCardsScreen(screenContent.getDeck());
} else {
showInvalidActionMessage(UiString.get(_S7));
showInvalidActionMessage(MText.get(_S7));
}
}

View File

@ -18,7 +18,7 @@ import magic.model.MagicCardDefinition;
import magic.model.MagicDeck;
import magic.ui.MagicSound;
import magic.ui.ScreenController;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.widget.cards.table.BasicDeckTablePanel;
import magic.ui.dialog.RandomDeckGeneratorDialog;
import magic.ui.screen.widget.ActionBarButton;
@ -184,8 +184,8 @@ class CardPoolViewPanel extends JPanel implements IDeckEditorView, FocusListener
private ActionBarButton getRandomDeckActionButton() {
return new ActionBarButton(
MagicImages.getIcon(MagicIcon.RANDOM),
UiString.get(_S1),
UiString.get(_S2),
MText.get(_S1),
MText.get(_S2),
new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {

View File

@ -8,7 +8,7 @@ import javax.swing.JPanel;
import javax.swing.SwingConstants;
import magic.data.MagicIcon;
import magic.ui.MagicImages;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.screen.widget.ActionBarButton;
import magic.ui.FontsAndBorders;
import net.miginfocom.swing.MigLayout;
@ -44,20 +44,20 @@ class CardQuantityActionPanel extends JPanel {
addButton = new ActionBarButton(
MagicImages.getIcon(MagicIcon.PLUS_ICON),
UiString.get(_S1),
UiString.get(_S2),
MText.get(_S1),
MText.get(_S2),
plusButtonAction);
minusButton = new ActionBarButton(
MagicImages.getIcon(MagicIcon.MINUS_ICON),
UiString.get(_S3),
UiString.get(String.format("%s<br>%s", UiString.get(_S4), UiString.get(_S9))),
MText.get(_S3),
MText.get(String.format("%s<br>%s", MText.get(_S4), MText.get(_S9))),
minusButtonAction);
incrementButton = new ActionBarButton(
MagicImages.getIcon(MagicIcon.ARROWUP),
UiString.get(_S5),
UiString.get(_S6),
MText.get(_S5),
MText.get(_S6),
new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
@ -70,8 +70,8 @@ class CardQuantityActionPanel extends JPanel {
});
decrementButton = new ActionBarButton(
MagicImages.getIcon(MagicIcon.ARROWDOWN),
UiString.get(_S7),
UiString.get(_S8),
MText.get(_S7),
MText.get(_S8),
new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {

View File

@ -26,7 +26,7 @@ import magic.data.MagicIcon;
import magic.model.MagicCardDefinition;
import magic.model.MagicDeck;
import magic.ui.MagicImages;
import magic.translate.UiString;
import magic.translate.MText;
import magic.translate.StringContext;
import magic.ui.FontsAndBorders;
import magic.ui.widget.M.MScrollPane;
@ -103,7 +103,7 @@ public class CardsLegalityPanel extends JPanel {
scrollpane.setBorder(FontsAndBorders.NO_BORDER);
scrollpane.setBackground(Color.WHITE);
titleLabel = new JLabel(UiString.get(_S1));
titleLabel = new JLabel(MText.get(_S1));
titleLabel.setFont(getFont().deriveFont(Font.BOLD));
titleLabel.setHorizontalAlignment(SwingConstants.CENTER);
titleLabel.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.DARK_GRAY));
@ -228,7 +228,7 @@ public class CardsLegalityPanel extends JPanel {
final JLabel lbl = getLegalityIcon(cardLegality);
lbl.setToolTipText(String.format("<html>%s</html>",
UiString.get(_S2,
MText.get(_S2,
cardLegality.getCardName(),
cardLegality.getLegality().getDescription(),
cardLegality.getFormat().getName()))
@ -262,8 +262,8 @@ public class CardsLegalityPanel extends JPanel {
final Graphics2D g2d = (Graphics2D)g.create();
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
g2d.setFont(FontsAndBorders.FONT2);
g2d.drawString(UiString.get(_S3, magicFormat.getName()), 20, 60);
g2d.drawString(UiString.get(_S4, magicFormat.getMinimumDeckSize()), 20, 84);
g2d.drawString(MText.get(_S3, magicFormat.getName()), 20, 60);
g2d.drawString(MText.get(_S4, magicFormat.getMinimumDeckSize()), 20, 84);
g2d.dispose();
}
}

View File

@ -17,7 +17,7 @@ import magic.model.MagicCardDefinition;
import magic.model.MagicDeck;
import magic.ui.MagicFileChoosers;
import magic.ui.ScreenController;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.MagicLogs;
import magic.ui.screen.interfaces.IDeckConsumer;
import magic.ui.screen.widget.MenuButton;
@ -60,7 +60,7 @@ public class DeckEditorScreen extends HeaderFooterScreen
// CTR : opens Deck Editor ready to update passed in deck.
public DeckEditorScreen(final MagicDeck deck) {
super(UiString.get(_S14));
super(MText.get(_S14));
isStandalone = false;
this.deck = deck;
useLoadingScreen(this::initUI);
@ -68,7 +68,7 @@ public class DeckEditorScreen extends HeaderFooterScreen
// CTR : open Deck Editor in standalone mode starting with an empty deck.
public DeckEditorScreen() {
super(UiString.get(_S14));
super(MText.get(_S14));
isStandalone = true;
this.deck = getMostRecentEditedDeck();
useLoadingScreen(this::initUI);
@ -95,7 +95,7 @@ public class DeckEditorScreen extends HeaderFooterScreen
if (screenContent.getDeck().size() >= 7) {
ScreenController.showSampleHandScreen(screenContent.getDeck());
} else {
showInvalidActionMessage(UiString.get(_S10));
showInvalidActionMessage(MText.get(_S10));
}
}
@ -103,23 +103,22 @@ public class DeckEditorScreen extends HeaderFooterScreen
if (screenContent.getDeck().size() > 0) {
ScreenController.showDeckTiledCardsScreen(screenContent.getDeck());
} else {
showInvalidActionMessage(UiString.get(_S13));
showInvalidActionMessage(MText.get(_S13));
}
}
private void setFooterButtons() {
addToFooter(
MenuButton.build(this::loadDeck,
MagicIcon.OPEN, UiString.get(_S4), UiString.get(_S5)
addToFooter(MenuButton.build(this::loadDeck,
MagicIcon.OPEN, MText.get(_S4), MText.get(_S5)
),
MenuButton.build(this::saveDeck,
MagicIcon.SAVE, UiString.get(_S6), UiString.get(_S7)
MagicIcon.SAVE, MText.get(_S6), MText.get(_S7)
),
MenuButton.build(this::showSampleHand,
MagicIcon.HAND_ICON, UiString.get(_S8), UiString.get(_S9)
MagicIcon.HAND_ICON, MText.get(_S8), MText.get(_S9)
),
MenuButton.build(this::showTiledImagesView,
MagicIcon.TILED, UiString.get(_S11), UiString.get(_S12)
MagicIcon.TILED, MText.get(_S11), MText.get(_S12)
)
);
}
@ -147,13 +146,13 @@ public class DeckEditorScreen extends HeaderFooterScreen
}
public MenuButton getLeftAction() {
final String caption = (!isStandalone ? UiString.get(_S1) : UiString.get(_S2));
final String caption = (!isStandalone ? MText.get(_S1) : MText.get(_S2));
return MenuButton.getCloseScreenButton(caption);
}
public MenuButton getRightAction() {
if (!isStandalone) {
return new MenuButton(UiString.get(_S3), new AbstractAction() {
return new MenuButton(MText.get(_S3), new AbstractAction() {
@Override
public void actionPerformed(final ActionEvent e) {
if (screenContent.validateDeck(true) && screenContent.applyDeckUpdates()) {
@ -187,7 +186,7 @@ public class DeckEditorScreen extends HeaderFooterScreen
public void saveDeck() {
if (screenContent.getDeck().size() == 0) {
showInvalidActionMessage(UiString.get(_S15));
showInvalidActionMessage(MText.get(_S15));
return;
}
@ -200,12 +199,11 @@ public class DeckEditorScreen extends HeaderFooterScreen
setSelectedFile(new File(filename + DeckUtils.DECK_EXTENSION));
}
if (isReservedDeckFolder(getSelectedFile().toPath().getParent())) {
ScreenController.showWarningMessage(UiString.get(_S16));
ScreenController.showWarningMessage(MText.get(_S16));
} else if (Files.exists(getSelectedFile().toPath())) {
int response = JOptionPane.showConfirmDialog(
ScreenController.getFrame(),
UiString.get(_S17),
UiString.get(_S18),
int response = JOptionPane.showConfirmDialog(ScreenController.getFrame(),
MText.get(_S17),
MText.get(_S18),
JOptionPane.YES_NO_OPTION);
if (response == JOptionPane.YES_OPTION) {
super.approveSelection();
@ -216,7 +214,7 @@ public class DeckEditorScreen extends HeaderFooterScreen
}
};
final MagicDeck deck = screenContent.getDeck();
fileChooser.setDialogTitle(UiString.get(_S19));
fileChooser.setDialogTitle(MText.get(_S19));
fileChooser.setFileFilter(MagicFileChoosers.DECK_FILEFILTER);
fileChooser.setAcceptAllFileFilterUsed(false);
if (deck != null) {
@ -231,7 +229,7 @@ public class DeckEditorScreen extends HeaderFooterScreen
setDeck(screenContent.getDeck());
setMostRecentDeck(filename);
} else {
ScreenController.showWarningMessage(UiString.get(_S20));
ScreenController.showWarningMessage(MText.get(_S20));
}
}
}

View File

@ -6,7 +6,7 @@ import magic.model.MagicCardDefinition;
import magic.model.MagicDeck;
import magic.model.MagicDeckConstructionRule;
import magic.ui.ScreenController;
import magic.translate.UiString;
import magic.translate.MText;
import magic.utility.MagicSystem;
import net.miginfocom.swing.MigLayout;
@ -83,7 +83,7 @@ public class DeckEditorScreenPanel extends JPanel implements IDeckEditorListener
}
private void notifyUser(final String brokenRules) {
ScreenController.showWarningMessage(UiString.get(_S1, brokenRules));
ScreenController.showWarningMessage(MText.get(_S1, brokenRules));
}
public boolean validateDeck(final boolean notifyUser) {

View File

@ -15,7 +15,7 @@ import magic.model.MagicCardDefinition;
import magic.model.MagicDeck;
import magic.ui.MagicSound;
import magic.ui.ScreenController;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.widget.cards.table.DeckTablePanel;
import magic.ui.screen.widget.ActionBarButton;
import net.miginfocom.swing.MigLayout;
@ -85,8 +85,8 @@ class DeckPanel extends JPanel implements IDeckEditorView {
private ActionBarButton getClearDeckActionButton() {
return new ActionBarButton(
MagicImages.getIcon(MagicIcon.CLEAR),
UiString.get(_S1),
UiString.get(_S2),
MText.get(_S1),
MText.get(_S2),
new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
@ -140,14 +140,13 @@ class DeckPanel extends JPanel implements IDeckEditorView {
private void doClearDeck() {
if (deck.size() > 0) {
final int userResponse = JOptionPane.showOptionDialog(
ScreenController.getFrame(),
String.format("<html>%s<br><br><b>%s</b></html>", UiString.get(_S3), UiString.get(_S4)),
UiString.get(_S5),
final int userResponse = JOptionPane.showOptionDialog(ScreenController.getFrame(),
String.format("<html>%s<br><br><b>%s</b></html>", MText.get(_S3), MText.get(_S4)),
MText.get(_S5),
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE,
null,
new String[] {UiString.get(_S6), UiString.get(_S7)}, UiString.get(_S7));
new String[] {MText.get(_S6), MText.get(_S7)}, MText.get(_S7));
if (userResponse == JOptionPane.YES_OPTION) {
setDeck(null);
}

View File

@ -9,7 +9,7 @@ import javax.swing.JTable;
import magic.model.MagicCardDefinition;
import magic.ui.widget.card.filter.CardFilterPanel;
import magic.ui.ICardFilterPanelListener;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.widget.cards.table.CardTablePanel;
import magic.translate.StringContext;
import net.miginfocom.swing.MigLayout;
@ -108,7 +108,7 @@ class FilteredCardPoolPanel extends JPanel implements ICardFilterPanelListener {
}
private String getCardPoolTitle() {
return UiString.get(_S1, NumberFormat.getInstance().format(cardPool.size()));
return MText.get(_S1, NumberFormat.getInstance().format(cardPool.size()));
}
@Override

View File

@ -20,7 +20,7 @@ import magic.data.MagicPredefinedFormat;
import magic.data.MagicIcon;
import magic.model.MagicDeck;
import magic.ui.MagicImages;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.widget.M.MScrollPane;
import net.miginfocom.swing.MigLayout;
@ -51,7 +51,7 @@ public class FormatsLegalityPanel extends JPanel {
scrollpane.setBackground(Color.WHITE);
scrollpane.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, Color.DARK_GRAY));
titleLabel = new JLabel(UiString.get(_S1));
titleLabel = new JLabel(MText.get(_S1));
titleLabel.setFont(getFont().deriveFont(Font.BOLD));
titleLabel.setHorizontalAlignment(SwingConstants.CENTER);
titleLabel.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, Color.DARK_GRAY));

View File

@ -13,7 +13,7 @@ import magic.data.MagicIcon;
import magic.model.MagicCardDefinition;
import magic.model.MagicDeck;
import magic.ui.MagicImages;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.screen.widget.ActionBarButton;
import magic.ui.widget.TexturedPanel;
import net.miginfocom.swing.MigLayout;
@ -131,15 +131,15 @@ class LegalityPanel extends JPanel implements IDeckEditorView {
setLayout(new MigLayout("gapx 20, aligny center"));
add(getIconLabel(MagicIcon.LEGAL, UiString.get(_S1)));
add(getIconLabel(MagicIcon.ILLEGAL, UiString.get(_S2)));
add(getIconLabel(MagicIcon.BANNED, UiString.get(_S3)));
add(getIconLabel(MagicIcon.RESTRICTED, UiString.get(_S4), UiString.get(_S5)));
add(getIconLabel(MagicIcon.RESTRICTED, UiString.get(_S6),
add(getIconLabel(MagicIcon.LEGAL, MText.get(_S1)));
add(getIconLabel(MagicIcon.ILLEGAL, MText.get(_S2)));
add(getIconLabel(MagicIcon.BANNED, MText.get(_S3)));
add(getIconLabel(MagicIcon.RESTRICTED, MText.get(_S4), MText.get(_S5)));
add(getIconLabel(MagicIcon.RESTRICTED, MText.get(_S6),
String.format("<html><b>%s</b><br>%s<br><i>Relentless Rats</i> %s <i>Shadowborn Apostle</i>.</html>",
UiString.get(_S7),
UiString.get(_S8),
UiString.get(_S9))
MText.get(_S7),
MText.get(_S8),
MText.get(_S9))
));
}

View File

@ -9,7 +9,7 @@ import magic.model.MagicCardDefinition;
import magic.model.MagicDeck;
import magic.ui.MagicSound;
import magic.ui.ScreenController;
import magic.translate.UiString;
import magic.translate.MText;
import net.miginfocom.swing.MigLayout;
@SuppressWarnings("serial")
@ -83,21 +83,21 @@ class MainViewsPanel extends JPanel implements IDeckEditorListener {
private void addToggleButtons() {
toggleButtonsPanel.addToggleButton(UiString.get(_S1), new AbstractAction() {
toggleButtonsPanel.addToggleButton(MText.get(_S1), new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
deckPanel.setDeckTable(deckTable);
setView(deckPanel);
}
});
toggleButtonsPanel.addToggleButton(UiString.get(_S2), new AbstractAction() {
toggleButtonsPanel.addToggleButton(MText.get(_S2), new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
cardPoolPanel.setDeckTable(deckTable);
setView(cardPoolPanel);
}
});
toggleButtonsPanel.addToggleButton(UiString.get(_S3), new AbstractAction() {
toggleButtonsPanel.addToggleButton(MText.get(_S3), new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
recallPanel.setDeckTable(deckTable);
@ -105,7 +105,7 @@ class MainViewsPanel extends JPanel implements IDeckEditorListener {
}
});
if (ScreenController.isDuelActive() == false) {
toggleButtonsPanel.addToggleButton(UiString.get(_S4), new AbstractAction() {
toggleButtonsPanel.addToggleButton(MText.get(_S4), new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
setView(legalityPanel);
@ -113,7 +113,7 @@ class MainViewsPanel extends JPanel implements IDeckEditorListener {
});
}
toggleButtonsPanel.setSelectedToggleButton(UiString.get(_S1));
toggleButtonsPanel.setSelectedToggleButton(MText.get(_S1));
toggleButtonsPanel.refreshLayout();
}

View File

@ -9,7 +9,7 @@ import magic.model.MagicCardList;
import magic.model.MagicDeck;
import magic.model.MagicRandom;
import magic.ui.MagicImages;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.widget.cards.canvas.CardsCanvas.LayoutMode;
import magic.ui.widget.cards.canvas.CardsCanvas;
import magic.ui.screen.widget.MenuButton;
@ -29,7 +29,7 @@ public class SampleHandScreen extends HeaderFooterScreen {
private final DeckStatusPanel deckStatusPanel = new DeckStatusPanel();
public SampleHandScreen(final MagicDeck aDeck) {
super(UiString.get(_S1));
super(MText.get(_S1));
this.deck = aDeck;
useLoadingScreen(this::initUI);
}
@ -48,7 +48,7 @@ public class SampleHandScreen extends HeaderFooterScreen {
deckStatusPanel.setDeck(deck, false);
setHeaderContent(deckStatusPanel);
addToFooter(MenuButton.build(this::dealSampleHand,
MagicIcon.REFRESH, UiString.get(_S3), UiString.get(_S4))
MagicIcon.REFRESH, MText.get(_S3), MText.get(_S4))
);
}

View File

@ -2,7 +2,7 @@ package magic.ui.screen.deck.tiled;
import magic.data.MagicIcon;
import magic.model.MagicType;
import magic.translate.UiString;
import magic.translate.MText;
// translatable strings
class Txt {
@ -32,7 +32,7 @@ enum CardTypeFilter {
private final MagicIcon icon;
private CardTypeFilter(String title, MagicType aType, MagicIcon icon) {
this.title = UiString.get(title);
this.title = MText.get(title);
this.mtype = aType;
this.icon = icon;
}

View File

@ -9,7 +9,7 @@ import magic.model.MagicCard;
import magic.model.MagicCardDefinition;
import magic.model.MagicDeck;
import magic.model.MagicType;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.MagicImages;
import magic.ui.screen.widget.MenuButton;
import magic.ui.screen.widget.SampleHandActionButton;
@ -26,7 +26,7 @@ public class DeckTiledCardsScreen extends HeaderFooterScreen {
private HeaderPanel headerPanel;
public DeckTiledCardsScreen(final MagicDeck aDeck) {
super(UiString.get(_S1));
super(MText.get(_S1));
this.deck = aDeck;
useLoadingScreen(this::initUI);
}

View File

@ -9,7 +9,7 @@ import javax.swing.SwingConstants;
import magic.model.MagicCard;
import magic.model.MagicDeck;
import magic.translate.StringContext;
import magic.translate.UiString;
import magic.translate.MText;
import net.miginfocom.swing.MigLayout;
@SuppressWarnings("serial")
@ -58,9 +58,9 @@ class HeaderPanel extends JPanel {
int cardCount = cards == null ? 0 : cards.size();
if (filter != CardTypeFilter.ALL) {
final int percentage = (int)((cardCount / (double) deck.size()) * 100);
return UiString.get(_S11, filter, cardCount, percentage);
return MText.get(_S11, filter, cardCount, percentage);
} else {
return UiString.get(_S12, filter, cardCount);
return MText.get(_S12, filter, cardCount);
}
}

View File

@ -1,7 +1,7 @@
package magic.ui.screen.decks;
import magic.data.MagicIcon;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.ScreenController;
import magic.ui.widget.deck.DeckStatusPanel;
import magic.ui.dialog.DecksFilterDialog;
@ -32,27 +32,26 @@ public class DecksScreen extends HeaderFooterScreen {
private final DeckStatusPanel deckStatusPanel;
public DecksScreen(final IDeckConsumer deckConsumer) {
super(UiString.get(_S1));
super(MText.get(_S1));
this.deckConsumer = deckConsumer;
deckStatusPanel = new DeckStatusPanel();
screenContent = new ScreenPanel(deckStatusPanel);
setMainContent(screenContent);
setHeaderContent(deckStatusPanel);
setLeftFooter(MenuButton.getCloseScreenButton(UiString.get(_S2)));
setRightFooter(MenuButton.build(this::doSelectDeck, UiString.get(_S3)));
addToFooter(
MenuButton.build(this::showSampleHand,
MagicIcon.HAND_ICON, UiString.get(_S6), UiString.get(_S7)),
setLeftFooter(MenuButton.getCloseScreenButton(MText.get(_S2)));
setRightFooter(MenuButton.build(this::doSelectDeck, MText.get(_S3)));
addToFooter(MenuButton.build(this::showSampleHand,
MagicIcon.HAND_ICON, MText.get(_S6), MText.get(_S7)),
MenuButton.build(this::showDeckImageView,
MagicIcon.TILED, UiString.get(_S10), UiString.get(_S11))
MagicIcon.TILED, MText.get(_S10), MText.get(_S11))
);
}
private void doSelectDeck() {
if (screenContent.getDeck() == null) {
showInvalidActionMessage(UiString.get(_S4));
showInvalidActionMessage(MText.get(_S4));
} else if (screenContent.getDeck().isValid() == false) {
showInvalidActionMessage(UiString.get(_S5));
showInvalidActionMessage(MText.get(_S5));
} else {
deckConsumer.setDeck(screenContent.getDeck(), screenContent.getDeckPath());
ScreenController.closeActiveScreen(false);
@ -61,9 +60,9 @@ public class DecksScreen extends HeaderFooterScreen {
private void showSampleHand() {
if (screenContent.getDeck() == null || screenContent.getDeck().size() < 7) {
showInvalidActionMessage(UiString.get(_S8));
showInvalidActionMessage(MText.get(_S8));
} else if (screenContent.getDeck().isValid() == false) {
showInvalidActionMessage(UiString.get(_S9));
showInvalidActionMessage(MText.get(_S9));
} else {
ScreenController.showSampleHandScreen(screenContent.getDeck());
}
@ -71,9 +70,9 @@ public class DecksScreen extends HeaderFooterScreen {
private void showDeckImageView() {
if (screenContent.getDeck() == null || screenContent.getDeck().isEmpty()) {
showInvalidActionMessage(UiString.get(_S12));
showInvalidActionMessage(MText.get(_S12));
} else if (screenContent.getDeck().isValid() == false) {
showInvalidActionMessage(UiString.get(_S13));
showInvalidActionMessage(MText.get(_S13));
} else {
ScreenController.showDeckTiledCardsScreen(screenContent.getDeck());
}

View File

@ -6,7 +6,7 @@ import javax.swing.JPanel;
import javax.swing.JSplitPane;
import magic.data.DeckType;
import magic.model.MagicDeck;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.widget.cards.table.CardTable;
import magic.ui.widget.deck.DeckStatusPanel;
import magic.ui.widget.duel.viewer.CardViewer;
@ -89,7 +89,7 @@ class ScreenPanel extends JPanel implements IDeckConsumer {
deckFilePath = deckPath;
sidebar.setDeck(deck);
deckTable.setCards(deck);
deckTable.setTitle(UiString.get(_S14, deck.getName(), deck.size()));
deckTable.setTitle(MText.get(_S14, deck.getName(), deck.size()));
deckStatusPanel.setDeck(deck, deck.isValid() || deck.size() > 0);
splitter.setVisible(deck.isValid() || deck.size() > 0);
} else {
@ -97,7 +97,7 @@ class ScreenPanel extends JPanel implements IDeckConsumer {
deckFilePath = null;
sidebar.setDeck(selectedDeck);
deckTable.setCards(deck);
deckTable.setTitle(UiString.get(_S15));
deckTable.setTitle(MText.get(_S15));
deckStatusPanel.setDeck(null, false);
splitter.setVisible(false);
}

View File

@ -15,7 +15,7 @@ import magic.model.MagicGame;
import magic.ui.DuelDecksPanel;
import magic.ui.MagicImages;
import magic.ui.ScreenController;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.screen.widget.DuelSettingsPanel;
import magic.ui.screen.widget.MenuButton;
import magic.ui.screen.widget.SampleHandActionButton;
@ -46,7 +46,7 @@ public class DuelDecksScreen extends HeaderFooterScreen { // IOptionsMenu
private NewGameWorker worker;
public DuelDecksScreen(final MagicDuel duel) {
super(UiString.get(_S1));
super(MText.get(_S1));
screenContent = new DuelDecksPanel(duel);
nextGameButton = new StartGameButton(getStartDuelCaption(), getPlayGameAction());
@ -76,19 +76,18 @@ public class DuelDecksScreen extends HeaderFooterScreen { // IOptionsMenu
setLeftFooter(screenContent.getDuel().getGamesPlayed() == 0
? MenuButton.getCloseScreenButton()
: MenuButton.build(this::doShowMainMenu, UiString.get(_S2))
: MenuButton.build(this::doShowMainMenu, MText.get(_S2))
);
setRightFooter(screenContent.getDuel().isFinished()
? MenuButton.build(this::doRestartDuel, UiString.get(_S3))
? MenuButton.build(this::doRestartDuel, MText.get(_S3))
: nextGameButton
);
// middle actions
if (isNewDuel()) {
addToFooter(
MenuButton.build(this::showDeckEditor,
MagicIcon.DECK, UiString.get(_S5), UiString.get(_S6)
addToFooter(MenuButton.build(this::showDeckEditor,
MagicIcon.DECK, MText.get(_S5), MText.get(_S6)
),
getTiledDeckCardImagesButton(),
SampleHandActionButton.createInstance(getActiveDeck())
@ -99,11 +98,10 @@ public class DuelDecksScreen extends HeaderFooterScreen { // IOptionsMenu
addToFooter(getWinnerButton());
} else { // duel in progress
addToFooter(
getTiledDeckCardImagesButton(),
addToFooter(getTiledDeckCardImagesButton(),
SampleHandActionButton.createInstance(getActiveDeck()),
MenuButton.build(this::doRestartDuel,
MagicIcon.REFRESH, UiString.get(_S10), UiString.get(_S11)
MagicIcon.REFRESH, MText.get(_S10), MText.get(_S11)
)
);
}
@ -111,7 +109,7 @@ public class DuelDecksScreen extends HeaderFooterScreen { // IOptionsMenu
private MenuButton getTiledDeckCardImagesButton() {
return MenuButton.build(this::showTiledDeckCardImages,
MagicIcon.TILED, UiString.get(_S12), UiString.get(_S13));
MagicIcon.TILED, MText.get(_S12), MText.get(_S13));
}
/**
@ -149,7 +147,7 @@ public class DuelDecksScreen extends HeaderFooterScreen { // IOptionsMenu
}
private String getStartDuelCaption() {
return UiString.get(_S4, screenContent.getDuel().getGamesPlayed() + 1);
return MText.get(_S4, screenContent.getDuel().getGamesPlayed() + 1);
}
private boolean isNewDuel() {
@ -170,7 +168,7 @@ public class DuelDecksScreen extends HeaderFooterScreen { // IOptionsMenu
private MenuButton getWinnerButton() {
String winner = screenContent.getDuel().getWinningPlayerProfile().getPlayerName();
return new MenuButton(UiString.get(_S9, winner), new AbstractAction() {
return new MenuButton(MText.get(_S9, winner), new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
// do nothing
@ -195,7 +193,7 @@ public class DuelDecksScreen extends HeaderFooterScreen { // IOptionsMenu
MagicDeckConstructionRule.getRulesText(MagicDeckConstructionRule.checkDeck(aPlayer.getDeck()));
if (brokenRulesText.length() > 0) {
ScreenController.showWarningMessage(UiString.get(_S14, aPlayer.getName(), brokenRulesText));
ScreenController.showWarningMessage(MText.get(_S14, aPlayer.getName(), brokenRulesText));
return false;
}

View File

@ -1,7 +1,7 @@
package magic.ui.screen.duel.decks;
import javax.swing.AbstractAction;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.screen.widget.MenuButton;
@SuppressWarnings("serial")
@ -20,6 +20,6 @@ class StartGameButton extends MenuButton {
@Override
public void setEnabled(boolean b) {
super.setEnabled(b);
setToolTipText(b ? null : UiString.get(_S1));
setToolTipText(b ? null : MText.get(_S1));
}
}

View File

@ -2,7 +2,7 @@ package magic.ui.screen.duel.game;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.ScreenController;
import magic.ui.ScreenOptionsOverlay;
import magic.ui.screen.widget.MenuPanel;
@ -28,23 +28,23 @@ class GameOptionsOverlay extends ScreenOptionsOverlay {
@Override
protected MenuPanel getScreenMenu() {
final MenuPanel menu = new MenuPanel(UiString.get(_S1));
final MenuPanel menu = new MenuPanel(MText.get(_S1));
menu.addMenuItem(UiString.get(_S2), new AbstractAction() {
menu.addMenuItem(MText.get(_S2), new AbstractAction() {
@Override
public void actionPerformed(final ActionEvent e) {
controller.concede();
hideOverlay();
}
});
menu.addMenuItem(UiString.get(_S3), new AbstractAction() {
menu.addMenuItem(MText.get(_S3), new AbstractAction() {
@Override
public void actionPerformed(final ActionEvent e) {
controller.resetGame();
hideOverlay();
}
});
menu.addMenuItem(UiString.get(_S7), new AbstractAction() {
menu.addMenuItem(MText.get(_S7), new AbstractAction() {
@Override
public void actionPerformed(final ActionEvent e) {
hideOverlay();
@ -52,7 +52,7 @@ class GameOptionsOverlay extends ScreenOptionsOverlay {
}
});
menu.addBlankItem();
menu.addMenuItem(UiString.get(_S9), new AbstractAction() {
menu.addMenuItem(MText.get(_S9), new AbstractAction() {
@Override
public void actionPerformed(final ActionEvent e) {
controller.createGameplayReport();
@ -60,7 +60,7 @@ class GameOptionsOverlay extends ScreenOptionsOverlay {
}
});
menu.addBlankItem();
menu.addMenuItem(UiString.get(_S8), new AbstractAction() {
menu.addMenuItem(MText.get(_S8), new AbstractAction() {
@Override
public void actionPerformed(final ActionEvent e) {
hideOverlay();

View File

@ -51,7 +51,7 @@ import magic.model.phase.MagicPhaseType;
import magic.model.target.MagicTarget;
import magic.model.target.MagicTargetNone;
import magic.translate.StringContext;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.IChoiceViewer;
import magic.ui.IPlayerZoneListener;
import magic.ui.MagicFileChoosers;
@ -867,10 +867,9 @@ public class SwingGameController implements IUIGameController {
}
showMessage(MagicSource.NONE,
String.format("{L} %s",
UiString.get(
_S3,
MText.get(_S3,
game.getLosingPlayer(),
gameConceded.get() ? UiString.get(_S1) : UiString.get(_S2)
gameConceded.get() ? MText.get(_S1) : MText.get(_S2)
)
)
);
@ -962,7 +961,7 @@ public class SwingGameController implements IUIGameController {
return new MayChoicePanel(
SwingGameController.this,
source,
UiString.get(_S4, costText)
MText.get(_S4, costText)
);
}
});
@ -999,7 +998,7 @@ public class SwingGameController implements IUIGameController {
return new MayChoicePanel(
SwingGameController.this,
source,
UiString.get(_S5, name, cost.getText()));
MText.get(_S5, name, cost.getText()));
}
});
return kickerPanel.isYesClicked() ? 1 : 0;
@ -1026,9 +1025,9 @@ public class SwingGameController implements IUIGameController {
(player.getHandSize() == DuelConfig.getInstance().getHandSize() &&
GeneralConfig.getInstance().showMulliganScreen());
if (showMulliganScreen) {
return new MulliganChoicePanel(SwingGameController.this, source, UiString.get(_S6), player.getPrivateHand());
return new MulliganChoicePanel(SwingGameController.this, source, MText.get(_S6), player.getPrivateHand());
} else {
return new MayChoicePanel(SwingGameController.this, source, UiString.get(_S6));
return new MayChoicePanel(SwingGameController.this, source, MText.get(_S6));
}
}
});

View File

@ -8,7 +8,7 @@ import java.util.stream.Stream;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import magic.data.MagicIcon;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.ScreenController;
import magic.ui.helpers.KeyEventAction;
import magic.ui.screen.HeaderFooterScreen;
@ -34,10 +34,10 @@ public class GameLogScreen extends HeaderFooterScreen {
private static boolean isBasicLog = true;
private final MTextFileViewer mainView = new MTextFileViewer();
private final JLabel modeLabel = new JLabel(UiString.get(_S1));
private final JLabel modeLabel = new JLabel(MText.get(_S1));
public GameLogScreen() {
super(UiString.get(_S8));
super(MText.get(_S8));
setDefaultProperties();
setHeaderContent(modeLabel);
setMainContent(mainView.component());
@ -58,14 +58,14 @@ public class GameLogScreen extends HeaderFooterScreen {
clearFooterButtons();
if (isBasicLog) {
addToFooter(MenuButton.build(this::showDetailedLog,
MagicIcon.SWAP, UiString.get(_S6), UiString.get(_S7))
MagicIcon.SWAP, MText.get(_S6), MText.get(_S7))
);
modeLabel.setText(UiString.get(_S1));
modeLabel.setText(MText.get(_S1));
} else {
addToFooter(MenuButton.build(this::showBasicLog,
MagicIcon.SWAP, UiString.get(_S4), UiString.get(_S5))
MagicIcon.SWAP, MText.get(_S4), MText.get(_S5))
);
modeLabel.setText(UiString.get(_S2));
modeLabel.setText(MText.get(_S2));
}
}

View File

@ -7,7 +7,7 @@ import javax.swing.JPanel;
import javax.swing.SwingConstants;
import magic.model.MagicGame;
import magic.model.MagicPlayer;
import magic.translate.UiString;
import magic.translate.MText;
import net.miginfocom.swing.MigLayout;
@SuppressWarnings("serial")
@ -45,10 +45,10 @@ class HeaderPanel extends JPanel {
private void setContent(final MagicGame game) {
final MagicPlayer turnPlayer = game.getTurnPlayer();
final MagicPlayer humanPlayer = game.getPlayer(0);
playingFirstLabel.setText(UiString.get(_S6,
playingFirstLabel.setText(MText.get(_S6,
turnPlayer == humanPlayer
? UiString.get(_S7)
: UiString.get(_S8)));
? MText.get(_S7)
: MText.get(_S8)));
refreshLayout();
}

View File

@ -6,7 +6,7 @@ import javax.swing.SwingUtilities;
import magic.data.MagicIcon;
import magic.model.MagicCardList;
import magic.ui.ScreenController;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.widget.cards.canvas.CardsCanvas.LayoutMode;
import magic.ui.widget.cards.canvas.CardsCanvas;
import magic.ui.widget.duel.choice.MulliganChoicePanel;
@ -31,16 +31,16 @@ public class MulliganScreen extends HeaderFooterScreen {
private final MagicCardList hand;
public MulliganScreen(final MulliganChoicePanel choicePanel, final MagicCardList hand) {
super(UiString.get(_S1));
super(MText.get(_S1));
this.choicePanel = choicePanel;
this.hand = hand;
isActive = true;
setMainContent(getScreenContent(hand));
setHeaderContent(new HeaderPanel(choicePanel.getGameController().getGame()));
setLeftFooter(MenuButton.build(this::doCancel, UiString.get(_S2)));
setRightFooter(MenuButton.build(this::doNextAction, UiString.get(_S3)));
setLeftFooter(MenuButton.build(this::doCancel, MText.get(_S2)));
setRightFooter(MenuButton.build(this::doNextAction, MText.get(_S3)));
addToFooter(MenuButton.build(this::doMulligan,
MagicIcon.MULLIGAN, UiString.get(_S1), UiString.get(_S5))
MagicIcon.MULLIGAN, MText.get(_S1), MText.get(_S5))
);
setWikiPage(WikiPage.MULLIGAN);
KeyEventAction.doAction(this, this::doCancel)

View File

@ -3,7 +3,7 @@ package magic.ui.screen.duel.player;
import magic.model.player.AiProfile;
import magic.model.player.PlayerProfile;
import magic.translate.StringContext;
import magic.translate.UiString;
import magic.translate.MText;
@SuppressWarnings("serial")
class AiPlayerJList extends PlayersJList {
@ -18,8 +18,8 @@ class AiPlayerJList extends PlayersJList {
final AiProfile profile = (AiProfile) aProfile;
return String.format("<html>%s<br>%s: %d, %s: %d</html>",
profile.getAiType(),
UiString.get(_S2), profile.getAiLevel(),
UiString.get(_S3), profile.getExtraLife());
MText.get(_S2), profile.getAiLevel(),
MText.get(_S3), profile.getExtraLife());
}
}

View File

@ -8,7 +8,7 @@ import javax.swing.SwingConstants;
import javax.swing.border.Border;
import magic.model.player.PlayerStatistics;
import magic.translate.StringContext;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.FontsAndBorders;
import net.miginfocom.swing.MigLayout;
@ -54,14 +54,14 @@ class PlayerMiniStatsPanel extends JPanel {
migLayout.setColumnConstraints("[][40!]");
// stats table
add(new JLabel());
add(getStatsLabel(UiString.get(_S1)), "w 100%");
add(getStatsLabel(UiString.get(_S2)), "w 100%");
add(getStatsLabel(UiString.get(_S3)), "w 100%");
add(getStatsLabel(UiString.get(_S4)), "w 60!");
add(getStatsLabel(MText.get(_S1)), "w 100%");
add(getStatsLabel(MText.get(_S2)), "w 100%");
add(getStatsLabel(MText.get(_S3)), "w 100%");
add(getStatsLabel(MText.get(_S4)), "w 60!");
add(getStatsLabel(stats.getDuelsPlayed().toString()), "w 100%");
add(getStatsLabel(stats.getDuelsWon().toString()), "w 100%");
add(getStatsLabel(stats.getDuelsLost().toString()), "w 100%");
add(getStatsLabel(UiString.get(_S5)), "w 60!");
add(getStatsLabel(MText.get(_S5)), "w 60!");
add(getStatsLabel(stats.getGamesPlayed().toString()), "w 100%");
add(getStatsLabel(stats.getGamesWon().toString()), "w 100%");
add(getStatsLabel(stats.getGamesLost().toString()), "w 100%");

View File

@ -7,7 +7,7 @@ import magic.model.player.AiProfile;
import magic.model.player.IPlayerProfileListener;
import magic.model.player.PlayerProfile;
import magic.model.player.PlayerProfiles;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.dialog.AiPropertiesDialog;
@SuppressWarnings("serial")
@ -17,7 +17,7 @@ public class SelectAiPlayerScreen extends SelectPlayerScreen {
private static final String _S1 = "Select AI Player";
public SelectAiPlayerScreen(final IPlayerProfileListener listener, final PlayerProfile playerProfile) {
super(UiString.get(_S1), new AiPlayerJList());
super(MText.get(_S1), new AiPlayerJList());
addListener(listener);
refreshProfilesJList(playerProfile);
}

View File

@ -8,7 +8,7 @@ import magic.model.player.HumanProfile;
import magic.model.player.IPlayerProfileListener;
import magic.model.player.PlayerProfile;
import magic.model.player.PlayerProfiles;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.ScreenController;
@SuppressWarnings("serial")
@ -21,7 +21,7 @@ public class SelectHumanPlayerScreen extends SelectPlayerScreen {
private static final String _S4 = "Update Player";
public SelectHumanPlayerScreen(final IPlayerProfileListener listener, final PlayerProfile playerProfile) {
super(UiString.get(_S1), new HumanPlayerJList());
super(MText.get(_S1), new HumanPlayerJList());
addListener(listener);
refreshProfilesJList(playerProfile);
}
@ -43,10 +43,9 @@ public class SelectHumanPlayerScreen extends SelectPlayerScreen {
@Override
protected void doNewPlayerAction() {
final String newName = (String) JOptionPane.showInputDialog(
ScreenController.getFrame(),
String.format("<html><b>%s</b><br></html>", UiString.get(_S2)),
UiString.get(_S3),
final String newName = (String) JOptionPane.showInputDialog(ScreenController.getFrame(),
String.format("<html><b>%s</b><br></html>", MText.get(_S2)),
MText.get(_S3),
JOptionPane.PLAIN_MESSAGE,
null, null, null);
if (newName != null && !newName.trim().isEmpty()) {
@ -60,10 +59,9 @@ public class SelectHumanPlayerScreen extends SelectPlayerScreen {
@Override
protected void doEditPlayerAction() {
final PlayerProfile profile = getSelectedPlayer();
final String newName = (String) JOptionPane.showInputDialog(
ScreenController.getFrame(),
String.format("<html><b>%s</b><br></html>", UiString.get(_S2)),
UiString.get(_S4),
final String newName = (String) JOptionPane.showInputDialog(ScreenController.getFrame(),
String.format("<html><b>%s</b><br></html>", MText.get(_S2)),
MText.get(_S4),
JOptionPane.PLAIN_MESSAGE,
null, null, profile.getPlayerName());
if (newName != null && !newName.trim().isEmpty()) {

View File

@ -25,7 +25,7 @@ import javax.swing.SwingUtilities;
import magic.model.player.IPlayerProfileListener;
import magic.model.player.PlayerProfile;
import magic.model.player.PlayerProfiles;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.FontsAndBorders;
import magic.ui.MagicImages;
import magic.ui.ScreenController;
@ -88,17 +88,16 @@ public abstract class SelectPlayerScreen extends HeaderFooterScreen
private void setFooter() {
setLeftFooter(MenuButton.getCloseScreenButton(UiString.get(_S7)));
setRightFooter(MenuButton.build(this::doNextAction, UiString.get(_S9)));
addToFooter(
MenuButton.build(this::doEditPlayerAction,
UiString.get(_S10), UiString.get(_S11)
setLeftFooter(MenuButton.getCloseScreenButton(MText.get(_S7)));
setRightFooter(MenuButton.build(this::doNextAction, MText.get(_S9)));
addToFooter(MenuButton.build(this::doEditPlayerAction,
MText.get(_S10), MText.get(_S11)
),
MenuButton.build(this::doNewPlayerAction,
UiString.get(_S12), UiString.get(_S13)
MText.get(_S12), MText.get(_S13)
),
MenuButton.build(this::deleteSelectedPlayer,
UiString.get(_S6), UiString.get(_S15)
MText.get(_S6), MText.get(_S15)
),
new SelectAvatarActionButton()
);
@ -164,7 +163,7 @@ public abstract class SelectPlayerScreen extends HeaderFooterScreen
protected class SelectAvatarActionButton extends ActionBarButton {
public SelectAvatarActionButton() {
super(UiString.get(_S1), UiString.get(_S2), new SelectAvatarAction());
super(MText.get(_S1), MText.get(_S2), new SelectAvatarAction());
}
}
@ -176,17 +175,16 @@ public abstract class SelectPlayerScreen extends HeaderFooterScreen
}
private boolean isDeletePlayerConfirmedByUser(final PlayerProfile profile) {
final int action = JOptionPane.showOptionDialog(
ScreenController.getFrame(),
final int action = JOptionPane.showOptionDialog(ScreenController.getFrame(),
String.format("<html>%s<br>%s<br><br><b>%s</b></html>",
UiString.get(_S4, profile.getPlayerName()),
UiString.get(_S16),
UiString.get(_S17)),
UiString.get(_S5),
MText.get(_S4, profile.getPlayerName()),
MText.get(_S16),
MText.get(_S17)),
MText.get(_S5),
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE,
null,
new String[]{UiString.get(_S6), UiString.get(_S7)}, UiString.get(_S7));
new String[]{MText.get(_S6), MText.get(_S7)}, MText.get(_S7));
return (action == JOptionPane.YES_OPTION);
}
@ -199,7 +197,7 @@ public abstract class SelectPlayerScreen extends HeaderFooterScreen
notifyPlayerDeleted(condemnedPlayer);
}
} else {
ScreenController.showWarningMessage(UiString.get(_S3));
ScreenController.showWarningMessage(MText.get(_S3));
}
}

View File

@ -11,7 +11,7 @@ import magic.ui.ScreenController;
import magic.ui.screen.interfaces.IAvatarImageConsumer;
import magic.ui.screen.widget.MenuButton;
import magic.ui.helpers.ImageHelper;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.screen.HeaderFooterScreen;
@SuppressWarnings("serial")
@ -29,13 +29,13 @@ public class AvatarImagesScreen extends HeaderFooterScreen {
private final ContentPanel contentPanel;
public AvatarImagesScreen(final IAvatarImageConsumer consumer) {
super(UiString.get(_S3));
super(MText.get(_S3));
this.consumer = consumer;
this.contentPanel = new ContentPanel(this);
setMainContent(contentPanel);
setLeftFooter(MenuButton.getCloseScreenButton(UiString.get(_S4)));
setLeftFooter(MenuButton.getCloseScreenButton(MText.get(_S4)));
addToFooter(MenuButton.build(this::doOpenAvatarsWebPage,
UiString.get(_S5), UiString.get(_S6))
MText.get(_S5), MText.get(_S6))
);
}
@ -64,7 +64,7 @@ public class AvatarImagesScreen extends HeaderFooterScreen {
g.dispose();
setRightFooter(MenuButton.build(this::doSaveAvatarAndClose,
new ImageIcon(ImageHelper.scale(bi, 46, 46)),
UiString.get(_S1), UiString.get(_S2))
MText.get(_S1), MText.get(_S2))
);
}

View File

@ -12,7 +12,7 @@ import magic.data.DeckType;
import magic.model.MagicColor;
import magic.model.MagicDeckProfile;
import magic.translate.StringContext;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.dialog.DeckChooserDialog;
import magic.ui.helpers.MouseHelper;
import magic.ui.screen.interfaces.IThemeStyle;
@ -77,7 +77,7 @@ class DuelPlayerDeckPanel extends TexturedPanel implements IThemeStyle {
private void setDeckType(final DeckType value) {
deckType = value;
deckTypeLabel.setText(UiString.get(_S1, deckType));
deckTypeLabel.setText(MText.get(_S1, deckType));
deckValueLabel.setText(getFormattedDeckValue());
}
@ -98,13 +98,13 @@ class DuelPlayerDeckPanel extends TexturedPanel implements IThemeStyle {
if (deckType == DeckType.Random) {
switch (deckValue) {
case MagicDeckProfile.ANY_THREE:
return UiString.get(_S2);
return MText.get(_S2);
case MagicDeckProfile.ANY_TWO:
return UiString.get(_S3);
return MText.get(_S3);
case MagicDeckProfile.ANY_ONE:
return UiString.get(_S4);
return MText.get(_S4);
case MagicDeckProfile.ANY_DECK:
return UiString.get(_S5);
return MText.get(_S5);
default:
if (deckValue.length() <= 3) {
return getVerboseColors(deckValue);

View File

@ -14,7 +14,7 @@ import magic.model.player.IPlayerProfileListener;
import magic.model.player.PlayerProfile;
import magic.model.player.PlayerProfiles;
import magic.ui.ScreenController;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.screen.widget.DuelSettingsPanel;
import magic.ui.screen.widget.MenuButton;
import magic.ui.utility.MagicStyle;
@ -40,12 +40,12 @@ public class NewDuelSettingsScreen extends HeaderFooterScreen {
private final ScreenContent content;
public NewDuelSettingsScreen() {
super(UiString.get(_S1));
super(MText.get(_S1));
duelConfig.load();
content = new ScreenContent(duelConfig);
setMainContent(content);
setLeftFooter(MenuButton.getCloseScreenButton(UiString.get(_S2)));
setRightFooter(MenuButton.build(this::doNextAction, UiString.get(_S3)));
setLeftFooter(MenuButton.getCloseScreenButton(MText.get(_S2)));
setRightFooter(MenuButton.build(this::doNextAction, MText.get(_S3)));
setWikiPage(WikiPage.NEW_DUEL);
}
@ -56,7 +56,7 @@ public class NewDuelSettingsScreen extends HeaderFooterScreen {
try {
ScreenController.getFrame().newDuel(duelConfig);
} catch (InvalidDeckException ex) {
ScreenController.showWarningMessage(UiString.get(_S4, ex.getMessage()));
ScreenController.showWarningMessage(MText.get(_S4, ex.getMessage()));
}
}
}
@ -65,15 +65,15 @@ public class NewDuelSettingsScreen extends HeaderFooterScreen {
boolean isEachDeckValid = true;
final StringBuffer sb = new StringBuffer();
if (!content.isDeckValid(0)) {
sb.append(UiString.get(_S5, content.getPlayerProfile(0).getPlayerName())).append("\n");
sb.append(MText.get(_S5, content.getPlayerProfile(0).getPlayerName())).append("\n");
isEachDeckValid = false;
}
if (!content.isDeckValid(1)) {
sb.append(UiString.get(_S5, content.getPlayerProfile(1).getPlayerName()));
sb.append(MText.get(_S5, content.getPlayerProfile(1).getPlayerName()));
isEachDeckValid = false;
}
if (!isEachDeckValid && showErrorDialog) {
sb.insert(0, UiString.get(_S6));
sb.insert(0, MText.get(_S6));
ScreenController.showWarningMessage(sb.toString());
}
return isEachDeckValid;

View File

@ -4,7 +4,7 @@ import java.awt.Color;
import javax.swing.JLabel;
import javax.swing.JPanel;
import magic.model.player.PlayerStatistics;
import magic.translate.UiString;
import magic.translate.MText;
import net.miginfocom.swing.MigLayout;
@SuppressWarnings("serial")
@ -37,31 +37,31 @@ class PlayerStatsPanel extends JPanel {
removeAll();
add(getStatsLabel(UiString.get(_S1)));
add(getStatsLabel(MText.get(_S1)));
add(getStatsLabel(stats.getLastPlayedDate()));
add(getStatsLabel(UiString.get(_S2)));
add(getStatsLabel(MText.get(_S2)));
add(getStatsLabel(stats.getDuelsPlayed()));
add(getStatsLabel(UiString.get(_S3)));
add(getStatsLabel(MText.get(_S3)));
add(getStatsLabel(stats.getDuelsWonLost()));
add(getStatsLabel(UiString.get(_S4)));
add(getStatsLabel(MText.get(_S4)));
add(getStatsLabel(stats.getGamesPlayed()));
add(getStatsLabel(UiString.get(_S5)));
add(getStatsLabel(MText.get(_S5)));
add(getStatsLabel(stats.getGamesWonLost()));
add(getStatsLabel(UiString.get(_S6)));
add(getStatsLabel(MText.get(_S6)));
add(getStatsLabel(stats.getGamesConceded()));
add(getStatsLabel(UiString.get(_S7)));
add(getStatsLabel(MText.get(_S7)));
add(getStatsLabel(stats.getTurnsPlayed()));
add(getStatsLabel(UiString.get(_S8)));
add(getStatsLabel(MText.get(_S8)));
add(getStatsLabel(stats.getAverageTurnsPerGame()));
add(getStatsLabel(UiString.get(_S9)));
add(getStatsLabel(MText.get(_S9)));
add(getStatsLabel(stats.getMostUsedColor()));
revalidate();

View File

@ -12,7 +12,7 @@ import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import magic.data.MagicIcon;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.CardTextLanguage;
import magic.ui.MagicImages;
import magic.ui.helpers.UrlHelper;
@ -53,12 +53,12 @@ class DialogMainPanel extends JPanel implements PropertyChangeListener {
(e) -> { refreshDownloadList(); }
);
backgroundButton = new JButton(UiString.get(_S3));
backgroundButton = new JButton(MText.get(_S3));
backgroundButton.setFocusable(false);
backgroundButton.addActionListener((a) -> { doRunInBackground(); });
hintPanel.addHintSource(backgroundButton, String.format("<b>%s</b><br>%s",
UiString.get(_S3),
UiString.get(_S1))
MText.get(_S3),
MText.get(_S1))
);
buttonsPanel = new ButtonsPanel();
@ -70,11 +70,10 @@ class DialogMainPanel extends JPanel implements PropertyChangeListener {
}
private String getDefaultHint() {
return String.format(
"<b>%s</b><br>%s<br><br><b>%s</b><br>%s<br><br>%s",
DownloadMode.CARDS.toString(), UiString.get(_S6),
DownloadMode.CROPS.toString(), UiString.get(_S7),
UiString.get(_S8)
return String.format("<b>%s</b><br>%s<br><br><b>%s</b><br>%s<br><br>%s",
DownloadMode.CARDS.toString(), MText.get(_S6),
DownloadMode.CROPS.toString(), MText.get(_S7),
MText.get(_S8)
);
}
@ -186,7 +185,7 @@ class DialogMainPanel extends JPanel implements PropertyChangeListener {
}
});
hintPanel.addHintSource(helpButton, String.format("<b>%s</b><br>%s",
UiString.get(_S2), UiString.get(_S4)
MText.get(_S2), MText.get(_S4)
));
setLayout(new MigLayout("insets 0, alignx right, aligny bottom"));

View File

@ -13,7 +13,7 @@ import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JPanel;
import javax.swing.JTextField;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.ScreenController;
import magic.ui.FontsAndBorders;
import magic.ui.widget.M.MFileLink;
@ -65,7 +65,7 @@ public class DirectoryChooser extends JPanel {
private void setupSelectButton() {
selectButton.setText("...");
selectButton.setFont(FontsAndBorders.FONT1);
selectButton.setToolTipText(UiString.get(_S7));
selectButton.setToolTipText(MText.get(_S7));
selectButton.addActionListener(new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
@ -80,7 +80,7 @@ public class DirectoryChooser extends JPanel {
private void setupImagesFolderField() {
imagesFolder.setFile(defaultPath);
imagesFolder.setToolTipText(UiString.get(_S6));
imagesFolder.setToolTipText(MText.get(_S6));
imagesFolder.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createMatteBorder(1, 1, 1, 1, Color.GRAY),
BorderFactory.createEmptyBorder(0, 4, 0, 0))
@ -95,14 +95,14 @@ public class DirectoryChooser extends JPanel {
void addHintSources(HintPanel hintPanel) {
hintPanel.addHintSource(imagesFolder);
hintPanel.addHintSource(selectButton, String.format("<b>%s</b><br>%s",
UiString.get(_S1), UiString.get(_S7)
MText.get(_S1), MText.get(_S7)
));
}
private static class ImagesDirectoryChooser extends JFileChooser {
public ImagesDirectoryChooser(String currentDirectoryPath) {
super(currentDirectoryPath);
setDialogTitle(UiString.get(_S2));
setDialogTitle(MText.get(_S2));
setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
setAcceptAllFileFilterUsed(false);
// disable the folder name textbox (see #803).
@ -114,10 +114,9 @@ public class DirectoryChooser extends JPanel {
if (directoryPath.toFile().getFreeSpace() > MIN_FREE_SPACE) {
super.approveSelection();
} else {
ScreenController.showWarningMessage(
String.format("<html><b>%s</b><br>%s<html>",
UiString.get(_S3),
UiString.get(_S4))
ScreenController.showWarningMessage(String.format("<html><b>%s</b><br>%s<html>",
MText.get(_S3),
MText.get(_S4))
);
}
}

View File

@ -9,7 +9,7 @@ import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.MagicImages;
import magic.ui.ScreenController;
import magic.ui.theme.Theme;
@ -51,7 +51,7 @@ class DownloadDialogPanel extends TexturedPanel implements PropertyChangeListene
}
private JLabel getDialogCaptionLabel() {
final JLabel lbl = new JLabel(UiString.get(_S1));
final JLabel lbl = new JLabel(MText.get(_S1));
lbl.setOpaque(true);
lbl.setBackground(MagicStyle.getTheme().getColor(Theme.COLOR_TITLE_BACKGROUND));
lbl.setForeground(MagicStyle.getTheme().getColor(Theme.COLOR_TITLE_FOREGROUND));

View File

@ -1,6 +1,6 @@
package magic.ui.screen.images.download;
import magic.translate.UiString;
import magic.translate.MText;
enum DownloadMode {
@ -10,7 +10,7 @@ enum DownloadMode {
private final String desc;
private DownloadMode(String aDesc) {
this.desc = UiString.get(aDesc);
this.desc = MText.get(aDesc);
}
@Override

View File

@ -21,7 +21,7 @@ import magic.data.GeneralConfig;
import magic.data.MagicIcon;
import magic.model.MagicCardDefinition;
import magic.ui.MagicImages;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.CardTextLanguage;
import magic.utility.MagicFileSystem;
import net.miginfocom.swing.MigLayout;
@ -39,7 +39,7 @@ abstract class DownloadPanel extends JPanel implements IScanListener, IDownloadL
private final MigLayout migLayout = new MigLayout();
protected final JLabel captionLabel = getCaptionLabel(getProgressCaption());
protected final JButton downloadButton = new JButton();
private final JButton cancelButton = new JButton(UiString.get(_S1));
private final JButton cancelButton = new JButton(MText.get(_S1));
protected final JProgressBar progressBar = new JProgressBar();
private ImagesDownloadList files;

View File

@ -12,7 +12,7 @@ import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.ScreenController;
import magic.ui.FontsAndBorders;
import net.miginfocom.swing.MigLayout;
@ -27,7 +27,7 @@ class ErrorPanel extends JPanel {
ErrorPanel() {
final JButton copyButton = new JButton(UiString.get(_S4));
final JButton copyButton = new JButton(MText.get(_S4));
copyButton.setEnabled(false);
textArea = new JTextArea();
@ -66,7 +66,7 @@ class ErrorPanel extends JPanel {
final Clipboard clip = Toolkit.getDefaultToolkit().getSystemClipboard();
final StringSelection textSelection = new StringSelection(textArea.getText());
clip.setContents(textSelection, null);
ScreenController.showInfoMessage(UiString.get(_S5));
ScreenController.showInfoMessage(MText.get(_S5));
}
});

View File

@ -8,7 +8,7 @@ import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import magic.data.GeneralConfig;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.CardTextLanguage;
import net.miginfocom.swing.MigLayout;
@ -38,13 +38,13 @@ class OptionsPanel extends JPanel {
setLayout(new MigLayout("wrap 2, insets 0", "[right][]"));
// image folder
add(new JLabel(UiString.get(_S1)));
add(new JLabel(MText.get(_S1)));
add(imagesFolderChooser, "w 100%");
// card text language
add(new JLabel(UiString.get(_S2)));
add(new JLabel(MText.get(_S2)));
add(cboCardText);
// download mode
add(getBoldLabel(UiString.get(_S3)));
add(getBoldLabel(MText.get(_S3)));
add(cboDownloadMode);
}
@ -129,7 +129,7 @@ class OptionsPanel extends JPanel {
void addHintSources(HintPanel hintPanel) {
imagesFolderChooser.addHintSources(hintPanel);
hintPanel.addHintSource(cboCardText, String.format("<b>%s</b><br>%s",
UiString.get(_S4), UiString.get(_S5)
MText.get(_S4), MText.get(_S5)
));
}

View File

@ -5,7 +5,7 @@ import java.util.stream.Stream;
import magic.data.CardDefinitions;
import magic.data.GeneralConfig;
import magic.model.MagicCardDefinition;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.CardTextLanguage;
@SuppressWarnings("serial")
@ -21,7 +21,7 @@ class PlayablePanel extends DownloadPanel {
@Override
protected String getProgressCaption() {
return UiString.get(_S1);
return MText.get(_S1);
}
@Override
@ -35,7 +35,7 @@ class PlayablePanel extends DownloadPanel {
@Override
protected String getDownloadButtonCaption() {
return UiString.get(_S2);
return MText.get(_S2);
}
@Override

View File

@ -5,7 +5,7 @@ import java.util.stream.Stream;
import magic.data.CardDefinitions;
import magic.data.GeneralConfig;
import magic.model.MagicCardDefinition;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.CardTextLanguage;
@SuppressWarnings("serial")
@ -21,7 +21,7 @@ class UnimplementedPanel extends DownloadPanel {
@Override
protected String getProgressCaption() {
return UiString.get(_S1);
return MText.get(_S1);
}
@Override
@ -35,7 +35,7 @@ class UnimplementedPanel extends DownloadPanel {
@Override
protected String getDownloadButtonCaption() {
return UiString.get(_S2);
return MText.get(_S2);
}
@Override

View File

@ -2,7 +2,7 @@ package magic.ui.screen.keywords;
import java.awt.event.KeyEvent;
import magic.data.GeneralConfig;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.ScreenController;
import magic.ui.helpers.KeyEventAction;
import magic.ui.screen.HeaderFooterScreen;
@ -15,7 +15,7 @@ public class KeywordsScreen extends HeaderFooterScreen {
private static final String _S1 = "Keywords Glossary";
public KeywordsScreen() {
super(UiString.get(_S1));
super(MText.get(_S1));
setDefaultProperties();
setContent();
}

View File

@ -1,6 +1,6 @@
package magic.ui.screen.menu.help;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.ScreenController;
import magic.ui.helpers.UrlHelper;
import magic.ui.screen.menu.MenuScreenContentPanel;
@ -17,13 +17,13 @@ class HelpMenuContentPanel extends MenuScreenContentPanel {
private static final String _S6 = "Close menu";
HelpMenuContentPanel() {
super(UiString.get(_S1), true);
addMenuItem(UiString.get(_S2), this::onReadMeMenu);
addMenuItem(UiString.get(_S3), this::onOnlineHelpMenu);
addMenuItem(UiString.get(_S4), this::onKeywordsMenu);
addMenuItem(UiString.get(_S5), this::onAboutMenu);
super(MText.get(_S1), true);
addMenuItem(MText.get(_S2), this::onReadMeMenu);
addMenuItem(MText.get(_S3), this::onOnlineHelpMenu);
addMenuItem(MText.get(_S4), this::onKeywordsMenu);
addMenuItem(MText.get(_S5), this::onAboutMenu);
addSpace();
addMenuItem(UiString.get(_S6), this::onCloseMenu);
addMenuItem(MText.get(_S6), this::onCloseMenu);
refreshMenuLayout();
}

View File

@ -8,7 +8,7 @@ import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import magic.data.GeneralConfig;
import magic.ui.ScreenController;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.screen.MScreen;
import magic.ui.screen.widget.MenuPanel;
import magic.utility.MagicFileSystem;
@ -60,15 +60,15 @@ public class StartScreen extends MScreen {
private void setLanguage(String aLanguage) throws FileNotFoundException {
GeneralConfig.getInstance().setTranslation(aLanguage);
UiString.loadTranslationFile();
MText.loadTranslationFile();
GeneralConfig.getInstance().save();
}
private void showLanguageMenu() {
final MenuPanel menuPanel = new MenuPanel(UiString.get(_S1));
final MenuPanel menuPanel = new MenuPanel(MText.get(_S1));
menuPanel.addMenuItem(UiString.get("English"), new AbstractAction() {
menuPanel.addMenuItem(MText.get("English"), new AbstractAction() {
@Override
public void actionPerformed(final ActionEvent ev) {
try {
@ -89,8 +89,7 @@ public class StartScreen extends MScreen {
ScreenController.showImportScreen();
} catch (FileNotFoundException | NumberFormatException ex) {
System.err.println(ex);
ScreenController.showWarningMessage(
String.format("%s\n\n%s", UiString.get(_S2), ex)
ScreenController.showWarningMessage(String.format("%s\n\n%s", MText.get(_S2), ex)
);
}
}

View File

@ -1,7 +1,7 @@
package magic.ui.screen.menu.main;
import magic.exception.InvalidDeckException;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.ScreenController;
import magic.ui.screen.menu.MenuScreenContentPanel;
import magic.ui.widget.alerter.AlertPanel;
@ -23,15 +23,15 @@ class MainMenuContentPanel extends MenuScreenContentPanel {
private static final AlertPanel alertPanel = new AlertPanel();
MainMenuContentPanel() {
super(UiString.get(_S1), false);
addMenuItem(UiString.get(_S2), this::doNewDuel);
addMenuItem(UiString.get(_S3), this::doResumeDuel);
addMenuItem(UiString.get(_S4), this::showExplorerScreen);
addMenuItem(UiString.get(_S5), this::showDeckEditor);
addMenuItem(UiString.get(_S6), this::showSettingsMenu);
addMenuItem(UiString.get(_S7), this::showHelpMenu);
super(MText.get(_S1), false);
addMenuItem(MText.get(_S2), this::doNewDuel);
addMenuItem(MText.get(_S3), this::doResumeDuel);
addMenuItem(MText.get(_S4), this::showExplorerScreen);
addMenuItem(MText.get(_S5), this::showDeckEditor);
addMenuItem(MText.get(_S6), this::showSettingsMenu);
addMenuItem(MText.get(_S7), this::showHelpMenu);
addSpace();
addMenuItem(UiString.get(_S8), this::doShutdown);
addMenuItem(MText.get(_S8), this::doShutdown);
if (MagicSystem.isDevMode()) {
addSpace();
addSpace();

View File

@ -17,7 +17,7 @@ import javax.swing.SwingUtilities;
import magic.ui.ImportWorker;
import magic.ui.MagarenaDirectoryChooser;
import magic.ui.ScreenController;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.screen.widget.MenuButton;
import magic.ui.screen.widget.MenuPanel;
import magic.ui.theme.ThemeFactory;
@ -95,28 +95,28 @@ public class ImportScreen extends MScreen {
ImportMenuPanel() {
super(UiString.get(UiString.get(_S1)));
super(MText.get(MText.get(_S1)));
addMenuItem(UiString.get(UiString.get(_S2)), new AbstractAction() {
addMenuItem(MText.get(MText.get(_S2)), new AbstractAction() {
@Override
public void actionPerformed(final ActionEvent ev) {
doImport();
}
}, UiString.get(_S3));
}, MText.get(_S3));
addMenuItem(UiString.get(UiString.get(_S4)), new AbstractAction() {
addMenuItem(MText.get(MText.get(_S4)), new AbstractAction() {
@Override
public void actionPerformed(final ActionEvent ev) {
ScreenController.showMainMenuScreen();
}
});
addMenuItem(UiString.get(UiString.get(_S5)), new AbstractAction() {
addMenuItem(MText.get(MText.get(_S5)), new AbstractAction() {
@Override
public void actionPerformed(final ActionEvent ev) {
showWikiHelpPage();
}
}, UiString.get(_S6));
}, MText.get(_S6));
refreshLayout();
@ -137,10 +137,10 @@ public class ImportScreen extends MScreen {
public ImportProgressPanel(File aFolder) {
super(UiString.get(UiString.get(_S7)));
super(MText.get(MText.get(_S7)));
cancelButton = new MenuButton(
UiString.get(_S8),
MText.get(_S8),
new AbstractAction() {
@Override
public void actionPerformed(final ActionEvent ev) {

View File

@ -3,7 +3,7 @@ package magic.ui.screen.menu.settings;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import magic.data.GeneralConfig;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.ScreenController;
import magic.ui.dialog.FiremindWorkerDialog;
import magic.ui.theme.ThemeFactory;
@ -31,20 +31,20 @@ class SettingsMenuContentPanel extends MenuScreenContentPanel {
private static FiremindWorkerDialog firemindWorkerDialog;
SettingsMenuContentPanel() {
super(UiString.get(_S1), true);
addMenuItem(UiString.get(_S2), this::showPreferencesDialog);
addMenuItem(UiString.get(_S3), this::showDowloadImagesDialog);
addMenuItem(UiString.get(_S4), this::showFiremindWorkerDialog);
addMenuItem(UiString.get(_S5), this::doToggleFullScreen);
addMenuItem(UiString.get(_S7), this::doResetRestart);
super(MText.get(_S1), true);
addMenuItem(MText.get(_S2), this::showPreferencesDialog);
addMenuItem(MText.get(_S3), this::showDowloadImagesDialog);
addMenuItem(MText.get(_S4), this::showFiremindWorkerDialog);
addMenuItem(MText.get(_S5), this::doToggleFullScreen);
addMenuItem(MText.get(_S7), this::doResetRestart);
addSpace();
addMenuItem(UiString.get(_S6), this::doCloseMenu);
addMenuItem(MText.get(_S6), this::doCloseMenu);
refreshMenuLayout();
}
private void showDowloadImagesDialog() {
if (GeneralConfig.getInstance().getImagesOnDemand()) {
ScreenController.showInfoMessage(UiString.get(_S16));
ScreenController.showInfoMessage(MText.get(_S16));
} else {
ScreenController.showDownloadImagesScreen();
}
@ -59,14 +59,13 @@ class SettingsMenuContentPanel extends MenuScreenContentPanel {
}
private void doResetRestart() {
final int response = JOptionPane.showOptionDialog(
ScreenController.getFrame(),
String.format("<html>%s<br><br><b>%s</b></html>", UiString.get(_S11), UiString.get(_S12)),
UiString.get(_S13),
final int response = JOptionPane.showOptionDialog(ScreenController.getFrame(),
String.format("<html>%s<br><br><b>%s</b></html>", MText.get(_S11), MText.get(_S12)),
MText.get(_S13),
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE,
null,
new String[]{UiString.get(_S14), UiString.get(_S15)}, UiString.get(_S15));
new String[]{MText.get(_S14), MText.get(_S15)}, MText.get(_S15));
if (response == JOptionPane.YES_OPTION) {
setVisible(false);
SwingUtilities.invokeLater(() -> {

View File

@ -11,7 +11,7 @@ import magic.data.DuelConfig;
import magic.data.MagicIcon;
import magic.data.MagicFormat;
import magic.ui.MagicImages;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.dialog.DuelPropertiesDialog;
import magic.ui.helpers.MouseHelper;
import magic.ui.screen.interfaces.IThemeStyle;
@ -65,11 +65,11 @@ public class DuelSettingsPanel extends TexturedPanel implements IThemeStyle {
setBorder(null);
setBackground(FontsAndBorders.TEXTAREA_TRANSPARENT_COLOR_HACK);
setToolTipText(String.format("<html><b>%s</b><br>%s<br>%s<br>%s<br>%s</html>",
UiString.get(_S1),
UiString.get(_S2, startLife),
UiString.get(_S3, handSize),
UiString.get(_S4, maxGames, getGamesRequiredToWinDuel()),
UiString.get(_S5, cube.getLabel())
MText.get(_S1),
MText.get(_S2, startLife),
MText.get(_S3, handSize),
MText.get(_S4, maxGames, getGamesRequiredToWinDuel()),
MText.get(_S5, cube.getLabel())
));
}
}

View File

@ -12,7 +12,7 @@ import javax.swing.JButton;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import magic.data.MagicIcon;
import magic.translate.UiString;
import magic.translate.MText;
import magic.ui.MagicImages;
import magic.ui.ScreenController;
import magic.ui.helpers.ImageHelper;
@ -153,7 +153,7 @@ public class MenuButton extends JButton {
}
public static MenuButton getCloseScreenButton() {
return getCloseScreenButton(UiString.get(_S1));
return getCloseScreenButton(MText.get(_S1));
}
public static MenuButton getTestButton() {

View File

@ -6,7 +6,7 @@ import magic.data.MagicIcon;
import magic.model.MagicDeck;
import magic.ui.MagicImages;
import magic.ui.ScreenController;
import magic.translate.UiString;
import magic.translate.MText;
@SuppressWarnings("serial")
public final class SampleHandActionButton extends ActionBarButton {
@ -21,7 +21,7 @@ public final class SampleHandActionButton extends ActionBarButton {
public static ActionBarButton createInstance(final MagicDeck deck) {
return new ActionBarButton(
MagicImages.getIcon(MagicIcon.HAND_ICON),
UiString.get(_S1), UiString.get(_S2),
MText.get(_S1), MText.get(_S2),
new SampleHandAction(deck));
}
@ -38,7 +38,7 @@ public final class SampleHandActionButton extends ActionBarButton {
if (deck.size() >= 7) {
ScreenController.showSampleHandScreen(deck);
} else {
showInvalidActionMessage(UiString.get(_S3));
showInvalidActionMessage(MText.get(_S3));
}
}

Some files were not shown because too many files have changed in this diff Show More