Supermaniac101 10 жил өмнө
parent
commit
8cd0ea7e1d

+ 15 - 2
src/gui/frames/MainFrame.java

@@ -39,8 +39,9 @@ public class MainFrame extends JFrame{
 		this.setJMenuBar(new MenuBar(this));
 		this.setVisible(true);
 		
-		this.length = 1000;
-		this.width = 1000;
+		this.length = -999;
+		this.width = -999;
+		this.terrain = -999;
 		
 		this.getContentPane().setBackground( Color.WHITE );
 
@@ -90,6 +91,18 @@ public class MainFrame extends JFrame{
     	this.width = width;
     }
     
+    public int getTerrain(){
+    	return this.terrain;
+    }
+
+    public int getLength(){
+    	return this.length;
+    }
+    
+    public int getWidth(){
+    	return this.width;
+    }
+    
     private void updateView(JPanel panel){
         this.currentPanel = panel;
         this.setContentPane(this.currentPanel);

+ 7 - 0
src/gui/menubar/MenuBar.java

@@ -148,7 +148,14 @@ public class MenuBar extends JMenuBar{
 			@Override
 			public void actionPerformed(ActionEvent e) {
 				System.out.println("Simulator View");
+				
+				if(mainFrame.getTerrain() == -999 ||
+						mainFrame.getLength() == -999 ||
+						mainFrame.getWidth() == -999){
 				new SimulatorDialogPane(mainFrame);
+				} else {
+					mainFrame.changeView(MainFrame.Views.SIMULATOR);
+				}
 			}
 		});