整合地图编辑器

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