diff options
author | Minteck <46352972+Minteck@users.noreply.github.com> | 2021-07-20 01:30:23 +0200 |
---|---|---|
committer | Minteck <46352972+Minteck@users.noreply.github.com> | 2021-07-20 01:30:23 +0200 |
commit | 44210691ee8444509ac466a362337af77f2bcd49 (patch) | |
tree | 4dc2f242cf5fd4daa3fc6f9e42516e7d55b73538 /views/script/core_crash.js | |
parent | efa5fc926071de7087836d399c42f53e701b4cff (diff) | |
download | kartik-client-44210691ee8444509ac466a362337af77f2bcd49.tar.gz kartik-client-44210691ee8444509ac466a362337af77f2bcd49.tar.bz2 kartik-client-44210691ee8444509ac466a362337af77f2bcd49.zip |
Commit
Diffstat (limited to 'views/script/core_crash.js')
-rw-r--r-- | views/script/core_crash.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/views/script/core_crash.js b/views/script/core_crash.js new file mode 100644 index 0000000..d24ec2d --- /dev/null +++ b/views/script/core_crash.js @@ -0,0 +1,21 @@ +global.gameCrashed = false; +crashSound = new Audio("./sfx/gamecrash.wav"); + +function destroy() { + global.gameCrashed = true; + crashSound.play(); + require('@electron/remote').webContents.fromId(webview.getWebContentsId()).forcefullyCrashRenderer(); + try { musicElement.pause(); } catch (e) {} +} + +function spawnError(crashReport) { + document.getElementById("error-outer").style.display = "flex"; + document.getElementById("crash-dump").value = crashReport; + destroy(); +} + +const crashHandler = require('electron').ipcRenderer; + +crashHandler.on('crashreport', (event, args) => { + spawnError(args); +})
\ No newline at end of file |