Files
Ivan Fontosh a29c72b307 feat: окно инструкций, свёрнутая история и обновление спонсоров
Инструкции вынесены в отдельное окно Electron; токены игроков не пропадают при смене сцены; предпросмотр и плейлисты адаптированы; история свёрнута по умолчанию.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 06:21:42 +08:00

49 lines
1.2 KiB
TypeScript

/** Порядок разделов в окне «Инструкция». */
import { USERS_BRANCH_FEATURES_ENABLED } from '../../../shared/features/usersBranchFeatures';
const HELP_SECTION_IDS_ALL = [
'overview',
'license',
'projects',
'scenes',
'graph',
'sideStorylines',
'sceneProps',
'sceneEditor',
'grid',
'traps',
'tokens',
'campaignAudio',
'materials',
'players',
'npcs',
'session',
'controlPanel',
'transitions',
'music',
'effects',
'presentation',
'importExport',
'settings',
] as const;
export type HelpSectionId = (typeof HELP_SECTION_IDS_ALL)[number];
export const HELP_SECTION_IDS: readonly HelpSectionId[] = USERS_BRANCH_FEATURES_ENABLED
? HELP_SECTION_IDS_ALL
: HELP_SECTION_IDS_ALL.filter((id) => id !== 'players');
export function helpSectionTitleKey(id: HelpSectionId): string {
return `help.section.${id}.title`;
}
export function helpSectionBodyKey(id: HelpSectionId): string {
return `help.section.${id}.body`;
}
export function parseHelpSectionId(raw: unknown): HelpSectionId {
const s = String(raw ?? '').trim();
if ((HELP_SECTION_IDS as readonly string[]).includes(s)) return s as HelpSectionId;
return 'overview';
}