feat(grid): именованные шаблоны сетки кампании

Несколько шаблонов в проекте с ручным сохранением и применением (включает сетку); без автоподстановки.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ivan Fontosh
2026-09-03 12:04:47 +08:00
parent 278eb78637
commit a4d7ab77e7
14 changed files with 681 additions and 6 deletions
+20
View File
@@ -1000,6 +1000,26 @@ async function main() {
const previewDataUrl = `data:${mime};base64,${buf.toString('base64')}`;
return { canceled: false as const, filePath, previewDataUrl };
});
registerHandler(ipcChannels.project.addGridTemplate, async ({ name, type, sizeN, color }) => {
const project = await projectStore.addGridTemplate({ name, type, sizeN, color });
emitSessionState();
return { project };
});
registerHandler(ipcChannels.project.renameGridTemplate, async ({ templateId, name }) => {
const project = await projectStore.renameGridTemplate(templateId, name);
emitSessionState();
return { project };
});
registerHandler(ipcChannels.project.deleteGridTemplate, async ({ templateId }) => {
const project = await projectStore.deleteGridTemplate(templateId);
emitSessionState();
return { project };
});
registerHandler(ipcChannels.project.applyGridTemplate, async ({ sceneId, templateId }) => {
const scene = await projectStore.applyGridTemplate(sceneId, templateId);
emitSessionState();
return { scene };
});
registerHandler(
ipcChannels.project.upsertNpc,
async ({ npcId, name, description, filePath: pathFromDrop, groupId, ringColor, disposition, imageOffset }) => {