diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 126839d..22823d1 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -11,15 +11,10 @@ jobs:
haxe-version: 4.2.5
- name: Set up Haxelib dependencies
run: haxe -cp cmd -D analyzer-optimize --run Main
- - name: Update submodules
- run: git submodule update --init --recursive
- - name: Build crash handler
- run: |
- cd crash
- haxelib run lime build windows
+ # - name: Update submodules
+ # run: git submodule update --init --recursive
- name: Build project
run: |
- cd D:/a/Proto-Engine-FNF/Proto-Engine-FNF
haxelib run lime build windows
- name: Uploading artifact
uses: actions/upload-artifact@v2
diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index bfd29a6..0000000
--- a/.gitmodules
+++ /dev/null
@@ -1,3 +0,0 @@
-[submodule "crash"]
- path = crash
- url = https://github.com/Fyrid19/ProtoCrashHandler
diff --git a/Project.xml b/Project.xml
index 29c30dc..5073a6c 100644
--- a/Project.xml
+++ b/Project.xml
@@ -3,7 +3,7 @@
-
+
diff --git a/crash b/crash
deleted file mode 160000
index 65a17f7..0000000
--- a/crash
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 65a17f7e6f0ea1ad02a9299ad3895f7ced53ea81
diff --git a/source/Main.hx b/source/Main.hx
index b25457c..87d3b1a 100644
--- a/source/Main.hx
+++ b/source/Main.hx
@@ -38,8 +38,7 @@ class Main extends Sprite {
}
private function init(?E:Event):Void {
- if (hasEventListener(Event.ADDED_TO_STAGE))
- {
+ if (hasEventListener(Event.ADDED_TO_STAGE)) {
removeEventListener(Event.ADDED_TO_STAGE, init);
}
@@ -65,6 +64,9 @@ class Main extends Sprite {
gameWidth = Math.ceil(stageWidth / zoom);
gameHeight = Math.ceil(stageHeight / zoom);
}
+
+ haxe.ui.Toolkit.theme = 'dark';
+ haxe.ui.Toolkit.init();
game = new FNFGame(gameWidth, gameHeight, initialState, framerate, framerate, skipSplash, startFullscreen);
addChild(game);
diff --git a/source/funkin/crash/CrashState.hx b/source/funkin/crash/CrashState.hx
new file mode 100644
index 0000000..9ec0bed
--- /dev/null
+++ b/source/funkin/crash/CrashState.hx
@@ -0,0 +1,11 @@
+package funkin.crash;
+
+class CrashState extends MusicBeatState {
+ override function create() {
+ super.create();
+ }
+
+ override function update(elapsed:Float) {
+ super.update(elapsed);
+ }
+}
\ No newline at end of file
diff --git a/source/funkin/states/InitialState.hx b/source/funkin/states/InitialState.hx
index f9356c2..8f3104e 100644
--- a/source/funkin/states/InitialState.hx
+++ b/source/funkin/states/InitialState.hx
@@ -86,7 +86,7 @@ class InitialState extends MusicBeatState {
}
// base code by sqirra-rng
- #if CRASH_HANDLER
+ // #if CRASH_HANDLER
function onCrash(e:UncaughtErrorEvent):Void {
var errMsg:String = '';
var errData:String = '';
@@ -112,8 +112,29 @@ class InitialState extends MusicBeatState {
}
}
- new Process("./crash/ProtoCrash.exe", [errMsg, errData, dateNow]);
+ var appVer:String = '1.0';
+ var crashLocation:String = "./crash/crashlog/";
+ var fileName:String = 'ProtoCrashLog_' + dateFormat + '.txt';
+ var normalFilePath:String = Path.normalize(crashLocation + fileName);
+ final errCompact:String = 'Prototype Engine Crash Handler v' + appVer + '\n'
+ + errMsg + '\n\n'
+ + errData + '\n\n' + 'Crash at $crashDate\n'
+ + 'Original code by sqirra-rng';
+ if (!FileSystem.exists("./crash/")) {
+ crashLocation = "./crashlog/";
+ normalFilePath = Path.normalize(crashLocation + fileName);
+ }
+
+ if (!FileSystem.exists(crashLocation))
+ FileSystem.createDirectory(crashLocation);
+
+ if (!FileSystem.exists(crashLocation + fileName)) {
+ File.saveContent(crashLocation + fileName, errCompact);
+ }
+
+ // new Process("./crash/ProtoCrash.exe", [errMsg, errData, dateNow]);
+ Lib.application.window.alert(errCompact, 'Prototype Engine Crash Handler');
Sys.exit(0);
}
- #end
+ // #end
}
\ No newline at end of file