From 0747fcaa9a5dbf0bd5b12f7977eac3fd5a28b7db Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Mon, 12 Oct 2026 16:13:35 +0800 Subject: [PATCH] refactor(09-13): replace core.drawTip/core.playSound callsites with direct interfaces - ui/save.tsx: core.drawTip(validation.message) -> TipStore.get('main-tip')?.drawTip(...) (C:drawTip) - ui/settings.tsx: core.playSound('confirm.opus') -> props.state.soundPlayer.play('confirm.opus') (C:playSound) - no client singleton; no new naming; no import type --- packages-user/client-modules/src/ui/save.tsx | 5 +++-- packages-user/client-modules/src/ui/settings.tsx | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages-user/client-modules/src/ui/save.tsx b/packages-user/client-modules/src/ui/save.tsx index 46d8a51..dc411df 100644 --- a/packages-user/client-modules/src/ui/save.tsx +++ b/packages-user/client-modules/src/ui/save.tsx @@ -18,6 +18,7 @@ import { Page, PageExpose, Thumbnail, + TipStore, IGameUIPropsBase } from '@user/client-base'; import { useKey } from '../render/use'; @@ -528,7 +529,7 @@ export function selectSave( controller.close(instance); res(index); } else { - core.drawTip(validation.message); + TipStore.get('main-tip')?.drawTip(validation.message); } }, onDelete: (index: number, exist: boolean) => { @@ -537,7 +538,7 @@ export function selectSave( if (validation.valid) { core.removeSave(index); } else { - core.drawTip(validation.message); + TipStore.get('main-tip')?.drawTip(validation.message); } }, onExit: () => { diff --git a/packages-user/client-modules/src/ui/settings.tsx b/packages-user/client-modules/src/ui/settings.tsx index 58b8617..d18b71a 100644 --- a/packages-user/client-modules/src/ui/settings.tsx +++ b/packages-user/client-modules/src/ui/settings.tsx @@ -428,7 +428,7 @@ export const SyncSaveSelect = defineComponent(props => { const choose = async (key: ChoiceKey) => { switch (key) { case SyncSaveChoice.AllSaves: { - core.playSound('confirm.opus'); + props.state.soundPlayer.play('confirm.opus'); const confirm = await getConfirm( props.controller, '你确定要同步全部存档么?这可能在存档较多的时候比较慢。', @@ -441,7 +441,7 @@ export const SyncSaveSelect = defineComponent(props => { break; } case SyncSaveChoice.NowSave: { - core.playSound('confirm.opus'); + props.state.soundPlayer.play('confirm.opus'); const confirm = await getConfirm( props.controller, '确定要同步当前存档吗?',