diff --git a/src/main/java/forge/Constant.java b/src/main/java/forge/Constant.java index 240569d7131..dad57e5b2b1 100644 --- a/src/main/java/forge/Constant.java +++ b/src/main/java/forge/Constant.java @@ -68,9 +68,6 @@ public final class Constant { /** The Constant LIBRARYVIEW. */ public static final boolean[] LIBRARYVIEW = new boolean[1]; - /** The Constant OLDGUI. */ - public static final boolean[] OLDGUI = new boolean[1]; - /** The Constant NetConn. */ public static final boolean[] NET_CONN = new boolean[1]; diff --git a/src/main/java/forge/Phase.java b/src/main/java/forge/Phase.java index 6a9621f72bc..d9d26938553 100644 --- a/src/main/java/forge/Phase.java +++ b/src/main/java/forge/Phase.java @@ -536,10 +536,7 @@ public class Phase extends MyObservable implements java.io.Serializable { AllZone.getGameLog().add("Turn", "Turn " + turn + " (" + getPlayerTurn() + ")", 0); } - // Visual indicators - if (!Constant.Runtime.OLDGUI[0]) { - PhaseUtil.visuallyActivatePhase(this.getPhase()); - } + PhaseUtil.visuallyActivatePhase(this.getPhase()); // When consecutively skipping phases (like in combat) this section // pushes through that block diff --git a/src/main/java/forge/control/ControlWinLose.java b/src/main/java/forge/control/ControlWinLose.java index ef22d5434c0..ed6bae4874d 100644 --- a/src/main/java/forge/control/ControlWinLose.java +++ b/src/main/java/forge/control/ControlWinLose.java @@ -31,8 +31,6 @@ import forge.gui.GuiUtils; import forge.item.CardDb; import forge.item.CardPrinted; import forge.view.GuiTopLevel; -import forge.view.swing.GuiHomeScreen; -import forge.view.swing.OldGuiNewGame; import forge.view.toolbox.WinLoseFrame; /** @@ -70,20 +68,7 @@ public class ControlWinLose { * */ public void actionOnQuit() { - if (System.getenv("NG2") != null) { - if (System.getenv("NG2").equalsIgnoreCase("true")) { - final String[] argz = {}; - GuiHomeScreen.main(argz); - } else { - new OldGuiNewGame(); - } - } else { - if (Constant.Runtime.OLDGUI[0]) { - new OldGuiNewGame(); - } else { - ((GuiTopLevel) AllZone.getDisplay()).getController().changeState(0); - } - } + ((GuiTopLevel) AllZone.getDisplay()).getController().changeState(0); } /** diff --git a/src/main/java/forge/control/home/ControlDraft.java b/src/main/java/forge/control/home/ControlDraft.java index 52da9700b95..b77f331cbb8 100644 --- a/src/main/java/forge/control/home/ControlDraft.java +++ b/src/main/java/forge/control/home/ControlDraft.java @@ -97,7 +97,7 @@ public class ControlDraft { Constant.Runtime.COMPUTER_DECK[0] = opponentDecks[aiIndex]; if (Constant.Runtime.COMPUTER_DECK[0] == null) { - throw new IllegalStateException("OldGuiNewGame : startButton() error - computer deck is null"); + throw new IllegalStateException("startButton() error - computer deck is null"); } GuiTopLevel g = (GuiTopLevel) AllZone.getDisplay(); diff --git a/src/main/java/forge/gui/deckeditor/DeckEditorDraft.java b/src/main/java/forge/gui/deckeditor/DeckEditorDraft.java index 9510caac782..a702431ad17 100644 --- a/src/main/java/forge/gui/deckeditor/DeckEditorDraft.java +++ b/src/main/java/forge/gui/deckeditor/DeckEditorDraft.java @@ -54,7 +54,6 @@ import forge.item.ItemPoolView; import forge.properties.ForgeProps; import forge.properties.NewConstants.Lang.GuiBoosterDraft; import forge.view.GuiTopLevel; -import forge.view.swing.OldGuiNewGame; /** *

@@ -136,14 +135,8 @@ public class DeckEditorDraft extends DeckEditorBase { ForgeProps.getLocalized(GuiBoosterDraft.CLOSE_MESSAGE), "", JOptionPane.YES_NO_OPTION); if (n == JOptionPane.YES_OPTION) { DeckEditorDraft.this.dispose(); - - if (Constant.Runtime.OLDGUI[0]) { - new OldGuiNewGame(); - } - else { - ControlAllUI g = ((GuiTopLevel) AllZone.getDisplay()).getController(); - g.getHomeView().getDraftController().updateHumanDecks(); - } + ControlAllUI g = ((GuiTopLevel) AllZone.getDisplay()).getController(); + g.getHomeView().getDraftController().updateHumanDecks(); } } // windowClosing() }); @@ -362,13 +355,8 @@ public class DeckEditorDraft extends DeckEditorBase { // close and open next screen this.dispose(); - if (Constant.Runtime.OLDGUI[0]) { - new OldGuiNewGame(); - } - else { - ControlAllUI g = ((GuiTopLevel) AllZone.getDisplay()).getController(); - g.getHomeView().getDraftController().updateHumanDecks(); - } + ControlAllUI g = ((GuiTopLevel) AllZone.getDisplay()).getController(); + g.getHomeView().getDraftController().updateHumanDecks(); } /* saveDraft() */ diff --git a/src/main/java/forge/gui/input/InputAttack.java b/src/main/java/forge/gui/input/InputAttack.java index 2cf3e31ae5f..54f8c36f209 100644 --- a/src/main/java/forge/gui/input/InputAttack.java +++ b/src/main/java/forge/gui/input/InputAttack.java @@ -104,15 +104,9 @@ public class InputAttack extends Input { // return; AllZone.getCombat().addAttacker(card); - AllZone.getHumanPlayer().getZone(Zone.Battlefield).updateObservers(); // just - // to - // make - // sure - // the - // attack - // symbol - // is - // marked + + // just to make sure the attack symbol is marked + AllZone.getHumanPlayer().getZone(Zone.Battlefield).updateObservers(); // for Castle Raptors, since it gets a bonus if untapped for (final String effect : AllZone.getStaticEffects().getStateBasedMap().keySet()) { @@ -122,7 +116,7 @@ public class InputAttack extends Input { CombatUtil.showCombat(); } - else if (!Constant.Runtime.OLDGUI[0]) { + else { ((GuiTopLevel) AllZone.getDisplay()).getController().getMatchController().getView().getInputController().remind(); } } // selectCard() diff --git a/src/main/java/forge/gui/input/InputBlock.java b/src/main/java/forge/gui/input/InputBlock.java index 3a67ea5b8c5..9bf400d6c11 100644 --- a/src/main/java/forge/gui/input/InputBlock.java +++ b/src/main/java/forge/gui/input/InputBlock.java @@ -111,7 +111,7 @@ public class InputBlock extends Input { AllZone.getCombat().addBlocker(this.currentAttacker, card); } } - else if (!Constant.Runtime.OLDGUI[0]) { + else { ((GuiTopLevel) AllZone.getDisplay()).getController().getMatchController().getView().getInputController().remind(); } this.showMessage(); diff --git a/src/main/java/forge/gui/input/InputMulligan.java b/src/main/java/forge/gui/input/InputMulligan.java index 7f255b9bb86..d99ce740599 100644 --- a/src/main/java/forge/gui/input/InputMulligan.java +++ b/src/main/java/forge/gui/input/InputMulligan.java @@ -221,7 +221,7 @@ public class InputMulligan extends Input { } c0.getController().drawCards(hand.size()); } - } else if (!Constant.Runtime.OLDGUI[0]) { + } else { ((GuiTopLevel) AllZone.getDisplay()).getController().getMatchController().getView().getInputController().remind(); } } diff --git a/src/main/java/forge/gui/input/InputPassPriority.java b/src/main/java/forge/gui/input/InputPassPriority.java index 15334edab43..c7a4f3cf353 100644 --- a/src/main/java/forge/gui/input/InputPassPriority.java +++ b/src/main/java/forge/gui/input/InputPassPriority.java @@ -20,7 +20,6 @@ package forge.gui.input; import forge.AllZone; import forge.ButtonUtil; import forge.Card; -import forge.Constant; import forge.GuiDisplayUtil; import forge.Player; import forge.PlayerZone; @@ -85,7 +84,7 @@ public class InputPassPriority extends Input implements java.io.Serializable { if (AllZone.getGameAction().playCard(card)) { AllZone.getPhase().setPriority(AllZone.getHumanPlayer()); } - else if (!Constant.Runtime.OLDGUI[0]) { + else { ((GuiTopLevel) AllZone.getDisplay()).getController().getMatchController().getView().getInputController().remind(); } } // selectCard() diff --git a/src/main/java/forge/properties/NewConstants.java b/src/main/java/forge/properties/NewConstants.java index 6299e8fe212..2d0344b5113 100644 --- a/src/main/java/forge/properties/NewConstants.java +++ b/src/main/java/forge/properties/NewConstants.java @@ -806,9 +806,6 @@ public final class NewConstants { /** The DECK_EDITOR. */ public static final String DECK_EDITOR = "%s/NewGame/deckeditor"; - /** The OLD_GUI. */ - public static final String OLD_GUI = "%s/NewGame/oldgui"; - /** The AI_LAND. */ public static final String AI_LAND = "%s/NewGame/ailand"; diff --git a/src/main/java/forge/quest/gui/QuestFrame.java b/src/main/java/forge/quest/gui/QuestFrame.java index f044d76676e..8ddc05af7ca 100644 --- a/src/main/java/forge/quest/gui/QuestFrame.java +++ b/src/main/java/forge/quest/gui/QuestFrame.java @@ -31,7 +31,6 @@ import javax.swing.border.EmptyBorder; import forge.AllZone; import forge.gui.GuiUtils; import forge.quest.gui.bazaar.QuestBazaarPanel; -import forge.view.swing.GuiHomeScreen; import forge.view.swing.OldGuiNewGame; /** @@ -138,17 +137,7 @@ public class QuestFrame extends JFrame { */ public final void returnToMainMenu() { AllZone.getQuestData().saveData(); - - if (System.getenv("NG2") != null) { - if (System.getenv("NG2").equalsIgnoreCase("true")) { - final String[] argz = {}; - GuiHomeScreen.main(argz); - } else { - new OldGuiNewGame(); - } - } else { - new OldGuiNewGame(); - } + new OldGuiNewGame(); this.dispose(); } diff --git a/src/main/java/forge/quest/gui/QuestMainPanel.java b/src/main/java/forge/quest/gui/QuestMainPanel.java index f29b41d18bf..e0742c78c8c 100644 --- a/src/main/java/forge/quest/gui/QuestMainPanel.java +++ b/src/main/java/forge/quest/gui/QuestMainPanel.java @@ -46,7 +46,6 @@ import javax.swing.border.TitledBorder; import forge.AllZone; import forge.Command; import forge.Constant; -import forge.GuiDisplay; import forge.ImageCache; import forge.deck.Deck; import forge.gui.GuiUtils; @@ -771,16 +770,10 @@ public class QuestMainPanel extends QuestAbstractPanel { Constant.Quest.OPP_ICON_NAME[0] = this.getEventIconFilename(); - // Dev Mode occurs before Display - Constant.Runtime.DEV_MODE[0] = this.devModeCheckBox.isSelected(); - if (Constant.Runtime.OLDGUI[0]) { - AllZone.setDisplay(new GuiDisplay()); - } else { - GuiTopLevel g = (GuiTopLevel) AllZone.getDisplay(); - g.getController().changeState(1); - g.getController().getMatchController().initMatch(); - } + GuiTopLevel g = (GuiTopLevel) AllZone.getDisplay(); + g.getController().changeState(1); + g.getController().getMatchController().initMatch(); Constant.Runtime.SMOOTH[0] = this.smoothLandCheckBox.isSelected(); diff --git a/src/main/java/forge/quest/gui/QuestOptions.java b/src/main/java/forge/quest/gui/QuestOptions.java index ffff874bc37..7d9851e57da 100644 --- a/src/main/java/forge/quest/gui/QuestOptions.java +++ b/src/main/java/forge/quest/gui/QuestOptions.java @@ -44,7 +44,6 @@ import forge.gui.GuiUtils; import forge.quest.data.QuestData; import forge.quest.data.QuestDataIO; import forge.quest.data.QuestPreferences; -import forge.view.swing.GuiHomeScreen; import forge.view.swing.OldGuiNewGame; /** @@ -118,17 +117,7 @@ public class QuestOptions extends JFrame { public void windowClosing(final WindowEvent ev) { QuestOptions.this.dispose(); - if (System.getenv("NG2") != null) { - if (System.getenv("NG2").equalsIgnoreCase("true")) { - final String[] argz = {}; - GuiHomeScreen.main(argz); - } else { - new OldGuiNewGame(); - } - } else { - new OldGuiNewGame(); - } - + new OldGuiNewGame(); } }); diff --git a/src/main/java/forge/quest/gui/QuestWinLoseHandler.java b/src/main/java/forge/quest/gui/QuestWinLoseHandler.java index b39514d88e3..749e11fac54 100644 --- a/src/main/java/forge/quest/gui/QuestWinLoseHandler.java +++ b/src/main/java/forge/quest/gui/QuestWinLoseHandler.java @@ -301,13 +301,8 @@ public class QuestWinLoseHandler extends ControlWinLose { this.model.qData.saveData(); - if (Constant.Runtime.OLDGUI[0]) { - new QuestFrame(); - } - else { - ((GuiTopLevel) AllZone.getDisplay()).getController().changeState(0); - ((GuiTopLevel) AllZone.getDisplay()).getController().getHomeView().showQuestMenu(); - } + ((GuiTopLevel) AllZone.getDisplay()).getController().changeState(0); + ((GuiTopLevel) AllZone.getDisplay()).getController().getHomeView().showQuestMenu(); } /** diff --git a/src/main/java/forge/quest/gui/bazaar/QuestBazaarPanel.java b/src/main/java/forge/quest/gui/bazaar/QuestBazaarPanel.java index a356e39f7d1..fa3258833b6 100644 --- a/src/main/java/forge/quest/gui/bazaar/QuestBazaarPanel.java +++ b/src/main/java/forge/quest/gui/bazaar/QuestBazaarPanel.java @@ -32,7 +32,6 @@ import javax.swing.JPanel; import javax.swing.JToggleButton; import forge.AllZone; -import forge.Constant; import forge.control.ControlAllUI; import forge.quest.data.bazaar.QuestStallManager; import forge.quest.gui.QuestAbstractPanel; @@ -146,14 +145,9 @@ public class QuestBazaarPanel extends QuestAbstractPanel { quitButton.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { - if (Constant.Runtime.OLDGUI[0]) { - QuestBazaarPanel.this.getMainFrame().showMainPane(); - } - else { - ControlAllUI g = ((GuiTopLevel) AllZone.getDisplay()).getController(); - g.changeState(ControlAllUI.HOME_SCREEN); - g.getHomeView().showQuestMenu(); - } + ControlAllUI g = ((GuiTopLevel) AllZone.getDisplay()).getController(); + g.changeState(ControlAllUI.HOME_SCREEN); + g.getHomeView().showQuestMenu(); } }); diff --git a/src/main/java/forge/view/swing/ApplicationView.java b/src/main/java/forge/view/swing/ApplicationView.java index e2ae78d4fd0..0f235e4873d 100644 --- a/src/main/java/forge/view/swing/ApplicationView.java +++ b/src/main/java/forge/view/swing/ApplicationView.java @@ -163,15 +163,10 @@ public class ApplicationView implements FView { ApplicationView.this.splashFrame = null; - if (!Constant.Runtime.OLDGUI[0]) { - GuiTopLevel g = new GuiTopLevel(); - g.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); - AllZone.setDisplay(g); - g.getController().changeState(ControlAllUI.HOME_SCREEN); - } - else { - new OldGuiNewGame(); - } + GuiTopLevel g = new GuiTopLevel(); + g.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + AllZone.setDisplay(g); + g.getController().changeState(ControlAllUI.HOME_SCREEN); } }); } catch (final Exception ex) { diff --git a/src/main/java/forge/view/swing/OldGuiNewGame.java b/src/main/java/forge/view/swing/OldGuiNewGame.java index d834a9cb25b..2735783a0c5 100644 --- a/src/main/java/forge/view/swing/OldGuiNewGame.java +++ b/src/main/java/forge/view/swing/OldGuiNewGame.java @@ -62,7 +62,6 @@ import forge.Command; import forge.Constant; import forge.ConstantStringArrayList; import forge.FileUtil; -import forge.GuiDisplay; import forge.GuiDownloadPicturesLQ; import forge.GuiDownloadPrices; import forge.GuiDownloadQuestImages; @@ -138,8 +137,6 @@ public class OldGuiNewGame extends JFrame { // @SuppressWarnings("unused") // titledBorder2 - /** Constant oldGuiCheckBox. */ - private static JCheckBox oldGuiCheckBox = new JCheckBox("", false); /** Constant smoothLandCheckBox. */ private static JCheckBox smoothLandCheckBox = new JCheckBox("", false); /** Constant devModeCheckBox. */ @@ -563,15 +560,6 @@ public class OldGuiNewGame extends JFrame { ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.NewGameText.SETTINGS)); this.jPanel3.setLayout(new MigLayout("align center")); - OldGuiNewGame.oldGuiCheckBox.setText(ForgeProps - .getLocalized(NewConstants.Lang.OldGuiNewGame.NewGameText.OLD_GUI)); - OldGuiNewGame.oldGuiCheckBox.addActionListener(new java.awt.event.ActionListener() { - @Override - public void actionPerformed(final ActionEvent e) { - Constant.Runtime.OLDGUI[0] = OldGuiNewGame.oldGuiCheckBox.isSelected(); - } - }); - OldGuiNewGame.getSmoothLandCheckBox().setText( ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.NewGameText.AI_LAND)); @@ -654,7 +642,6 @@ public class OldGuiNewGame extends JFrame { this.getContentPane().add(this.jPanel3, "span 2, grow"); - this.jPanel3.add(OldGuiNewGame.oldGuiCheckBox, "wrap"); this.jPanel3.add(OldGuiNewGame.getSmoothLandCheckBox(), "wrap"); this.jPanel3.add(OldGuiNewGame.getDevModeCheckBox(), "wrap"); this.jPanel3.add(OldGuiNewGame.getUpldDrftCheckBox(), "wrap"); @@ -880,18 +867,9 @@ public class OldGuiNewGame extends JFrame { } } // else - // Update old gui checkbox for first run - Constant.Runtime.OLDGUI[0] = OldGuiNewGame.oldGuiCheckBox.isSelected(); - - if (Constant.Runtime.OLDGUI[0]) { - AllZone.setDisplay(new GuiDisplay()); - } else { - ((GuiTopLevel) AllZone.getDisplay()).getController().getMatchController().initMatch(); - } + ((GuiTopLevel) AllZone.getDisplay()).getController().getMatchController().initMatch(); Constant.Runtime.SMOOTH[0] = OldGuiNewGame.getSmoothLandCheckBox().isSelected(); - // Constant.Runtime.DEV_MODE[0] = - // OldGuiNewGame.devModeCheckBox.isSelected(); AllZone.getGameAction().newGame(Constant.Runtime.HUMAN_DECK[0], Constant.Runtime.COMPUTER_DECK[0]); AllZone.getDisplay().setVisible(true); @@ -1910,13 +1888,4 @@ public class OldGuiNewGame extends JFrame { public static void setFoilRandomCheckBox(final JCheckBox foilRandomCheckBox0) { OldGuiNewGame.foilRandomCheckBox = foilRandomCheckBox0; } - - /** - * Gets the old gui check box. - * - * @return JCheckBox - */ - public static JCheckBox getOldGuiCheckBox() { - return OldGuiNewGame.oldGuiCheckBox; - } } diff --git a/src/main/java/forge/view/toolbox/WinLoseFrame.java b/src/main/java/forge/view/toolbox/WinLoseFrame.java index de0e72bd3c0..02f2513eb32 100644 --- a/src/main/java/forge/view/toolbox/WinLoseFrame.java +++ b/src/main/java/forge/view/toolbox/WinLoseFrame.java @@ -35,7 +35,6 @@ import javax.swing.border.AbstractBorder; import net.miginfocom.swing.MigLayout; import forge.AllZone; -import forge.Constant; import forge.Phase; import forge.Player; import forge.control.ControlWinLose; @@ -244,10 +243,7 @@ public class WinLoseFrame extends JFrame { final void btnContinueActionPerformed(final ActionEvent e) { this.closeWinLoseFrame(); - // Instantiate a new ControlAllUI if using new UI. - if (!Constant.Runtime.OLDGUI[0]) { - ((GuiTopLevel) AllZone.getDisplay()).getController().getMatchController().initMatch(); - } + ((GuiTopLevel) AllZone.getDisplay()).getController().getMatchController().initMatch(); AllZone.getDisplay().setVisible(true); this.modeHandler.startNextRound(); @@ -264,10 +260,7 @@ public class WinLoseFrame extends JFrame { final void btnRestartActionPerformed(final ActionEvent e) { this.closeWinLoseFrame(); - // Instantiate a new ControlAllUI if using new UI. - if (!Constant.Runtime.OLDGUI[0]) { - ((GuiTopLevel) AllZone.getDisplay()).getController().getMatchController().initMatch(); - } + ((GuiTopLevel) AllZone.getDisplay()).getController().getMatchController().initMatch(); AllZone.getDisplay().setVisible(true); this.matchState.reset(); @@ -302,15 +295,6 @@ public class WinLoseFrame extends JFrame { * @return {@link javax.swing.JFrame} display frame */ private void closeWinLoseFrame() { - JFrame frame; - - // Issue 147 - keep battlefield up following win/loss - if (Constant.Runtime.OLDGUI[0]) { - frame = (JFrame) AllZone.getDisplay(); - frame.dispose(); - frame.setEnabled(true); - } - this.dispose(); }