Fixed launcher behaving unexpectedly if game.set was malformed
This commit is contained in:
parent
8c146b324b
commit
6476cb6249
@ -134,10 +134,10 @@ public class Launcher extends Application {
|
||||
b1.setItems(availablechar);
|
||||
b2.setItems(availablechar);
|
||||
// Setting default ChoiceBoxes values to the ones already in the config file
|
||||
if(setter.getChar1().equals("blue")) {
|
||||
if(setter.getChar1().equals("blue") || setter.getChar1().equals("default")) {
|
||||
b1.setValue("Blue");
|
||||
}
|
||||
if(setter.getChar2().equals("blue")) {
|
||||
if(setter.getChar2().equals("blue") || setter.getChar2().equals("default")) {
|
||||
b2.setValue("Blue");
|
||||
}
|
||||
|
||||
@ -168,9 +168,9 @@ public class Launcher extends Application {
|
||||
setter.setSettings();
|
||||
match.main(null);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
System.exit(1);
|
||||
System.out.println("Fill all boxes to launch the game");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -94,7 +94,6 @@ public class Settings {
|
||||
e.printStackTrace();
|
||||
System.exit(1);
|
||||
} catch (ParseException e) {
|
||||
System.out.println("Invalid config file");
|
||||
rounds = 3;
|
||||
p1 = "default";
|
||||
p2 = "default";
|
||||
|
Loading…
x
Reference in New Issue
Block a user