Shrani spremembe - 2026-02-02: Čiščenje kode, Electron build setup, GrassScene popravki
This commit is contained in:
37
nova farma TRAE/electron-main.cjs
Normal file
37
nova farma TRAE/electron-main.cjs
Normal file
@@ -0,0 +1,37 @@
|
||||
const { app, BrowserWindow } = require('electron');
|
||||
const path = require('path');
|
||||
|
||||
function createWindow() {
|
||||
const win = new BrowserWindow({
|
||||
width: 1280,
|
||||
height: 720,
|
||||
webPreferences: {
|
||||
nodeIntegration: false,
|
||||
contextIsolation: true,
|
||||
webSecurity: false, // DISABLE SECURITY to allow local file loading
|
||||
// preload: path.join(__dirname, 'preload.js') // Optional
|
||||
},
|
||||
icon: path.join(__dirname, 'assets/DEMO_FAZA1/Characters/gronk_walk_sheet.png')
|
||||
});
|
||||
|
||||
win.loadFile('index.html');
|
||||
|
||||
// Uncomment to open DevTools by default
|
||||
win.webContents.openDevTools();
|
||||
}
|
||||
|
||||
app.whenReady().then(() => {
|
||||
createWindow();
|
||||
|
||||
app.on('activate', () => {
|
||||
if (BrowserWindow.getAllWindows().length === 0) {
|
||||
createWindow();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit();
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user