Skip to content

Commit 0e7e782

Browse files
committed
update 1.21.1216
1 parent ae5ef5a commit 0e7e782

File tree

4 files changed

+33
-4
lines changed

4 files changed

+33
-4
lines changed

frankElectron/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ export {createMainWindow} from './home'
22
export {createAssistWindow} from './assist'
33
export {makeTray} from './makeTray'
44
export {listenIpc} from './listenCommonIpc'
5-
export {matchHistoryIpc} from './matchHistory'
5+
export {matchHistoryIpc,creatMatchAfterStartGame} from './matchHistory'
66
export {queryMatchIpc} from './queryMatch'

frankElectron/matchHistory.js

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {BrowserWindow, ipcMain} from "electron";
22
import {createProtocol} from "vue-cli-plugin-electron-builder/lib";
33

4-
const createMatchHistoryWindow = async (userHeader) => {
4+
export const createMatchHistoryWindow = async (userHeader) => {
55
const matchHistoryWindow = new BrowserWindow({
66
title: 'FrankMatchHistory',
77
show: false,
@@ -59,3 +59,29 @@ export const matchHistoryIpc = (userHeader) => {
5959
}
6060
})
6161
}
62+
63+
export const creatMatchAfterStartGame = async (userHeader) => {
64+
for (const currentWindow of BrowserWindow.getAllWindows()) {
65+
if (currentWindow.title === 'MatchHistory'){
66+
return
67+
}
68+
}
69+
const matchWin = await createMatchHistoryWindow(userHeader)
70+
matchWin.webContents.send('query-enemy-summoner')
71+
// 移动游戏历史窗口
72+
ipcMain.on('move-match-history-window', (event, pos) => {
73+
matchWin.setBounds({ x: pos.x, y: pos.y, width: 1024, height: 576 })
74+
})
75+
// 最小化游戏历史窗口
76+
ipcMain.on('match-history-window-min', () => {
77+
matchWin.minimize()
78+
})
79+
// 关闭游戏历史窗口
80+
ipcMain.on('close-match-history-window', () => {
81+
for (const currentWindow of BrowserWindow.getAllWindows()) {
82+
if (currentWindow.title === 'MatchHistory'){
83+
currentWindow.close()
84+
}
85+
}
86+
})
87+
}

src/background.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ import {
1414
listenIpc,
1515
makeTray,
1616
matchHistoryIpc,
17-
queryMatchIpc
17+
queryMatchIpc,
18+
creatMatchAfterStartGame
1819
} from "../frankElectron";
1920
const Store = require("electron-store");Store.initRenderer()
2021
const path = require('path')
@@ -83,6 +84,8 @@ const runLcu = async () => {
8384
assistWindow.webContents.send('query-enemy-summoner')
8485
clearInterval(idSetInterval)
8586
ws.unsubscribe('/lol-champ-select/v1/session')
87+
}else if (data==='InProgress'){
88+
creatMatchAfterStartGame(userHeader) // 游戏对局开始后, 打开查询历史战绩窗口
8689
}else if(data ==='PreEndOfGame'){ // PreEndOfGame
8790
if (appConfig.get('isSwitchBlacklist')){assistWindow.show()}
8891
assistWindow.webContents.send('show-other-summoner')

src/render/store/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export const queryStore = defineStore('query',{
5757
export const frankRelease = defineStore('version',{
5858
state: () => {
5959
return {
60-
frankVersion:'1.21.1215'
60+
frankVersion:'1.22.1216'
6161
}
6262
}
6363
})

0 commit comments

Comments
 (0)