feat(materials): add campaign materials overlay for sessions

Let GMs manage and show images over the scene from the editor and control panel, with zoom tools, help docs, and full ru/en i18n.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ivan Fontosh
2026-07-17 11:05:38 +08:00
parent 195d4be086
commit 61875be857
39 changed files with 2521 additions and 22 deletions
+20 -1
View File
@@ -15,7 +15,7 @@ export function appDisplayNameForLocale(localeTag: string): string {
/** Префикс заголовка окон: `TTRPG - Редактор`. */
export const APP_WINDOW_BRAND = 'TTRPG';
export type AppWindowKind = 'editor' | 'presentation' | 'control' | 'boot' | 'sceneDescription';
export type AppWindowKind = 'editor' | 'presentation' | 'control' | 'boot' | 'sceneDescription' | 'materials';
const WINDOW_SUFFIX: Record<AppWindowKind, { ru: string; en: string }> = {
editor: { ru: 'Редактор', en: 'Editor' },
@@ -23,6 +23,7 @@ const WINDOW_SUFFIX: Record<AppWindowKind, { ru: string; en: string }> = {
control: { ru: 'Пульт', en: 'Control' },
boot: { ru: 'Загрузка', en: 'Loading' },
sceneDescription: { ru: 'Описание сцены', en: 'Scene description' },
materials: { ru: 'Материалы', en: 'Materials' },
};
export function windowChromeTitle(kind: AppWindowKind, localeTag: string): string {
@@ -30,3 +31,21 @@ export function windowChromeTitle(kind: AppWindowKind, localeTag: string): strin
const suffix = tag.startsWith('ru') ? WINDOW_SUFFIX[kind].ru : WINDOW_SUFFIX[kind].en;
return `${APP_WINDOW_BRAND} - ${suffix}`;
}
/** Подписи фильтров в системных диалогах выбора файла (main process). */
export function openDialogFilterLabel(
kind: 'images' | 'imagesAndVideo' | 'audio' | 'videoAndAudio',
localeTag: string,
): string {
const ru = localeTag.trim().toLowerCase().startsWith('ru');
switch (kind) {
case 'imagesAndVideo':
return ru ? 'Изображения и видео' : 'Images and video';
case 'audio':
return ru ? 'Аудио' : 'Audio';
case 'videoAndAudio':
return ru ? 'Видео и аудио' : 'Video and audio';
default:
return ru ? 'Изображения' : 'Images';
}
}