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);
|
b1.setItems(availablechar);
|
||||||
b2.setItems(availablechar);
|
b2.setItems(availablechar);
|
||||||
// Setting default ChoiceBoxes values to the ones already in the config file
|
// 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");
|
b1.setValue("Blue");
|
||||||
}
|
}
|
||||||
if(setter.getChar2().equals("blue")) {
|
if(setter.getChar2().equals("blue") || setter.getChar2().equals("default")) {
|
||||||
b2.setValue("Blue");
|
b2.setValue("Blue");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,9 +168,9 @@ public class Launcher extends Application {
|
|||||||
setter.setSettings();
|
setter.setSettings();
|
||||||
match.main(null);
|
match.main(null);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
System.out.println("Fill all boxes to launch the game");
|
||||||
System.exit(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -94,7 +94,6 @@ public class Settings {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
System.exit(1);
|
System.exit(1);
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
System.out.println("Invalid config file");
|
|
||||||
rounds = 3;
|
rounds = 3;
|
||||||
p1 = "default";
|
p1 = "default";
|
||||||
p2 = "default";
|
p2 = "default";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user