import { allLevels, icons, upgrades } from "./loadGameData"; import { t } from "./i18n/i18n"; import { asyncAlert } from "./asyncAlert"; import { miniMarkDown } from "./pure_functions"; import { catchRateBest, catchRateGood, levelTimeBest, levelTimeGood, missesBest, missesGood, wallBouncedBest, wallBouncedGood, } from "./pure_functions"; export function helpMenuEntry() { return { icon: icons["icon:help"], text: t("main_menu.help_title"), help: t("main_menu.help_help"), async value() { await asyncAlert({ title: t("main_menu.help_title"), allowClose: true, content: [ miniMarkDown( t("main_menu.help_content", { catchRateBest, catchRateGood, levelTimeBest, levelTimeGood, missesBest, missesGood, wallBouncedBest, wallBouncedGood, }), ), miniMarkDown(t("main_menu.help_upgrades")), ...upgrades.map( (u) => `
${u.icon}

${u.name}
${u.help(1)}

${miniMarkDown(u.fullHelp)} `, ), "

" + t("main_menu.credit_levels") + "

", ...allLevels .filter((l) => l.credit?.trim()) .map( (l) => `
${icons[l.name]}

${l.name}

${miniMarkDown(l.credit || "")}
`, ), ], }); }, }; }