From d1f167ce6fc244df7c5c208394d8c55a867558ab Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Fri, 9 Oct 2026 17:12:18 +0800 Subject: [PATCH] refactor(09-3): align settings.tsx to props.state (D-11/D-13) - MainSettingsProps base IUIDefaultPropsBase -> IUIPropsBase; props array adds 'state' - client.flags -> props.state.flags (2 sites); drop client import - D-13: add // TODO: at both __seed__ flags read sites --- .../client-modules/src/ui/settings.tsx | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/packages-user/client-modules/src/ui/settings.tsx b/packages-user/client-modules/src/ui/settings.tsx index 49ff1c9..008cede 100644 --- a/packages-user/client-modules/src/ui/settings.tsx +++ b/packages-user/client-modules/src/ui/settings.tsx @@ -1,10 +1,5 @@ import { ElementLocator } from '@motajs/render'; -import { - GameUI, - IUIController, - SetupComponentOptions, - IUIDefaultPropsBase -} from '@motajs/system'; +import { GameUI, IUIController, SetupComponentOptions } from '@motajs/system'; import { defineComponent } from 'vue'; import { ChoiceItem, @@ -25,15 +20,14 @@ import { compressToBase64 } from 'lz-string'; import { ViewMapUI } from './viewmap'; import { CENTER_LOC, FULL_LOC, MAIN_HEIGHT, POP_BOX_WIDTH } from '../shared'; import { useKey } from '../render/use'; -import { client } from '../core'; +import { IUIPropsBase } from './types'; -export interface MainSettingsProps - extends Partial, IUIDefaultPropsBase { +export interface MainSettingsProps extends Partial, IUIPropsBase { loc: ElementLocator; } const mainSettingsProps = { - props: ['loc', 'controller', 'instance'] + props: ['loc', 'controller', 'instance', 'state'] } satisfies SetupComponentOptions; const enum MainChoice { @@ -163,7 +157,8 @@ export const ReplaySettings = defineComponent(props => { props.controller.closeAll(); core.ui.closePanel(); const route = core.status.route.slice(); - const flags = client.flags; + // TODO: flags 更新未接(当前无监听系统) + const flags = props.state.flags; const seed = flags.getFieldValue('__seed__'); core.startGame(core.status.hard, seed, route); break; @@ -218,7 +213,8 @@ export const ReplaySettings = defineComponent(props => { break; } case ReplayChoice.Download: { - const flags = client.flags; + // TODO: flags 更新未接(当前无监听系统) + const flags = props.state.flags; const seed = flags.getFieldValue('__seed__'); core.download( core.firstData.name + '_' + core.formatDate2() + '.h5route',