This commit is contained in:
2026-04-27 22:50:18 +08:00
parent ded6f6ee2a
commit b6c6640548
77 changed files with 5240 additions and 833 deletions

View File

@@ -10,6 +10,7 @@ export type RpgRuntimeAppIntent =
token: number;
kind: 'custom-world';
profile: CustomWorldProfile;
mode?: 'play' | 'test';
}
| {
token: number;
@@ -19,8 +20,10 @@ export type RpgRuntimeAppIntent =
export function RpgRuntimeApp({
initialIntent,
onExitRuntime,
}: {
initialIntent: RpgRuntimeAppIntent | null;
onExitRuntime?: () => void;
}) {
const gameShellProps = useRpgRuntimeSession();
const handledIntentTokenRef = useRef<number | null>(null);
@@ -32,14 +35,16 @@ export function RpgRuntimeApp({
handledIntentTokenRef.current = initialIntent.token;
if (initialIntent.kind === 'custom-world') {
gameShellProps.entry.handleCustomWorldSelect(initialIntent.profile);
gameShellProps.entry.handleCustomWorldSelect(initialIntent.profile, {
mode: initialIntent.mode ?? 'play',
});
return;
}
gameShellProps.entry.handleContinueGame(initialIntent.snapshot);
}, [gameShellProps.entry, initialIntent]);
return <RpgRuntimeShell {...gameShellProps} />;
return <RpgRuntimeShell {...gameShellProps} onExitTestRuntime={onExitRuntime} />;
}
export default RpgRuntimeApp;