mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
translate desktop some DragTab
This commit is contained in:
@@ -18,6 +18,7 @@ import forge.toolbox.FOptionPane;
|
||||
import forge.toolbox.FSkin;
|
||||
import forge.toolbox.FSkin.SkinImage;
|
||||
import forge.view.FView;
|
||||
import forge.util.Localizer;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@@ -28,155 +29,155 @@ public class FScreen {
|
||||
public static final FScreen HOME_SCREEN = new FScreen(
|
||||
VHomeUI.SINGLETON_INSTANCE,
|
||||
CHomeUI.SINGLETON_INSTANCE,
|
||||
"Home ",
|
||||
"lblHomeWithSpaces",
|
||||
FSkin.getIcon(FSkinProp.ICO_FAVICON),
|
||||
false,
|
||||
"Exit Forge",
|
||||
"lblExitForge",
|
||||
null,
|
||||
false);
|
||||
public static final FScreen WORKSHOP_SCREEN = new FScreen(
|
||||
VWorkshopUI.SINGLETON_INSTANCE,
|
||||
CWorkshopUI.SINGLETON_INSTANCE,
|
||||
"Workshop",
|
||||
"lblWorkshop",
|
||||
FSkin.getIcon(FSkinProp.ICO_SETTINGS), //TODO: Create icon for workshop screen
|
||||
false,
|
||||
"Back to Home",
|
||||
"lblBacktoHome",
|
||||
ForgeConstants.WORKSHOP_LAYOUT_FILE,
|
||||
false);
|
||||
public static final FScreen DECK_EDITOR_CONSTRUCTED = new FScreen(
|
||||
VDeckEditorUI.SINGLETON_INSTANCE,
|
||||
CDeckEditorUI.SINGLETON_INSTANCE,
|
||||
"Deck Editor ",
|
||||
"lblDeckEditorWithSpaces",
|
||||
FSkin.getImage(FSkinProp.IMG_PACK),
|
||||
false,
|
||||
"Back to Home",
|
||||
"lblBacktoHome",
|
||||
ForgeConstants.EDITOR_LAYOUT_FILE,
|
||||
false);
|
||||
public static final FScreen DECK_EDITOR_ARCHENEMY = new FScreen(
|
||||
VDeckEditorUI.SINGLETON_INSTANCE,
|
||||
CDeckEditorUI.SINGLETON_INSTANCE,
|
||||
"Scheme Deck Editor",
|
||||
"lblSchemeDeckEditor",
|
||||
FSkin.getImage(FSkinProp.IMG_PACK),
|
||||
true,
|
||||
"Close Editor",
|
||||
"lblCloseEditor",
|
||||
ForgeConstants.EDITOR_LAYOUT_FILE,
|
||||
false);
|
||||
public static final FScreen DECK_EDITOR_COMMANDER = new FScreen(
|
||||
VDeckEditorUI.SINGLETON_INSTANCE,
|
||||
CDeckEditorUI.SINGLETON_INSTANCE,
|
||||
"Commander Deck Editor",
|
||||
"lblCommanderDeckEditor",
|
||||
FSkin.getImage(FSkinProp.IMG_PACK),
|
||||
true,
|
||||
"Close Editor",
|
||||
"lblCloseEditor",
|
||||
ForgeConstants.EDITOR_LAYOUT_FILE,
|
||||
false);
|
||||
public static final FScreen DECK_EDITOR_TINY_LEADERS = new FScreen(
|
||||
VDeckEditorUI.SINGLETON_INSTANCE,
|
||||
CDeckEditorUI.SINGLETON_INSTANCE,
|
||||
"Tiny Leaders Deck Editor",
|
||||
"lblTinyLeadersDeckEditor",
|
||||
FSkin.getImage(FSkinProp.IMG_PACK),
|
||||
true,
|
||||
"Close Editor",
|
||||
"lblCloseEditor",
|
||||
ForgeConstants.EDITOR_LAYOUT_FILE,
|
||||
false);
|
||||
public static final FScreen DECK_EDITOR_BRAWL = new FScreen(
|
||||
VDeckEditorUI.SINGLETON_INSTANCE,
|
||||
CDeckEditorUI.SINGLETON_INSTANCE,
|
||||
"Brawl Deck Editor",
|
||||
"lblBrawlDeckEditor",
|
||||
FSkin.getImage(FSkinProp.IMG_PACK),
|
||||
true,
|
||||
"Close Editor",
|
||||
"lblCloseEditor",
|
||||
ForgeConstants.EDITOR_LAYOUT_FILE,
|
||||
false);
|
||||
public static final FScreen DECK_EDITOR_OATHBREAKER = new FScreen(
|
||||
VDeckEditorUI.SINGLETON_INSTANCE,
|
||||
CDeckEditorUI.SINGLETON_INSTANCE,
|
||||
"Oathbreaker Deck Editor",
|
||||
"lblOathbreakerDeckEditor",
|
||||
FSkin.getImage(FSkinProp.IMG_PACK),
|
||||
true,
|
||||
"Close Editor",
|
||||
"lblCloseEditor",
|
||||
ForgeConstants.EDITOR_LAYOUT_FILE,
|
||||
false);
|
||||
public static final FScreen DECK_EDITOR_PLANECHASE = new FScreen(
|
||||
VDeckEditorUI.SINGLETON_INSTANCE,
|
||||
CDeckEditorUI.SINGLETON_INSTANCE,
|
||||
"Planar Deck Editor",
|
||||
"lblPlanarDeckEditor",
|
||||
FSkin.getImage(FSkinProp.IMG_PACK),
|
||||
true,
|
||||
"Close Editor",
|
||||
"lblCloseEditor",
|
||||
ForgeConstants.EDITOR_LAYOUT_FILE,
|
||||
false);
|
||||
public static final FScreen DECK_EDITOR_DRAFT = new FScreen(
|
||||
VDeckEditorUI.SINGLETON_INSTANCE,
|
||||
CDeckEditorUI.SINGLETON_INSTANCE,
|
||||
"Draft Deck Editor",
|
||||
"lblDraftDeckEditor",
|
||||
FSkin.getImage(FSkinProp.IMG_PACK),
|
||||
true,
|
||||
"Close Editor",
|
||||
"lblCloseEditor",
|
||||
ForgeConstants.EDITOR_LAYOUT_FILE,
|
||||
false);
|
||||
public static final FScreen DECK_EDITOR_SEALED = new FScreen(
|
||||
VDeckEditorUI.SINGLETON_INSTANCE,
|
||||
CDeckEditorUI.SINGLETON_INSTANCE,
|
||||
"Sealed Deck Editor",
|
||||
"lblSealedDeckEditor",
|
||||
FSkin.getImage(FSkinProp.IMG_PACK),
|
||||
true,
|
||||
"Close Editor",
|
||||
"lblCloseEditor",
|
||||
ForgeConstants.EDITOR_LAYOUT_FILE,
|
||||
false);
|
||||
public static final FScreen TOKEN_VIEWER = new FScreen(
|
||||
VDeckEditorUI.SINGLETON_INSTANCE,
|
||||
CDeckEditorUI.SINGLETON_INSTANCE,
|
||||
"Token Viewer",
|
||||
"lblTokenViewer",
|
||||
FSkin.getImage(FSkinProp.IMG_PACK),
|
||||
true,
|
||||
"Close Viewer",
|
||||
"lblCloseViewer",
|
||||
ForgeConstants.EDITOR_LAYOUT_FILE,
|
||||
false);
|
||||
|
||||
public static final FScreen DECK_EDITOR_QUEST = new FScreen(
|
||||
VDeckEditorUI.SINGLETON_INSTANCE,
|
||||
CDeckEditorUI.SINGLETON_INSTANCE,
|
||||
"Quest Deck Editor",
|
||||
"lblQuestDeckEditor",
|
||||
FSkin.getImage(FSkinProp.IMG_PACK),
|
||||
true,
|
||||
"Close Editor",
|
||||
"lblCloseEditor",
|
||||
ForgeConstants.EDITOR_LAYOUT_FILE,
|
||||
false);
|
||||
public static final FScreen DECK_EDITOR_QUEST_TOURNAMENT = new FScreen(
|
||||
VDeckEditorUI.SINGLETON_INSTANCE,
|
||||
CDeckEditorUI.SINGLETON_INSTANCE,
|
||||
"Quest Tournament Deck Editor",
|
||||
"lblQuestTournamentDeckEditor",
|
||||
FSkin.getImage(FSkinProp.IMG_PACK),
|
||||
true,
|
||||
"Close Editor",
|
||||
"lblCloseEditor",
|
||||
ForgeConstants.EDITOR_LAYOUT_FILE,
|
||||
false);
|
||||
public static final FScreen QUEST_CARD_SHOP = new FScreen(
|
||||
VDeckEditorUI.SINGLETON_INSTANCE,
|
||||
CDeckEditorUI.SINGLETON_INSTANCE,
|
||||
"Spell Shop",
|
||||
"lblSpellShop",
|
||||
FSkin.getIcon(FSkinProp.ICO_QUEST_BOOK),
|
||||
true,
|
||||
"Leave Shop",
|
||||
"lblLeaveShop",
|
||||
ForgeConstants.EDITOR_LAYOUT_FILE,
|
||||
false);
|
||||
public static final FScreen DRAFTING_PROCESS = new FScreen(
|
||||
VDeckEditorUI.SINGLETON_INSTANCE,
|
||||
CDeckEditorUI.SINGLETON_INSTANCE,
|
||||
"Draft",
|
||||
"lblDraft",
|
||||
FSkin.getImage(FSkinProp.IMG_ZONE_HAND),
|
||||
true,
|
||||
"Leave Draft",
|
||||
"lblLeaveDraft",
|
||||
ForgeConstants.EDITOR_LAYOUT_FILE,
|
||||
false);
|
||||
public static final FScreen QUEST_BAZAAR = new FScreen(
|
||||
VBazaarUI.SINGLETON_INSTANCE,
|
||||
CBazaarUI.SINGLETON_INSTANCE,
|
||||
"Bazaar",
|
||||
"lblBazaar",
|
||||
FSkin.getIcon(FSkinProp.ICO_QUEST_BOTTLES),
|
||||
true,
|
||||
"Leave Bazaar",
|
||||
"lblLeaveBazaar",
|
||||
null,
|
||||
false);
|
||||
|
||||
@@ -194,10 +195,10 @@ public class FScreen {
|
||||
final FileLocation layoutFile0, final boolean isMatch) {
|
||||
this.view = view0;
|
||||
this.controller = controller0;
|
||||
this.tabCaption = tabCaption0;
|
||||
this.tabCaption = Localizer.getInstance().getMessage(tabCaption0);
|
||||
this.tabIcon = tabIcon0;
|
||||
this.allowTabClose = allowTabClose0;
|
||||
this.closeButtonTooltip = closeButtonTooltip0;
|
||||
this.closeButtonTooltip = Localizer.getInstance().getMessage(closeButtonTooltip0);
|
||||
this.layoutFile = layoutFile0;
|
||||
this.isMatch = isMatch;
|
||||
}
|
||||
@@ -206,10 +207,10 @@ public class FScreen {
|
||||
return new FScreen(
|
||||
view,
|
||||
controller,
|
||||
"Game",
|
||||
"lblGame",
|
||||
FSkin.getIcon(FSkinProp.ICO_ALPHASTRIKE), //TODO: Create icon for match screen
|
||||
true,
|
||||
"Concede Game",
|
||||
"lblConcedeGame",
|
||||
ForgeConstants.MATCH_LAYOUT_FILE,
|
||||
true);
|
||||
}
|
||||
@@ -271,7 +272,7 @@ public class FScreen {
|
||||
return true;
|
||||
} catch (final Exception e) {
|
||||
e.printStackTrace();
|
||||
FOptionPane.showErrorDialog("Failed to delete layout file.");
|
||||
FOptionPane.showErrorDialog(Localizer.getInstance().getMessage("txerrFailedtodeletelayoutfile"));
|
||||
}
|
||||
return false;
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import forge.screens.deckeditor.controllers.CProbabilities;
|
||||
import forge.toolbox.FLabel;
|
||||
import forge.toolbox.FScrollPane;
|
||||
import forge.toolbox.FSkin;
|
||||
import forge.util.Localizer;
|
||||
|
||||
/**
|
||||
* Assembles Swing components of deck editor analysis tab.
|
||||
@@ -35,16 +36,16 @@ public enum VProbabilities implements IVDoc<CProbabilities> {
|
||||
|
||||
// Fields used with interface IVDoc
|
||||
private DragCell parentCell;
|
||||
private final DragTab tab = new DragTab("Draw Order");
|
||||
private final DragTab tab = new DragTab(Localizer.getInstance().getMessage("lblDrawOrder"));
|
||||
|
||||
// Title labels
|
||||
private final FLabel lblReshuffle = new FLabel.Builder()
|
||||
.hoverable(true).text("CLICK HERE TO RE-SHUFFLE").tooltip("See a new sample shuffle")
|
||||
.hoverable(true).text(Localizer.getInstance().getMessage("lblClickHereToReshuffle")).tooltip(Localizer.getInstance().getMessage("lblSeeANewSampleShuffle"))
|
||||
.fontSize(16).build();
|
||||
private final FLabel lblSampleHand = new FLabel.Builder().fontStyle(Font.BOLD)
|
||||
.fontSize(12).text("SAMPLE HAND").opaque(true).build();
|
||||
.fontSize(12).text(Localizer.getInstance().getMessage("lblSampleHand")).opaque(true).build();
|
||||
private final FLabel lblRemainingDraws = new FLabel.Builder().fontStyle(Font.BOLD)
|
||||
.fontSize(12).text("REMAINING DRAWS").opaque(true).build();
|
||||
.fontSize(12).text(Localizer.getInstance().getMessage("lblRemainingDraws")).opaque(true).build();
|
||||
// private final JLabel lblExplanation = new FLabel.Builder()
|
||||
// .fontSize(11).text("XX % = frequency that card will appear at that position").build();
|
||||
|
||||
|
||||
@@ -24,12 +24,13 @@ import forge.net.server.FServerManager;
|
||||
import forge.toolbox.FButton;
|
||||
import forge.toolbox.FSkin;
|
||||
import forge.util.gui.SOptionPane;
|
||||
import forge.util.Localizer;
|
||||
|
||||
public enum VSubmenuOnlineLobby implements IVSubmenu<CSubmenuOnlineLobby>, IOnlineLobby, IVTopLevelUI {
|
||||
SINGLETON_INSTANCE;
|
||||
|
||||
private DragCell parentCell;
|
||||
private final DragTab tab = new DragTab("Lobby");
|
||||
private final DragTab tab = new DragTab(Localizer.getInstance().getMessage("lblLobby"));
|
||||
private VLobby lobby;
|
||||
private FGameClient client;
|
||||
|
||||
@@ -63,7 +64,7 @@ public enum VSubmenuOnlineLobby implements IVSubmenu<CSubmenuOnlineLobby>, IOnli
|
||||
container.removeAll();
|
||||
|
||||
if (lobby == null) {
|
||||
final FButton btnConnect = new FButton("Connect to Server");
|
||||
final FButton btnConnect = new FButton(Localizer.getInstance().getMessage("lblConnectToServer"));
|
||||
btnConnect.setFont(FSkin.getRelativeFont(20));
|
||||
btnConnect.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
@@ -137,7 +138,7 @@ public enum VSubmenuOnlineLobby implements IVSubmenu<CSubmenuOnlineLobby>, IOnli
|
||||
|
||||
@Override
|
||||
public String getMenuTitle() {
|
||||
return "Lobby";
|
||||
return Localizer.getInstance().getMessage("lblLobby");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -183,13 +184,13 @@ public enum VSubmenuOnlineLobby implements IVSubmenu<CSubmenuOnlineLobby>, IOnli
|
||||
public boolean onClosing(final FScreen screen) {
|
||||
final FServerManager server = FServerManager.getInstance();
|
||||
if (server.isHosting()) {
|
||||
if (SOptionPane.showConfirmDialog("Leave lobby? Doing so will shut down all connections and stop hosting.", "Leave")) {
|
||||
if (SOptionPane.showConfirmDialog(Localizer.getInstance().getMessage("lblLeaveLobbyDescription"), Localizer.getInstance().getMessage("lblLeave"))) {
|
||||
server.stopServer();
|
||||
FNetOverlay.SINGLETON_INSTANCE.reset();
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (client == null || SOptionPane.showConfirmDialog("Leave lobby?", "Leave")) {
|
||||
if (client == null || SOptionPane.showConfirmDialog(Localizer.getInstance().getMessage("lblLeaveLobbyConfirm"), Localizer.getInstance().getMessage("lblLeave"))) {
|
||||
if (client != null) {
|
||||
client.close();
|
||||
client = null;
|
||||
|
||||
@@ -14,6 +14,7 @@ import forge.toolbox.FLabel;
|
||||
import forge.toolbox.FScrollPane;
|
||||
import forge.toolbox.FSkin;
|
||||
import forge.toolbox.FSkin.SkinImage;
|
||||
import forge.util.Localizer;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -29,7 +30,7 @@ public enum VSubmenuAvatars implements IVSubmenu<CSubmenuAvatars> {
|
||||
|
||||
// Fields used with interface IVDoc
|
||||
private DragCell parentCell;
|
||||
private final DragTab tab = new DragTab("Avatars");
|
||||
private final DragTab tab = new DragTab(Localizer.getInstance().getMessage("lblAvatars"));
|
||||
|
||||
private final JPanel pnlAvatars = new JPanel();
|
||||
|
||||
@@ -64,7 +65,7 @@ public enum VSubmenuAvatars implements IVSubmenu<CSubmenuAvatars> {
|
||||
|
||||
@Override
|
||||
public String getMenuTitle() {
|
||||
return "Avatars";
|
||||
return Localizer.getInstance().getMessage("lblAvatars");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -25,6 +25,7 @@ import forge.screens.match.controllers.CCombat;
|
||||
import forge.toolbox.FSkin;
|
||||
import forge.toolbox.FSkin.SkinnedTextArea;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import forge.util.Localizer;
|
||||
|
||||
/**
|
||||
* Assembles Swing components of combat report.
|
||||
@@ -35,7 +36,7 @@ public class VCombat implements IVDoc<CCombat> {
|
||||
|
||||
// Fields used with interface IVDoc
|
||||
private DragCell parentCell;
|
||||
private final DragTab tab = new DragTab("Combat");
|
||||
private final DragTab tab = new DragTab(Localizer.getInstance().getMessage("lblCombat"));
|
||||
|
||||
private final SkinnedTextArea tar = new SkinnedTextArea();
|
||||
|
||||
@@ -108,7 +109,7 @@ public class VCombat implements IVDoc<CCombat> {
|
||||
// No need to update this unless it's showing
|
||||
if (!this.equals(parentCell.getSelected())) { return; }
|
||||
|
||||
tab.setText(cntAttackers > 0 ? ("Combat : " + cntAttackers) : "Combat");
|
||||
tab.setText(cntAttackers > 0 ? (Localizer.getInstance().getMessage("lblCombat") + " : " + cntAttackers) : Localizer.getInstance().getMessage("lblCombat"));
|
||||
tar.setText(desc);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ import forge.gui.framework.IVDoc;
|
||||
import forge.screens.match.controllers.CDetail;
|
||||
import forge.toolbox.FSkin;
|
||||
import forge.toolbox.FSkin.SkinnedLabel;
|
||||
import forge.util.Localizer;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -40,7 +41,7 @@ public class VDetail implements IVDoc<CDetail> {
|
||||
|
||||
// Fields used with interface IVDoc
|
||||
private DragCell parentCell;
|
||||
private final DragTab tab = new DragTab("Card Detail");
|
||||
private final DragTab tab = new DragTab(Localizer.getInstance().getMessage("lblCardDetail"));
|
||||
|
||||
// Top-level containers
|
||||
private final CardDetailPanel pnlDetail = new CardDetailPanel();
|
||||
|
||||
@@ -39,6 +39,7 @@ import forge.screens.match.GameLogPanel;
|
||||
import forge.screens.match.controllers.CLog;
|
||||
import forge.toolbox.FSkin;
|
||||
import forge.toolbox.FSkin.SkinFont;
|
||||
import forge.util.Localizer;
|
||||
|
||||
/**
|
||||
* Assembles Swing components of game log report.
|
||||
@@ -56,7 +57,7 @@ public class VLog implements IVDoc<CLog> {
|
||||
|
||||
// Fields used with interface IVDoc
|
||||
private DragCell parentCell;
|
||||
private final DragTab tab = new DragTab("Log");
|
||||
private final DragTab tab = new DragTab(Localizer.getInstance().getMessage("lblLog"));
|
||||
|
||||
// Other fields
|
||||
private final GameLogPanel gameLog;
|
||||
|
||||
@@ -26,6 +26,7 @@ import forge.gui.framework.IVDoc;
|
||||
import forge.screens.match.controllers.CPicture;
|
||||
import forge.toolbox.FSkin;
|
||||
import forge.toolbox.FSkin.SkinnedLabel;
|
||||
import forge.util.Localizer;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -39,7 +40,7 @@ public class VPicture implements IVDoc<CPicture> {
|
||||
|
||||
// Fields used with interface IVDoc
|
||||
private DragCell parentCell;
|
||||
private final DragTab tab = new DragTab("Card Picture");
|
||||
private final DragTab tab = new DragTab(Localizer.getInstance().getMessage("lblCardPicture"));
|
||||
|
||||
// Top-level containers
|
||||
private final CardPicturePanel pnlPicture = new CardPicturePanel();
|
||||
|
||||
@@ -8,6 +8,7 @@ import forge.gui.framework.IVDoc;
|
||||
import forge.screens.workshop.controllers.CCardDesigner;
|
||||
import forge.toolbox.FLabel;
|
||||
import forge.toolbox.FSkin;
|
||||
import forge.util.Localizer;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
@@ -24,11 +25,11 @@ public enum VCardDesigner implements IVDoc<CCardDesigner> {
|
||||
|
||||
// Fields used with interface IVDoc
|
||||
private DragCell parentCell;
|
||||
private final DragTab tab = new DragTab("Card Designer");
|
||||
private final DragTab tab = new DragTab(Localizer.getInstance().getMessage("lblCardDesigner"));
|
||||
|
||||
private FLabel btnSaveCard = new FLabel.Builder()
|
||||
.opaque(true).hoverable(true)
|
||||
.text("Save and Apply Card Changes")
|
||||
.text(Localizer.getInstance().getMessage("lblSaveAndApplyCardChanges"))
|
||||
.icon(FSkin.getIcon(FSkinProp.ICO_SAVE))
|
||||
.enabled(false) //disabled by default until card changes made
|
||||
.build();
|
||||
|
||||
@@ -16,6 +16,7 @@ import forge.gui.framework.EDocID;
|
||||
import forge.gui.framework.IVDoc;
|
||||
import forge.screens.workshop.controllers.CCardScript;
|
||||
import forge.toolbox.FTextPane;
|
||||
import forge.util.Localizer;
|
||||
|
||||
/**
|
||||
* Assembles Swing components of workshop card script tab.
|
||||
@@ -28,7 +29,7 @@ public enum VCardScript implements IVDoc<CCardScript> {
|
||||
|
||||
// Fields used with interface IVDoc
|
||||
private DragCell parentCell;
|
||||
private final DragTab tab = new DragTab("Card Script");
|
||||
private final DragTab tab = new DragTab(Localizer.getInstance().getMessage("lblCardScript"));
|
||||
|
||||
private final FTextPane txtScript = new FTextPane();
|
||||
private final StyledDocument doc;
|
||||
|
||||
Reference in New Issue
Block a user