合并主分支
解决合并冲突
This commit is contained in:
@@ -74,6 +74,7 @@ import {
|
||||
createQuickEditPanelDraft,
|
||||
createRedrawPanelDraft,
|
||||
createSameSourceGenerationDialogDraft,
|
||||
createSceneGenerationDialogDraft,
|
||||
createSoundEffectGenerationDialogDraft,
|
||||
createSpecDialogDraft,
|
||||
createUiDesignGenerationDialogDraft,
|
||||
@@ -654,6 +655,9 @@ function isGenerationDialogModeCompatibleWithSourceLayer(
|
||||
if (sourceLayer.assetKind === 'character') {
|
||||
return mode === 'character';
|
||||
}
|
||||
if (sourceLayer.assetKind === 'scene') {
|
||||
return mode === 'scene';
|
||||
}
|
||||
if (sourceLayer.assetKind === 'character-animation') {
|
||||
return mode === 'character-animation';
|
||||
}
|
||||
@@ -707,31 +711,25 @@ function findSourceAnimationLayer(
|
||||
);
|
||||
}
|
||||
|
||||
const CANVAS_TOOL_BY_GENERATION_MODE = {
|
||||
generate: 'generate',
|
||||
spec: 'spec',
|
||||
character: 'character',
|
||||
icon: 'icon',
|
||||
publication: 'publication',
|
||||
'ui-design': 'ui-design',
|
||||
'quick-edit': 'generate',
|
||||
'character-animation': 'character',
|
||||
video: 'video',
|
||||
'audio-sound-effect': 'music',
|
||||
'audio-background-music': 'music',
|
||||
scene: 'scene',
|
||||
} as const satisfies Record<CanvasGenerationDialogState['mode'], CanvasTool>;
|
||||
|
||||
function getCanvasToolForGenerationMode(
|
||||
mode: CanvasGenerationDialogState['mode'],
|
||||
): CanvasTool {
|
||||
if (mode === 'video') {
|
||||
return 'video';
|
||||
}
|
||||
if (mode === 'audio-sound-effect' || mode === 'audio-background-music') {
|
||||
return 'music';
|
||||
}
|
||||
if (mode === 'character' || mode === 'character-animation') {
|
||||
return 'character';
|
||||
}
|
||||
if (mode === 'icon') {
|
||||
return 'icon';
|
||||
}
|
||||
if (mode === 'publication') {
|
||||
return 'publication';
|
||||
}
|
||||
if (mode === 'ui-design') {
|
||||
return 'ui-design';
|
||||
}
|
||||
if (mode === 'spec') {
|
||||
return 'spec';
|
||||
}
|
||||
return 'generate';
|
||||
return CANVAS_TOOL_BY_GENERATION_MODE[mode] ?? 'generate';
|
||||
}
|
||||
|
||||
const LAST_CHARACTER_SPEC_REFERENCE_CACHE_KEY =
|
||||
@@ -784,10 +782,11 @@ function applyRememberedImageGenerationOptions(
|
||||
function shouldRememberImageGenerationOptions(
|
||||
dialog: GenerateDialogState | null,
|
||||
): dialog is GenerateDialogState & {
|
||||
mode: 'generate' | 'character' | 'icon';
|
||||
mode: 'generate' | 'character' | 'icon' | 'scene';
|
||||
} {
|
||||
return (
|
||||
dialog?.mode === 'generate' ||
|
||||
dialog?.mode === 'scene' ||
|
||||
dialog?.mode === 'character' ||
|
||||
dialog?.mode === 'icon'
|
||||
);
|
||||
@@ -1546,6 +1545,18 @@ export function useImageCanvasGenerationWorkflow({
|
||||
viewport,
|
||||
]);
|
||||
|
||||
const openSceneGenerationDialog = useCallback(() => {
|
||||
openPlacedCanvasGenerationDialog(
|
||||
createSceneGenerationDialogDraft({ canvasSize, viewport }),
|
||||
);
|
||||
activateCanvasGenerationEntry('scene');
|
||||
}, [
|
||||
activateCanvasGenerationEntry,
|
||||
canvasSize,
|
||||
openPlacedCanvasGenerationDialog,
|
||||
viewport,
|
||||
]);
|
||||
|
||||
const openSpecDialog = useCallback(
|
||||
(specType: SpecGenerationType) => {
|
||||
openPlacedCanvasGenerationDialog(
|
||||
@@ -4497,6 +4508,7 @@ export function useImageCanvasGenerationWorkflow({
|
||||
showGenerationWarning,
|
||||
clearGenerationWarning: () => setGenerationWarning(null),
|
||||
openGenerateDialog,
|
||||
openSceneGenerationDialog,
|
||||
openSpecDialog,
|
||||
openCharacterAnimationPanel,
|
||||
openCharacterGenerationDialog,
|
||||
@@ -4603,6 +4615,7 @@ export function useImageCanvasGenerationWorkflow({
|
||||
openEditDialog,
|
||||
extractUiDesignAssets,
|
||||
openGenerateDialog,
|
||||
openSceneGenerationDialog,
|
||||
openIconGenerationDialog,
|
||||
openPublicationGenerationDialog,
|
||||
openRedrawPanel,
|
||||
|
||||
Reference in New Issue
Block a user