Implement scene-based chapter quest progression
Some checks failed
CI / verify (push) Has been cancelled
Some checks failed
CI / verify (push) Has been cancelled
This commit is contained in:
@@ -15,6 +15,9 @@ export type AppRouteMatch =
|
||||
| {
|
||||
kind: 'preset-editor';
|
||||
initialTab: PresetEditorTab;
|
||||
}
|
||||
| {
|
||||
kind: 'qwen-sprite-tool';
|
||||
};
|
||||
|
||||
export type ResolvedAppRoute = {
|
||||
@@ -33,6 +36,9 @@ const PresetEditorApp = lazy(async () => {
|
||||
default: module.PresetEditor,
|
||||
};
|
||||
}) as AppRouteComponent;
|
||||
const QwenSpriteToolApp = lazy(
|
||||
() => import('../tools/QwenSpriteSheetTool'),
|
||||
) as AppRouteComponent;
|
||||
|
||||
const PRESET_EDITOR_ROUTES: Array<{
|
||||
prefixes: string[];
|
||||
@@ -60,6 +66,12 @@ const PRESET_EDITOR_ROUTES: Array<{
|
||||
},
|
||||
];
|
||||
|
||||
const QWEN_SPRITE_TOOL_PREFIXES = [
|
||||
'/qwen-sprite-tool',
|
||||
'/sprite-tool',
|
||||
'/pixelmotion-qwen',
|
||||
];
|
||||
|
||||
function normalizeRoutePath(pathname: string) {
|
||||
const trimmedPathname = pathname.trim().toLowerCase();
|
||||
|
||||
@@ -80,6 +92,16 @@ function matchesRoutePrefix(pathname: string, prefix: string) {
|
||||
|
||||
export function matchAppRoute(pathname: string): AppRouteMatch {
|
||||
const normalizedPathname = normalizeRoutePath(pathname);
|
||||
const isQwenSpriteToolRoute = QWEN_SPRITE_TOOL_PREFIXES.some((prefix) =>
|
||||
matchesRoutePrefix(normalizedPathname, prefix),
|
||||
);
|
||||
|
||||
if (isQwenSpriteToolRoute) {
|
||||
return {
|
||||
kind: 'qwen-sprite-tool',
|
||||
};
|
||||
}
|
||||
|
||||
const presetRoute = PRESET_EDITOR_ROUTES.find((route) =>
|
||||
route.prefixes.some((prefix) =>
|
||||
matchesRoutePrefix(normalizedPathname, prefix),
|
||||
@@ -101,6 +123,15 @@ export function matchAppRoute(pathname: string): AppRouteMatch {
|
||||
export function resolveAppRoute(pathname: string): ResolvedAppRoute {
|
||||
const matchedRoute = matchAppRoute(pathname);
|
||||
|
||||
if (matchedRoute.kind === 'qwen-sprite-tool') {
|
||||
return {
|
||||
kind: matchedRoute.kind,
|
||||
loadingEyebrow: '正在载入精灵表工坊',
|
||||
loadingText: '正在载入 Qwen 精灵表工具...',
|
||||
Component: QwenSpriteToolApp,
|
||||
};
|
||||
}
|
||||
|
||||
if (matchedRoute.kind === 'preset-editor') {
|
||||
return {
|
||||
kind: matchedRoute.kind,
|
||||
|
||||
Reference in New Issue
Block a user