aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/net/sowgro/npehero/Driver.java
diff options
context:
space:
mode:
authorsowgro <tpoke.ferrari@gmail.com>2024-07-28 01:07:41 -0400
committersowgro <tpoke.ferrari@gmail.com>2024-07-28 01:07:41 -0400
commit0ce09f72f4af26412356b9699d402b52dbcfc94f (patch)
treeb01b94b1b80d1f3fc5aea559b3718024b79cfe91 /src/main/java/net/sowgro/npehero/Driver.java
parentd04c277edff957d14b6261dd38da43c18b7ba189 (diff)
downloadNPEhero-0ce09f72f4af26412356b9699d402b52dbcfc94f.tar.gz
NPEhero-0ce09f72f4af26412356b9699d402b52dbcfc94f.tar.bz2
NPEhero-0ce09f72f4af26412356b9699d402b52dbcfc94f.zip
Finalize level API and new Json library
Diffstat (limited to 'src/main/java/net/sowgro/npehero/Driver.java')
-rwxr-xr-xsrc/main/java/net/sowgro/npehero/Driver.java23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/main/java/net/sowgro/npehero/Driver.java b/src/main/java/net/sowgro/npehero/Driver.java
index 3e1bd6e..2845cf4 100755
--- a/src/main/java/net/sowgro/npehero/Driver.java
+++ b/src/main/java/net/sowgro/npehero/Driver.java
@@ -13,12 +13,12 @@ import javafx.scene.layout.*;
import javafx.stage.Stage;
import javafx.util.Duration;
import net.sowgro.npehero.editor.ErrorDisplay;
+import net.sowgro.npehero.levelapi.Levels;
import net.sowgro.npehero.main.*;
import net.sowgro.npehero.gui.MainMenu;
-import java.io.FileNotFoundException;
+import java.io.IOException;
import java.net.URL;
-import java.util.List;
import java.util.Stack;
@@ -81,21 +81,30 @@ public class Driver extends Application
primaryStage.show();
Stack<String> errors = new Stack<>();
+ System.out.println("Loading settings...");
try {
Settings.read();
+ System.out.println("Settings loaded");
} catch (Exception e) {
+ e.printStackTrace();
errors.push("Failed to load settings from file\n"+e);
}
- try {
- Levels.readData();
- } catch (FileNotFoundException e) {
- errors.push("Failed to load levels: Level folder is missing\n");
- }
+ System.out.println("Loading controls...");
try {
Control.readFromFile();
+ System.out.println("Controls loaded");
} catch (Exception e) {
+ e.printStackTrace();
errors.push("Failed to load controls from file\n"+e);
}
+ System.out.println("Loading levels...");
+ try {
+ Levels.readData();
+ System.out.println("Loaded " + Levels.list.size() + " levels (" + Levels.getValidList().size() + " valid)");
+ } catch (IOException e) {
+ e.printStackTrace();
+ errors.push("Failed to load levels\n");
+ }
Page last = new MainMenu();
while (!errors.empty()) {
last = new ErrorDisplay(errors.pop(), last);