chore: 同步 template 对部分组件的修改

This commit is contained in:
unanmed 2025-10-15 16:34:15 +08:00
parent 228557b866
commit ca7e1a3fce
3 changed files with 11 additions and 6 deletions

View File

@ -715,6 +715,7 @@ export async function routedConfirm(
const confirm = getChoiceRoute(1) === 0; const confirm = getChoiceRoute(1) === 0;
const timeout = core.control.__replay_getTimeout(); const timeout = core.control.__replay_getTimeout();
core.status.route.push(`choices:${confirm ? 0 : 1}`); core.status.route.push(`choices:${confirm ? 0 : 1}`);
core.status.replay.toReplay.shift();
if (timeout === 0) return confirm; if (timeout === 0) return confirm;
const instance = controller.open(ConfirmBoxUI, { const instance = controller.open(ConfirmBoxUI, {
...(props ?? {}), ...(props ?? {}),
@ -769,6 +770,7 @@ export async function routedChoices<T extends ChoiceKey>(
const selected = getChoiceRoute(0); const selected = getChoiceRoute(0);
const timeout = core.control.__replay_getTimeout(); const timeout = core.control.__replay_getTimeout();
core.status.route.push(`choices:${selected}`); core.status.route.push(`choices:${selected}`);
core.status.replay.toReplay.shift();
if (timeout === 0) return choices[selected][0]; if (timeout === 0) return choices[selected][0];
const instance = controller.open(ChoicesUI, { const instance = controller.open(ChoicesUI, {
...(props ?? {}), ...(props ?? {}),
@ -782,7 +784,7 @@ export async function routedChoices<T extends ChoiceKey>(
return choices[selected][0]; return choices[selected][0];
} else { } else {
const choice = await getChoice(controller, choices, loc, width, props); const choice = await getChoice(controller, choices, loc, width, props);
const index = choices.findIndex(v => v[1] === choice); const index = choices.findIndex(v => v[0] === choice);
core.status.route.push(`choices:${index}`); core.status.route.push(`choices:${index}`);
return choice; return choice;
} }

View File

@ -969,10 +969,13 @@ export class TextContentParser {
continue; continue;
} else if (char === '$') { } else if (char === '$') {
// 表达式 // 表达式
pointer++; const next = text[pointer + 1];
inExpression = true; if (next === '{') {
expStart = pointer + 1; pointer++;
continue; inExpression = true;
expStart = pointer + 1;
continue;
}
} else if (char === '\n') { } else if (char === '\n') {
// 在这里预先将换行处理为多个 node会比在分行时再处理更方便 // 在这里预先将换行处理为多个 node会比在分行时再处理更方便
this.addTextNode(pointer + 1, true); this.addTextNode(pointer + 1, true);

View File

@ -22,7 +22,7 @@ export interface ThumbnailProps extends SpriteProps {
damage?: boolean; damage?: boolean;
all?: boolean; all?: boolean;
noHD?: boolean; noHD?: boolean;
/** 缩略图的比例 */ /** 缩略图的比例1 表示与实际地图大小一致 */
size?: number; size?: number;
} }