Skip to content

Commit

Permalink
Created instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavin Li committed Apr 25, 2015
1 parent cc02013 commit 29f1e75
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 46 deletions.
1 change: 1 addition & 0 deletions MerchantRPGCSE2102/src/config/instructions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Testing Instructions file
54 changes: 8 additions & 46 deletions MerchantRPGCSE2102/src/view/StartScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void mouseReleased(MouseEvent arg0) {
System.out.println("Game started");
_master._initialGameVariable = true;
exitWindow();
// createUserNameInputWindow();

}
});

Expand All @@ -59,6 +59,13 @@ public void mouseReleased(MouseEvent arg0) {
@Override
public void mouseReleased(MouseEvent arg0) {
System.out.println("Instructions opened");
ProcessBuilder pb = new ProcessBuilder("Notepad.exe", "src/config/instructions.txt");
try {
pb.start();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});

Expand Down Expand Up @@ -99,49 +106,4 @@ public void exitWindow()
{
this.dispose();
}

//will re-implement player name assignments when save files are implemented

// public void createUserNameInputWindow()
// {
// final JFrame contentFrame = new JFrame();
// JPanel inputPane;
// final JTextField textField_1;
// boolean dispose = false;
//
// contentFrame.setTitle("What is your name?");
// contentFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
// contentFrame.setBounds(100, 100, 450, 99);
// inputPane = new JPanel();
// inputPane.setBorder(new EmptyBorder(5, 5, 5, 5));
// contentFrame.setContentPane(inputPane);
// inputPane.setLayout(new BorderLayout(0, 0));
//
// textField_1 = new JTextField();
// inputPane.add(textField_1, BorderLayout.NORTH);
// textField_1.setColumns(10);
//
// JButton btnAccept = new JButton("Accept");
// btnAccept.addMouseListener(new MouseAdapter() {
// @Override
// public void mouseReleased(MouseEvent arg0) {
// String userInput = textField_1.getText();
// setPlayerName(userInput);
// System.out.println(userInput);
// dispose = true;
// }
// });
// inputPane.add(btnAccept, BorderLayout.SOUTH);
// contentFrame.setVisible(true);
//
// if(dispose = true)
// {
// this.dispose();
// }
// }
//
// public void setPlayerName(String playerName)
// {
// _player.setPlayerName(playerName);
// }
}

0 comments on commit 29f1e75

Please sign in to comment.