整合地图编辑器

This commit is contained in:
zhl 2021-10-18 16:25:36 +08:00
parent 455f17505c
commit 1890dd9e35

View File

@ -7,32 +7,25 @@ const { BrowserWindow } = electron
// Keep a global reference of the window object, if you don't, the window will // Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected. // be closed automatically when the JavaScript object is garbage collected.
let win let win
const template = [ const template = [
{ {
label: '地图', label: '功能',
submenu: [ submenu: [
{ {
label: '加载', label: '地图编辑',
accelerator: 'CmdOrCtrl+L', accelerator: 'CmdOrCtrl+1',
click() { click() {
console.log('load map') console.log('地图编辑')
dialog.showOpenDialog({ win.loadURL('https://test.kingsome.cn/html/shoot_editor/index.html')
properties: ['openDirectory']
}).then(result => {
console.log(result) // 输出结果
if (result.filePaths.length > 0) {
// ipcRenderer.send(result.filePaths);
win.webContents.send('load', result.filePaths)
}
})
} }
}, },
{ {
label: '保存', label: '配置管理',
accelerator: 'CmdOrCtrl+S', accelerator: 'CmdOrCtrl+2',
click() { click() {
console.log('save map') console.log('配置管理')
win.webContents.send('save', '') win.loadURL('https://test.kingsome.cn/html/cfgtool/index.html')
} }
} }
] ]