add an "Exit" option under the Menu menu from the main screen.

This commit is contained in:
slapshot5
2011-10-06 00:42:05 +00:00
parent a556c471ae
commit 4adcff39ec
4 changed files with 29 additions and 3 deletions

View File

@@ -113,6 +113,7 @@ NewGame/menu/cardSizes=Kartengr
NewGame/menu/cardStack="Stack" gr<67><72>e einstellen
NewGame/menu/cardStackOffset="Stack Offset" einstellen
NewGame/menu/about=<EFBFBD>ber
NewGame/menu/exit=Aufgang
NewGame/options/title=Optionen
NewGame/options/font=Benutze LAF Schriften
NewGame/options/cardOverlay=Benutze Mana und Text

View File

@@ -150,6 +150,7 @@ NewGame/menu/cardSizes=Specify Max Card Size
NewGame/menu/cardStack=Specify Max Stack Size
NewGame/menu/cardStackOffset=Specify Stack Offset
NewGame/menu/about=About
NewGame/menu/exit=Exit
NewGame/options/title=Options
NewGame/options/font=Use LAF Fonts
NewGame/options/cardOverlay=Use mana and text card overlay

View File

@@ -436,6 +436,7 @@ public interface NewConstants {
String CARD_STACK = "%s/NewGame/menu/cardStack";
String CARD_STACK_OFFSET = "%s/NewGame/menu/cardStackOffset";
String ABOUT = "%s/NewGame/menu/about";
String EXIT = "%s/NewGame/menu/exit";
}
public static interface OPTIONS {

View File

@@ -1,7 +1,5 @@
package forge.view.swing;
import arcane.ui.CardPanel;
import com.esotericsoftware.minlog.Log;
import forge.*;
import forge.deck.Deck;
@@ -125,6 +123,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
private final Action HOW_TO_PLAY_ACTION = new HowToPlayAction();
private final Action DNLD_PRICES_ACTION = new DownloadPriceAction();
private final Action BUGZ_REPORTER_ACTION = new BugzReporterAction();
private final Action EXIT_ACTION = new ExitAction();
/**
* <p>
@@ -200,7 +199,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
// CARD_SIZES_ACTION,
LOOK_AND_FEEL_ACTION, DNLD_PRICES_ACTION, DOWNLOAD_ACTION_LQ, DOWNLOAD_ACTION_SETLQ, IMPORT_PICTURE,
CARD_SIZES_ACTION, CARD_STACK_ACTION, CARD_STACK_OFFSET_ACTION, BUGZ_REPORTER_ACTION,
ErrorViewer.ALL_THREADS_ACTION, ABOUT_ACTION };
ErrorViewer.ALL_THREADS_ACTION, ABOUT_ACTION, EXIT_ACTION };
JMenu menu = new JMenu(ForgeProps.getLocalized(MENU.TITLE));
for (Action a : actions) {
menu.add(a);
@@ -284,6 +283,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
this.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(final WindowEvent ev) {
dispose();
System.exit(0);
}
});
@@ -1406,6 +1406,29 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
}
}
/**
*
* @author slapshot5
*
*/
public static class ExitAction extends AbstractAction {
private static final long serialVersionUID = -319036939657136034L;
/**
*
*/
public ExitAction() {
super(ForgeProps.getLocalized(MENU_BAR.MENU.EXIT));
}
/**
*
*/
public final void actionPerformed(final ActionEvent e) {
System.exit(0);
}
}
/**
* <p>
* exit.