整合地图编辑器
This commit is contained in:
parent
455f17505c
commit
1890dd9e35
27
app/main.js
27
app/main.js
@ -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')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user