diff --git a/MerchantRPGCSE2102/src/config/instructions.txt b/MerchantRPGCSE2102/src/config/instructions.txt new file mode 100644 index 0000000..550cd0e --- /dev/null +++ b/MerchantRPGCSE2102/src/config/instructions.txt @@ -0,0 +1 @@ +Testing Instructions file \ No newline at end of file diff --git a/MerchantRPGCSE2102/src/view/StartScreen.java b/MerchantRPGCSE2102/src/view/StartScreen.java index b38d440..8f933ca 100644 --- a/MerchantRPGCSE2102/src/view/StartScreen.java +++ b/MerchantRPGCSE2102/src/view/StartScreen.java @@ -48,7 +48,7 @@ public void mouseReleased(MouseEvent arg0) { System.out.println("Game started"); _master._initialGameVariable = true; exitWindow(); -// createUserNameInputWindow(); + } }); @@ -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(); + } } }); @@ -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); -// } }