Settings agnostic to invalid configuation file
This commit is contained in:
parent
264f53f88d
commit
677e4dd013
@ -22,19 +22,22 @@ public class Settings {
|
||||
|
||||
public void setSettings() throws Exception {
|
||||
HashMap<String, Object> set = Launcher.pointer.getArraysettings();
|
||||
int width = (Integer) set.get("width");
|
||||
int height = (Integer) set.get("height");
|
||||
int rounds = (Integer) set.get("rounds");
|
||||
boolean fullscreen = (Boolean) set.get("fullscreen");
|
||||
String character1 = (String) set.get("character1");
|
||||
String character2 = (String) set.get("character2");
|
||||
String stage = (String) set.get("stage");
|
||||
|
||||
try {
|
||||
int width = (Integer) set.get("width");
|
||||
int height = (Integer) set.get("height");
|
||||
int rounds = (Integer) set.get("rounds");
|
||||
boolean fullscreen = (Boolean) set.get("fullscreen");
|
||||
String character1 = (String) set.get("character1");
|
||||
String character2 = (String) set.get("character2");
|
||||
String stage = (String) set.get("stage");
|
||||
config.write(width, height, rounds, fullscreen, character1, character2, stage);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
config.write(800, 600, 3, false, "default", "default", "default");
|
||||
System.out.println("Incorrect config file");
|
||||
}
|
||||
}
|
||||
|
||||
public String getResolution() {
|
||||
return "" + Integer.toString(config.width) + "x" + Integer.toString(config.height);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user