From 997cd4cf0a14353256540c7e3f7f318668903957 Mon Sep 17 00:00:00 2001 From: Hanxven Date: Mon, 16 Sep 2024 22:42:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E4=B8=AA=E5=B1=95=E7=A4=BA=E6=AE=B5?= =?UTF-8?q?=E4=BD=8D=E8=AF=A6=E6=83=85=E7=9A=84=E8=A1=A8=E6=A0=BC=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 6 - src/main/modules/core-functionality/state.ts | 13 +- .../components/RankedTable.vue | 214 +++++++++++++++ .../views/match-history/MatchHistoryTab.vue | 44 ++-- .../match-history/widgets/RankedDisplay.vue | 8 +- .../views/ongoing-game/PlayerInfoCard.vue | 196 ++++++++------ .../views/ongoing-game/RankedSpan.vue | 246 ------------------ .../views/ongoing-game/ongoing-game-utils.ts | 14 +- .../src-main-window/views/test/Test.vue | 13 +- src/shared/utils/ranked.ts | 4 +- 10 files changed, 372 insertions(+), 386 deletions(-) create mode 100644 src/renderer/src-main-window/components/RankedTable.vue delete mode 100644 src/renderer/src-main-window/views/ongoing-game/RankedSpan.vue diff --git a/CHANGELOG.md b/CHANGELOG.md index e5257245..acd88c3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,14 +18,8 @@ - 添加了一个设置项,位于 `应用` -> `其他` -> `禁用硬件加速`,可选择是否禁用硬件加速。适用于界面渲染模糊的情况,但也会显著降低性能。 -- [TODO] 观战功能在短屏幕下也要支持。 - -- [UNTESTED] 遇到过 - UI 补全 - - [TODO] hover 排位信息补全 -- [TODO] 排查:对局分析多余的加载。 - - [TODO] 补全对局分析的刷新按钮和队列筛选按钮。 ## 调整 diff --git a/src/main/modules/core-functionality/state.ts b/src/main/modules/core-functionality/state.ts index a426934d..63b96ccd 100644 --- a/src/main/modules/core-functionality/state.ts +++ b/src/main/modules/core-functionality/state.ts @@ -77,7 +77,6 @@ class CoreFunctionalitySettings { this.playerAnalysisFetchConcurrency = limit } - setUseSgpApi(value: boolean) { this.useSgpApi = value } @@ -408,12 +407,12 @@ export class CoreFunctionalityState { if ( lcu.gameflow.session && - (lcu.gameflow.phase === 'GameStart' || - lcu.gameflow.phase === 'InProgress' || - lcu.gameflow.phase === 'WaitingForStats' || - lcu.gameflow.phase === 'PreEndOfGame' || - lcu.gameflow.phase === 'EndOfGame' || - lcu.gameflow.phase === 'Reconnect') + (lcu.gameflow.session.phase === 'GameStart' || + lcu.gameflow.session.phase === 'InProgress' || + lcu.gameflow.session.phase === 'WaitingForStats' || + lcu.gameflow.session.phase === 'PreEndOfGame' || + lcu.gameflow.session.phase === 'EndOfGame' || + lcu.gameflow.session.phase === 'Reconnect') ) { return { phase: 'in-game', diff --git a/src/renderer/src-main-window/components/RankedTable.vue b/src/renderer/src-main-window/components/RankedTable.vue new file mode 100644 index 00000000..a428d011 --- /dev/null +++ b/src/renderer/src-main-window/components/RankedTable.vue @@ -0,0 +1,214 @@ + + + + + diff --git a/src/renderer/src-main-window/views/match-history/MatchHistoryTab.vue b/src/renderer/src-main-window/views/match-history/MatchHistoryTab.vue index 28fd6f2a..4227e70b 100644 --- a/src/renderer/src-main-window/views/match-history/MatchHistoryTab.vue +++ b/src/renderer/src-main-window/views/match-history/MatchHistoryTab.vue @@ -7,12 +7,15 @@ />
- +
+ +
+
@@ -477,7 +480,7 @@ import { NavigateBeforeOutlined as NavigateBeforeOutlinedIcon, NavigateNextOutlined as NavigateNextOutlinedIcon } from '@vicons/material' -import { useIntervalFn, useMediaQuery } from '@vueuse/core' +import { useIntervalFn, useMediaQuery, useScroll } from '@vueuse/core' import { NButton, NIcon, @@ -492,6 +495,7 @@ import { import { computed, nextTick, ref, shallowRef, useTemplateRef, watch } from 'vue' import PlayerTagEditModal from '@main-window/components/PlayerTagEditModal.vue' +import RankedTable from '@main-window/components/RankedTable.vue' import { matchHistoryTabsRendererModule as mhm } from '@main-window/modules/match-history-tabs' import { TabState, useMatchHistoryTabsStore } from '@main-window/modules/match-history-tabs/store' @@ -543,7 +547,7 @@ const analysis = computed(() => { const eds = useExternalDataSourceStore() -const scrollRef = useTemplateRef('scroll') +const scrollEl = useTemplateRef('scroll') const rightEl = useTemplateRef('right') const mh = useMatchHistoryTabsStore() @@ -568,7 +572,7 @@ const isSomethingLoading = computed(() => { const scrollToRightElTop = () => { const top = rightEl.value?.offsetTop if (top && top < mainContentScrollTop.value) { - scrollRef.value?.scrollTo({ top: top }) + scrollEl.value?.scrollTo({ top: top }) } } @@ -851,15 +855,18 @@ watch( watch( () => mh.currentTab?.id, () => { - if (mh.currentTab?.id === tab.puuid) { + if (mh.currentTab?.id === tab.id) { nextTick(() => { - scrollRef.value?.scrollTo({ top: mainContentScrollTop.value }) + scrollEl.value?.scrollTo({ top: mainContentScrollTop.value }) }) } - } + }, + { immediate: true } ) defineExpose({ + id: tab.id, + sgpServerId: tab.sgpServerId, puuid: tab.puuid, refresh: handleRefresh }) @@ -874,13 +881,20 @@ defineExpose({ } .ranked-modal { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 16px; + display: flex; + align-items: center; + flex-direction: column; border-radius: 4px; background-color: #202020; padding: 16px; + .blocks { + margin-bottom: 16px; + display: grid; + grid-template-columns: 1fr 1fr; + gap: 16px; + } + .ranked { background-color: #f4f4f40e; } diff --git a/src/renderer/src-main-window/views/match-history/widgets/RankedDisplay.vue b/src/renderer/src-main-window/views/match-history/widgets/RankedDisplay.vue index b54f3a96..59e9bf78 100644 --- a/src/renderer/src-main-window/views/match-history/widgets/RankedDisplay.vue +++ b/src/renderer/src-main-window/views/match-history/widgets/RankedDisplay.vue @@ -1,7 +1,7 @@