Skip to content

Commit

Permalink
🐞fix(特性 > 老板键): 老板键现在可以将游戏正确静音了
Browse files Browse the repository at this point in the history
  • Loading branch information
iamapig120 committed Jun 10, 2020
1 parent 145e718 commit 8a1aa8d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/bin/main/mainLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ ipcRenderer.on('open-devtools', () => {
}
})

ipcRenderer.on('set-audio-muted', (event, bool:boolean) => {
if (webContents) {
mainWindow.setAudioMuted(bool)
}
})

let serverInfo: {
url: string
port: number
Expand Down
10 changes: 8 additions & 2 deletions src/utilities/bossKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,17 @@ class BossKey extends Utility {
if (this.isActive) {
// 备份窗口信息 & 隐藏窗口
hideWindow(ManagerWindow)
GameWindows.forEach(window => hideWindow(window))
GameWindows.forEach(window => {
hideWindow(window)
window.webContents.send('set-audio-muted', true)
})
} else {
// 重新显示窗口
showWindow(ManagerWindow)
GameWindows.forEach(window => showWindow(window))
GameWindows.forEach(window => {
showWindow(window)
window.webContents.send('set-audio-muted', false)
})
}
this.isActive = !this.isActive
})
Expand Down

0 comments on commit 8a1aa8d

Please sign in to comment.