|
|
@@ -107,7 +107,7 @@ class MainSerivce {
|
|
|
|
|
|
// 最小化
|
|
|
globalShortcut.register('Ctrl+B', () => {
|
|
|
- if(this.#isMin & 1) {this.mainWin.hide()}else{
|
|
|
+ if (this.#isMin & 1) { this.mainWin.hide() } else {
|
|
|
this.mainWin.show()
|
|
|
}
|
|
|
this.#isMin++
|
|
|
@@ -126,7 +126,7 @@ class MainSerivce {
|
|
|
return true
|
|
|
})
|
|
|
} else if (platform === 'darwin') {
|
|
|
- app.dock.setIcon(join(__dirname, 'electron/icon/playGame@2x.png'))
|
|
|
+ app.dock.setIcon(join(__dirname, './icon/playGame@2x.png'))
|
|
|
}
|
|
|
|
|
|
// 通信
|
|
|
@@ -134,7 +134,7 @@ class MainSerivce {
|
|
|
if (evt === 'close-loading') {
|
|
|
if (this.loadingWin) this.loadingWin.close()
|
|
|
this.mainWin.show()
|
|
|
- // if (this.mainWin.isVisible()) this.connectLogi()
|
|
|
+ if (this.mainWin.isVisible()) this.connectLogi()
|
|
|
} else if (evt === 'minWin') {
|
|
|
this.mainWin.minimize()
|
|
|
} else if (evt === 'closeWin') {
|
|
|
@@ -189,13 +189,13 @@ class MainSerivce {
|
|
|
}
|
|
|
|
|
|
connectLogi() {
|
|
|
- this.contrlEvent = fork(join(__dirname, 'electron/logiControl.js'));
|
|
|
+ this.contrlEvent = fork(join(__dirname, './logiControl.js'));
|
|
|
this.contrlEvent.on('message', msg => {
|
|
|
if (!msg || msg.type === 'err' || !msg.data || !msg.data[44]) {
|
|
|
this.contrlEvent.disconnect()
|
|
|
this.contrlEvent.kill(msg.pid ?? 'SIGKILL')
|
|
|
this.contrlEvent = null
|
|
|
- dialog.showMessageBox(this.mainWin, { message: '请尝试旋转方向或重新插入USB或重启客户端!', type: 'error', title: '连接错误' }).then(async ({ response }) => {
|
|
|
+ dialog.showMessageBox(this.mainWin, { message: msg.text, type: 'error', title: '连接错误' }).then(async ({ response }) => {
|
|
|
if (!response) {
|
|
|
await sleep(2000)
|
|
|
this.connectLogi()
|