Skip to content

Commit 6e21c3f

Browse files
committed
add a button of the reward in setting page
1 parent c2a2b7c commit 6e21c3f

File tree

9 files changed

+100
-39
lines changed

9 files changed

+100
-39
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 {createMatchHistoryWindow} from './matchHistory'
5+
export {matchHistoryIpc} 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-
export const createMatchHistoryWindow = async (userHeader) => {
4+
const createMatchHistoryWindow = async (userHeader) => {
55
const matchHistoryWindow = new BrowserWindow({
66
title: 'FrankMatchHistory',
77
show: false,
@@ -33,3 +33,29 @@ export const createMatchHistoryWindow = async (userHeader) => {
3333
return matchHistoryWindow
3434
}
3535

36+
export const matchHistoryIpc = (userHeader) => {
37+
let matchHistoryWindow
38+
// 展示战力分析窗口
39+
ipcMain.on('showCharts',async () => {
40+
matchHistoryWindow = await createMatchHistoryWindow(userHeader)
41+
// if (clientStatus === '"Matchmaking"' || clientStatus === '"GameStart"' || clientStatus==='"InProgress"'){
42+
// matchHistoryWindow.webContents.send('query-enemy-summoner')
43+
// }
44+
})
45+
// 移动游戏历史窗口
46+
ipcMain.on('move-match-history-window', (event, pos) => {
47+
matchHistoryWindow.setBounds({ x: pos.x, y: pos.y, width: 1024, height: 576 })
48+
})
49+
// 最小化游戏历史窗口
50+
ipcMain.on('match-history-window-min', () => {
51+
matchHistoryWindow.minimize()
52+
})
53+
// 关闭游戏历史窗口
54+
ipcMain.on('close-match-history-window', () => {
55+
for (const currentWindow of BrowserWindow.getAllWindows()) {
56+
if (currentWindow.title === 'MatchHistory'){
57+
currentWindow.close()
58+
}
59+
}
60+
})
61+
}

frankElectron/queryMatch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ export const queryMatchIpc = async (mainWindow,userHeader) => {
3939
ipcMain.on('show-query-match',async () => {
4040
queryMatchWindow = await createQueryMatchWindow(userHeader)
4141
mainWindow.hide()
42-
4342
})
4443
// 移动游戏历史窗口
4544
ipcMain.on('move-query-match-window', (event, pos) => {
@@ -70,8 +69,9 @@ const closeWin = (showMain) => {
7069
}
7170
}
7271
if (showMain){
73-
queryMatchWin.close()
7472
mainWin.show()
73+
queryMatchWin.hide()
74+
queryMatchWin.close()
7575
}else {
7676
queryMatchWin.close()
7777
}

src/background.js

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
createMainWindow,
1414
listenIpc,
1515
makeTray,
16-
createMatchHistoryWindow,
16+
matchHistoryIpc,
1717
queryMatchIpc
1818
} from "../frankElectron";
1919
const Store = require("electron-store");Store.initRenderer()
@@ -24,7 +24,7 @@ const iconPath = path.join(
2424
'app-icon.png',
2525
)
2626
const userHeader =userAgentList[Math.floor((Math.random()*userAgentList.length))]
27-
let credentials;let mainWindow;let assistWindow;let matchHistoryWindow;
27+
let credentials;let mainWindow;let assistWindow
2828

2929
// -----------------------------main---------------------------- //
3030

@@ -35,7 +35,7 @@ const init = async () => {
3535
await startClient() // 启动英雄联盟客户端
3636
listenIpc(mainWindow,assistWindow) // 监听主窗口和助手窗口的事件
3737
queryMatchIpc(mainWindow,userHeader) // 战绩查询窗口
38-
mathcHistoryIpc() // 战绩历史窗口
38+
matchHistoryIpc(userHeader) // 战绩历史窗口
3939
}
4040

4141
app.whenReady().then(async () => {
@@ -78,12 +78,7 @@ const runLcu = async () => {
7878

7979
}else if (data ==='GameStart') {
8080
// 选择英雄结束后,发送消息给渲染进程, 让渲染进程获取到敌方召唤师信息
81-
if ( matchHistoryWindow != null) {
82-
if (!matchHistoryWindow.isDestroyed()) {
83-
matchHistoryWindow.webContents.send('query-enemy-summoner')
84-
}
85-
}
86-
81+
queryEnemyInfo()
8782
assistWindow.hide()
8883
assistWindow.webContents.send('query-enemy-summoner')
8984
clearInterval(idSetInterval)
@@ -151,26 +146,10 @@ const closeWin = (window) => {
151146
}
152147
}
153148
}
154-
155-
const mathcHistoryIpc = async () => {
156-
// 展示战力分析窗口
157-
ipcMain.on('showCharts',async () => {
158-
matchHistoryWindow = await createMatchHistoryWindow(userHeader)
159-
// if (clientStatus === '"Matchmaking"' || clientStatus === '"GameStart"' || clientStatus==='"InProgress"'){
160-
// matchHistoryWindow.webContents.send('query-enemy-summoner')
161-
// }
162-
})
163-
// 移动游戏历史窗口
164-
ipcMain.on('move-match-history-window', (event, pos) => {
165-
matchHistoryWindow.setBounds({ x: pos.x, y: pos.y, width: 1024, height: 576 })
166-
})
167-
// 最小化游戏历史窗口
168-
ipcMain.on('match-history-window-min', () => {
169-
matchHistoryWindow.minimize()
170-
})
171-
// 关闭游戏历史窗口
172-
ipcMain.on('close-match-history-window', () => {
173-
closeWin('MatchHistory')
174-
})
149+
const queryEnemyInfo = () => {
150+
for (const currentWindow of BrowserWindow.getAllWindows()) {
151+
if (currentWindow.title === 'MatchHistory'){
152+
currentWindow.webContents.send('query-enemy-summoner')
153+
}
154+
}
175155
}
176-

src/render/assets/pay/wxpay.jpg

166 KB
Loading

src/render/assets/pay/zfbpay.jpg

126 KB
Loading

src/render/components/home/setting.vue

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@
6161
一切都将一去杳然
6262
</n-popconfirm>
6363
</n-space>
64+
65+
<n-space>
66+
<n-tag :bordered="false" >赞助发电</n-tag>
67+
<n-button size="small" type="success" style="width: 214px;"
68+
secondary @click="showModal = true">赞助作者持续开发
69+
</n-button>
70+
</n-space>
71+
6472
<n-space class="alignCent">
6573
<n-tag :bordered="false">运行文件</n-tag>
6674

@@ -75,6 +83,7 @@
7583
<span>例如 C:\LOL\英雄联盟\TCLS\Client.exe</span>
7684
</n-popover>
7785

86+
7887
<n-popover trigger="hover" v-else>
7988
<template #trigger>
8089
<n-tag :bordered="false" type="success" style="line-height: 28px !important;" @click="getGameDirectory">
@@ -88,6 +97,7 @@
8897
</n-popover>
8998

9099
</n-space>
100+
91101
<n-space>
92102
<n-tag :bordered="false">回到首页</n-tag>
93103
<n-button size="small" type="success" style="width: 214px;"
@@ -96,14 +106,47 @@
96106
</n-space>
97107
</n-space>
98108
</n-card>
109+
<n-modal v-model:show="showModal" >
110+
<n-card
111+
style="width: 356px"
112+
:bordered="false"
113+
size="small"
114+
role="dialog"
115+
>
99116

117+
<div>
118+
<n-space justify="space-between" style="padding: 0px 4px 0px 4px">
119+
<n-tag type="success" :bordered = false style="width: 142px;justify-content: center">
120+
微信 ٩(◕‿◕。)۶
121+
</n-tag>
122+
<n-tag type="info" :bordered = false style="width: 142px;justify-content: center">
123+
支付宝(●'◡'●)
124+
</n-tag>
125+
</n-space>
126+
<n-space justify="space-between">
127+
<img style="width: 150px;" src="../../../render/assets/pay/wxpay.jpg">
128+
<img style="width: 150px;" src="../../../render/assets/pay/zfbpay.jpg">
129+
</n-space>
130+
</div>
131+
<template #footer>
132+
<div style="margin-left: 4px">
133+
<p>
134+
Frank 全新的 LOL助手软件 [永久免费 代码开源]
135+
</p>
136+
<p>
137+
您的赞助会使作者越做越好 感谢您的大力支持❤️
138+
</p>
139+
</div>
140+
</template>
141+
</n-card>
142+
</n-modal>
100143
</div>
101144
</template>
102145

103146
<script setup>
104147
import {
105148
NCard, NSpace, NTag, NButton, NEllipsis, NPopover,
106-
NSelect, NSwitch, NSlider, useMessage, NPopconfirm
149+
NSelect, NSwitch, NSlider, useMessage, NPopconfirm,NModal
107150
} from 'naive-ui'
108151
import {optionsChampion} from '@/utils/render/lolDataList'
109152
import {ref} from "vue";
@@ -123,6 +166,7 @@ let banChampion = ref(appConfig.get('autoBanChampion.championId'))
123166
const optionsChampionBan = optionsChampion
124167
let isAccept = ref(appConfig.get('autoAccept'))
125168
const message = useMessage()
169+
const showModal = ref(false)
126170
127171
// 判断是否已经获取路径
128172
if (appConfig.get('gameDirectory') != '') {
@@ -194,6 +238,7 @@ const toReset = async () => {
194238
message.success('设置已恢复默认, 建议重启Frank')
195239
}
196240
241+
197242
</script>
198243

199244
<style scoped>

src/render/components/queryMatch/dashboard.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@
4747
<n-input style="width: 153px;" size="small" v-model:value="searchName" @keydown.enter="searchSummonerInfo" placeholder="仅支持当前大区玩家"/>
4848
<n-button type="success" size="small" @click="searchSummonerInfo" >搜索</n-button>
4949
</n-space>
50-
<n-pagination :on-update-page="changePage(page)"
50+
<n-pagination style="font-family: Arial"
51+
:on-update-page="changePage(page)"
5152
v-model:page="page" :page-count="20" :page-slot="7" />
5253

54+
5355
</n-space>
5456

5557
</header>

src/utils/main/lcu.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,20 @@ const champSelectPatchAction = async (credentials, actionID, champId, type) => {
1111
}
1212

1313
try {
14-
const res = await createHttp1Request({
14+
// const res = await createHttp1Request({
15+
// method: "PATCH",
16+
// url: `/lol-champ-select/v1/session/actions/${actionID}`,
17+
// body: localBody
18+
// }, credentials)
19+
// todo http2 PATCH
20+
const session = await createHttpSession(credentials)
21+
const res = await createHttp2Request({
1522
method: "PATCH",
1623
url: `/lol-champ-select/v1/session/actions/${actionID}`,
1724
body: localBody
18-
}, credentials)
25+
},session, credentials)
26+
session.close()
27+
console.log(res.raw)
1928
return res.status
2029
} catch (e) {
2130
console.log('Json Error Can Ignore')

0 commit comments

Comments
 (0)