Fixed launcher failing to start if game.set is absent
This commit is contained in:
parent
26f3512372
commit
f9043d6deb
@ -71,12 +71,19 @@ public class Config {
|
|||||||
System.out.println("button for up is : " + up); */
|
System.out.println("button for up is : " + up); */
|
||||||
|
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
e.printStackTrace();
|
File f = new File("game.set");
|
||||||
|
try {
|
||||||
|
f.createNewFile();
|
||||||
|
} catch (IOException e1) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e1.printStackTrace();
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
|
parse();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
e.printStackTrace();
|
System.out.println("Empty config file");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,6 @@ public class Launcher extends Application {
|
|||||||
public void runGame() {
|
public void runGame() {
|
||||||
try {
|
try {
|
||||||
int width, height;
|
int width, height;
|
||||||
System.out.println(namespace.size());
|
|
||||||
ChoiceBox<String> cb = (ChoiceBox<String>) namespace.get("resolution");
|
ChoiceBox<String> cb = (ChoiceBox<String>) namespace.get("resolution");
|
||||||
switch (cb.getValue()) {
|
switch (cb.getValue()) {
|
||||||
case "640x480":
|
case "640x480":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user