From 8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6 Mon Sep 17 00:00:00 2001 From: Minteck Date: Sat, 5 Jun 2021 19:27:48 +0200 Subject: Presque sortie du jeu --- crash/wrapper.js | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 crash/wrapper.js (limited to 'crash/wrapper.js') 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 -- cgit