Skip to content

Instantly share code, notes, and snippets.

@Jimshii
Created June 8, 2012 17:17
Show Gist options
  • Save Jimshii/2896954 to your computer and use it in GitHub Desktop.
Save Jimshii/2896954 to your computer and use it in GitHub Desktop.
main
JMenuItem Load = new JMenuItem("Load Game");
Load.setToolTipText("Load a previously saved game");
Load.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
load.loadGame();
if (Character.secondBar == null) {
statusbar.setText("No game found");
}
else {
statusbar.setText("Loading game...");
}
}
});
JMenuItem Save = new JMenuItem("Save Game");
Save.setToolTipText("Save your game from your current position");
Save.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
if (save.savedQ == 1) {
load.savedA = 1;
save.gameSave();
statusbar.setText("Game saved");
}
else {
statusbar.setText("There is no game to save!");
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment