Files
novafarma/main.js

49 lines
1.1 KiB
JavaScript

const { app, BrowserWindow, ipcMain } = require('electron');
const path = require('path');
const fs = require('fs');
let mainWindow;
function createWindow() {
mainWindow = new BrowserWindow({
width: 1280,
height: 720,
webPreferences: {
nodeIntegration: true,
contextIsolation: false
},
backgroundColor: '#000000',
title: 'Mrtva Dolina - Death Valley'
});
mainWindow.loadFile('index.html');
mainWindow.webContents.openDevTools();
mainWindow.on('closed', () => {
mainWindow = null;
});
}
ipcMain.on('log-action', (event, message) => {
console.log('[LOG]', message);
});
app.whenReady().then(() => {
createWindow();
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow();
}
});
// Handle security warnings
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true';
});
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit();
}
});