diff --git a/packages-user/client-modules/src/render/components/choices.tsx b/packages-user/client-modules/src/render/components/choices.tsx index 350f5ef..57459c9 100644 --- a/packages-user/client-modules/src/render/components/choices.tsx +++ b/packages-user/client-modules/src/render/components/choices.tsx @@ -638,10 +638,10 @@ export function getChoice( }); } -function getChoiceRoute() { +function getChoiceRoute(defaults: number) { const route = core.status.replay.toReplay[0]; if (!route.startsWith('choices:')) { - return 0; + return defaults; } else { return Number(route.slice(8)); } @@ -680,9 +680,9 @@ export async function routedConfirm( props?: Partial ) { if (core.isReplaying()) { - const confirm = getChoiceRoute() === 1; + const confirm = getChoiceRoute(1) === 0; const timeout = core.control.__replay_getTimeout(); - core.status.route.push(`choices:${confirm ? 1 : 0}`); + core.status.route.push(`choices:${confirm ? 0 : 1}`); if (timeout === 0) return confirm; const instance = controller.open(ConfirmBoxUI, { ...(props ?? {}), @@ -696,7 +696,7 @@ export async function routedConfirm( return confirm; } else { const confirm = await getConfirm(controller, text, loc, width, props); - core.status.route.push(`choices:${confirm ? 1 : 0}`); + core.status.route.push(`choices:${confirm ? 0 : 1}`); return confirm; } } @@ -734,7 +734,7 @@ export async function routedChoices( props?: Partial ): Promise { if (core.isReplaying()) { - const selected = getChoiceRoute(); + const selected = getChoiceRoute(0); const timeout = core.control.__replay_getTimeout(); core.status.route.push(`choices:${selected}`); if (timeout === 0) return choices[selected][0]; diff --git a/packages-user/client-modules/src/render/ui/main.tsx b/packages-user/client-modules/src/render/ui/main.tsx index f38722b..9f410de 100644 --- a/packages-user/client-modules/src/render/ui/main.tsx +++ b/packages-user/client-modules/src/render/ui/main.tsx @@ -23,7 +23,6 @@ import { LeftStatusBar, RightStatusBar } from './statusBar'; -import { onLoaded } from '../use'; import { ReplayingStatus } from './toolbar'; import { getHeroStatusOn, HeroSkill, NightSpecial } from '@user/data-state'; import { jumpIgnoreFloor } from '@user/legacy-plugin-data'; @@ -82,11 +81,6 @@ const MainScene = defineComponent(() => { const locked = ref(false); const weather = new WeatherController('main'); - const loaded = ref(true); - onLoaded(() => { - loaded.value = true; - }); - onMounted(() => { weather.bind(map.value); }); @@ -260,13 +254,11 @@ const MainScene = defineComponent(() => { return () => ( - {loaded.value && ( - - )} + { /> - {loaded.value && ( - - )} +