1
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user