50 lines
1.2 KiB
JavaScript
50 lines
1.2 KiB
JavaScript
const { app, BrowserWindow } = require('electron');
|
|
const path = require('path');
|
|
|
|
let assetManagerWindow;
|
|
|
|
function createAssetManagerWindow() {
|
|
assetManagerWindow = new BrowserWindow({
|
|
width: 1600,
|
|
height: 1000,
|
|
title: '🎨 NovaFarma Asset Manager',
|
|
backgroundColor: '#1a1a1a',
|
|
icon: path.join(__dirname, 'build', 'icon.png'),
|
|
webPreferences: {
|
|
nodeIntegration: true,
|
|
contextIsolation: false,
|
|
enableRemoteModule: true
|
|
}
|
|
});
|
|
|
|
// Load the Asset Browser HTML
|
|
assetManagerWindow.loadFile(path.join(__dirname, 'tools', 'asset_browser.html'));
|
|
|
|
// Open DevTools in development
|
|
if (process.env.NODE_ENV === 'development') {
|
|
assetManagerWindow.webContents.openDevTools();
|
|
}
|
|
|
|
assetManagerWindow.on('closed', () => {
|
|
assetManagerWindow = null;
|
|
});
|
|
|
|
console.log('🎨 Asset Manager window created');
|
|
}
|
|
|
|
app.whenReady().then(() => {
|
|
createAssetManagerWindow();
|
|
|
|
app.on('activate', () => {
|
|
if (BrowserWindow.getAllWindows().length === 0) {
|
|
createAssetManagerWindow();
|
|
}
|
|
});
|
|
});
|
|
|
|
app.on('window-all-closed', () => {
|
|
if (process.platform !== 'darwin') {
|
|
app.quit();
|
|
}
|
|
});
|