aboutsummaryrefslogtreecommitdiff
path: root/crash/wrapper.js
diff options
context:
space:
mode:
authorMinteck <nekostarfan@gmail.com>2021-06-05 19:27:48 +0200
committerMinteck <nekostarfan@gmail.com>2021-06-05 19:27:48 +0200
commit8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6 (patch)
tree7096b67b189c0220826123c7d5b121752545d140 /crash/wrapper.js
downloadkartik-client-8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6.tar.gz
kartik-client-8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6.tar.bz2
kartik-client-8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6.zip
Presque sortie du jeu
Diffstat (limited to 'crash/wrapper.js')
-rw-r--r--crash/wrapper.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/crash/wrapper.js b/crash/wrapper.js
new file mode 100644
index 0000000..ba5a8b9
--- /dev/null
+++ b/crash/wrapper.js
@@ -0,0 +1,41 @@
+const { app, BrowserWindow } = require('electron')
+
+if (require('fs').existsSync(require('os').userInfo().homedir + "/.kartik/config/lang.txt")) {
+ lp = require('fs').readFileSync(require('os').userInfo().homedir + "/.kartik/config/lang.txt").toString();
+}
+
+function createWindow () {
+ const win = new BrowserWindow({
+ width: 800,
+ height: 375,
+ resizeable: false,
+ resizable: false,
+ maximizable: false,
+ bgColor: "#ffffff",
+ title: "Kartik",
+ webPreferences: {
+ nodeIntegration: true,
+ contextIsolation: false,
+ enableRemoteModule: true,
+ webviewTag: true
+ }
+ })
+
+ win.lp = lp;
+ win.loadFile('crash.html')
+ win.setMenu(null);
+}
+
+app.whenReady().then(createWindow)
+
+app.on('window-all-closed', () => {
+ if (process.platform !== 'darwin') {
+ app.quit()
+ }
+})
+
+app.on('activate', () => {
+ if (BrowserWindow.getAllWindows().length === 0) {
+ createWindow()
+ }
+}) \ No newline at end of file