@@ -27,6 +27,7 @@ public class Menu implements Runnable {
27
27
private static boolean gameOver = false ;
28
28
29
29
private static DedicatedJFrame frame ;// = new DedicatedJFrame(WIDTH, HEIGHT,
30
+ private static final JDialog dialog = new JDialog ();
30
31
// SCALE, NAME);
31
32
private Font font = new Font ();
32
33
private MouseListener Mouse = new Mouse ();
@@ -55,26 +56,27 @@ public static void play() {
55
56
Thread .sleep (125 );
56
57
UIManager .setLookAndFeel (UIManager .getSystemLookAndFeelClassName ());
57
58
String multiMsg = "Sorry but multiplayer has been disabled on this version.\n If you would like multiplayer checkout Alpha 1.6" ;
58
- JOptionPane .showMessageDialog (Game .getGame (), multiMsg ,
59
+ dialog .setAlwaysOnTop (true );
60
+ JOptionPane .showMessageDialog (dialog , multiMsg ,
59
61
"Multiplayer Warning" , JOptionPane .WARNING_MESSAGE );
60
62
// Game.setJdata_Host(JOptionPane.showConfirmDialog(Game.getGame(),
61
63
// "Do you want to be the HOST?"));
62
64
Game .setJdata_Host (1 );
63
65
if (Game .getJdata_Host () != 1 ) { // Game.getJdata_Host() == 1
64
- Game .setJdata_IP (JOptionPane .showInputDialog (Game . getGame () ,
66
+ Game .setJdata_IP (JOptionPane .showInputDialog (dialog ,
65
67
"Enter the name \n leave blank for local" ));
66
68
}
67
69
Thread .sleep (125 );
68
70
splash .setProgress (70 , "Acquiring data: Username" );
69
- String s = JOptionPane .showInputDialog (Game . getGame () ,
71
+ String s = JOptionPane .showInputDialog (dialog ,
70
72
"Enter a name" );
71
73
if (s != null ) {
72
74
Game .setJdata_UserName (s );
73
75
}
74
76
Thread .sleep (125 );
75
77
splash .setProgress (90 , "Collecting Player Data" );
76
78
Object [] options = {"African" , "Caucasian" };
77
- int n = JOptionPane .showOptionDialog (frame ,
79
+ int n = JOptionPane .showOptionDialog (dialog ,
78
80
"Choose a race for the character to be" , "Choose a race" ,
79
81
JOptionPane .YES_NO_OPTION , JOptionPane .QUESTION_MESSAGE ,
80
82
null , options , options [0 ]);
@@ -85,7 +87,7 @@ public static void play() {
85
87
}
86
88
Thread .sleep (250 );
87
89
Object [] options1 = {"Orange" , "Black" };
88
- int n1 = JOptionPane .showOptionDialog (frame ,
90
+ int n1 = JOptionPane .showOptionDialog (dialog ,
89
91
"Which Colour do you want the shirt to be?" ,
90
92
"Choose a shirt Colour" , JOptionPane .YES_NO_OPTION ,
91
93
JOptionPane .QUESTION_MESSAGE , null , options1 , options1 [0 ]);
@@ -245,33 +247,27 @@ private void paintButtons(boolean start, boolean exit, Graphics g) {
245
247
g .setColor (new Color (0xFFBB4400 ));
246
248
g .fillRect (35 , 40 , (frame .getWidth () - 67 ), 113 );
247
249
g .setColor (getDeSelected ());
248
- g .fillRect (35 , 40 , (frame .getWidth () - 70 ), 110 );
249
- g .setColor (Color .BLACK );
250
- g .drawString ("Start" , 220 , 95 );
251
250
} else {
252
251
g .setColor (new Color (0xFFDD6600 ));
253
252
g .fillRect (35 , 40 , (frame .getWidth () - 67 ), 113 );
254
253
g .setColor (getSelected ());
255
- g .fillRect (35 , 40 , (frame .getWidth () - 70 ), 110 );
256
- g .setColor (Color .BLACK );
257
- g .drawString ("Start" , 220 , 95 );
258
254
}
255
+ g .fillRect (35 , 40 , (frame .getWidth () - 70 ), 110 );
256
+ g .setColor (Color .BLACK );
257
+ g .drawString ("Start" , 220 , 95 );
259
258
// EXIT
260
259
if (!exit ) {
261
260
g .setColor (new Color (0xFFBB4400 ));
262
261
g .fillRect (35 , 170 , (frame .getWidth () - 67 ), 113 );
263
262
g .setColor (getDeSelected ());
264
- g .fillRect (35 , 170 , (frame .getWidth () - 70 ), 110 );
265
- g .setColor (Color .BLACK );
266
- g .drawString ("Exit" , 220 , 220 );
267
263
} else {
268
264
g .setColor (new Color (0xFFDD6600 ));
269
265
g .fillRect (35 , 170 , (frame .getWidth () - 67 ), 113 );
270
266
g .setColor (getSelected ());
271
- g .fillRect (35 , 170 , (frame .getWidth () - 70 ), 110 );
272
- g .setColor (Color .BLACK );
273
- g .drawString ("Exit" , 220 , 220 );
274
267
}
268
+ g .fillRect (35 , 170 , (frame .getWidth () - 70 ), 110 );
269
+ g .setColor (Color .BLACK );
270
+ g .drawString ("Exit" , 220 , 220 );
275
271
}
276
272
277
273
public Color getSelected () {
0 commit comments