From 5ddeed6d193ec311b8e0c4946ae11175215c0e27 Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Tue, 27 May 2025 20:54:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BB=9F=E8=AE=A1=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/render/components/list.tsx | 26 ++++++++++++++++--- .../client-modules/src/render/ui/main.tsx | 5 ++-- .../src/render/ui/statistics.tsx | 21 ++++++++++----- packages/system-action/src/hotkey.ts | 2 +- packages/system-ui/src/controller.ts | 2 ++ 5 files changed, 43 insertions(+), 13 deletions(-) diff --git a/packages-user/client-modules/src/render/components/list.tsx b/packages-user/client-modules/src/render/components/list.tsx index 7e03922..5e60e27 100644 --- a/packages-user/client-modules/src/render/components/list.tsx +++ b/packages-user/client-modules/src/render/components/list.tsx @@ -73,18 +73,36 @@ export const List = defineComponent( props.loc[2] ?? 200, lineHeight.value ]; + const selectionLoc: ElementLocator = [ + 0, + 0, + (props.loc[2] ?? 200) - 10, + lineHeight.value + ]; + const textLoc: ElementLocator = [ + 10, + lineHeight.value / 2, + void 0, + void 0, + 0, + 0.5 + ]; return ( - select(key)}> + select(key)}> {selected.value === key && ( )} - + ); })} @@ -171,7 +189,7 @@ export const ListPage = defineComponent< }; return () => ( - + { )} diff --git a/packages-user/client-modules/src/render/ui/statistics.tsx b/packages-user/client-modules/src/render/ui/statistics.tsx index cfe6f38..a60c7f0 100644 --- a/packages-user/client-modules/src/render/ui/statistics.tsx +++ b/packages-user/client-modules/src/render/ui/statistics.tsx @@ -30,7 +30,7 @@ export interface StatisticsProps extends UIComponentProps, DefaultProps { } const statisticsProps = { - props: ['data'] + props: ['data', 'controller', 'instance'] } satisfies SetupComponentOptions; export const Statistics = defineComponent(props => { @@ -52,6 +52,7 @@ export const Statistics = defineComponent(props => { loc={[180, 0, 480, 480]} close onClose={close} + lineHeight={24} > {{ total: () => , @@ -67,21 +68,29 @@ interface StatisticsPanelProps extends DefaultProps { data: StatisticsData; } +const statisticsPanelProps = { + props: ['data'] +} satisfies SetupComponentOptions; + const TotalStatistics = defineComponent(props => { - return () => ; -}, statisticsProps); + return () => ( + + + + ); +}, statisticsPanelProps); const FloorStatistics = defineComponent(props => { return () => ; -}, statisticsProps); +}, statisticsPanelProps); const EnemyStatistics = defineComponent(props => { return () => ; -}, statisticsProps); +}, statisticsPanelProps); const PotionStatistics = defineComponent(props => { return () => ; -}, statisticsProps); +}, statisticsPanelProps); function calculateStatistics(): StatisticsData { core.setFlag('__statistics__', true); diff --git a/packages/system-action/src/hotkey.ts b/packages/system-action/src/hotkey.ts index 52722b8..cb2dd89 100644 --- a/packages/system-action/src/hotkey.ts +++ b/packages/system-action/src/hotkey.ts @@ -125,7 +125,7 @@ export class Hotkey extends EventEmitter { }; this.ensureMap(d.key); if (d.id in this.data) { - console.warn(`已存在id为${d.id}的按键,已将其覆盖`); + // console.warn(`已存在id为${d.id}的按键,已将其覆盖`); } this.data[d.id] = d; const arr = this.keyMap.get(d.key)!; diff --git a/packages/system-ui/src/controller.ts b/packages/system-ui/src/controller.ts index 9147d7e..c9a188e 100644 --- a/packages/system-ui/src/controller.ts +++ b/packages/system-ui/src/controller.ts @@ -194,6 +194,7 @@ export class UIController break; } this.sysShowBack.value = true; + this.emit('open', ui, ins); return ins; } @@ -230,6 +231,7 @@ export class UIController if (!this.keepBack && this.stack.length === 0) { this.sysShowBack.value = false; } + this.keepBack = false; this.emit('close', ui); }