{visibleEditions.map((edition: Edition, i: number) => {
if (i < visibleRange.start || i > visibleRange.end) {
return (
);
}
const isInstalled = installedVersions.includes(
edition.instanceId,
);
const isFocused = focusIndex === i;
const isCustom = edition.id.startsWith("custom_");
const isDownloading = downloadingIds.includes(edition.instanceId);
const isComingSoon = edition.comingSoon;
const isDownloadFocused =
!isInstalled && isFocused && focusBtn === 1;
const isGearFocused =
isFocused && focusBtn === (isInstalled ? 1 : 2);
return (
!isComingSoon && setFocusIndex(i)}
onMouseLeave={() => setFocusIndex(-1)} //neo: you see this, smartcmd?
onClick={() =>
!isComingSoon && handleEditionClick(edition, i)
}
>
{edition.logo ? (
edition.logo.startsWith("http") ||
edition.logo.startsWith("/images") ? (

) : (
)
) : (
)}
{edition.name}
{edition.category &&
edition.category.map((cat: string) => (
{cat}
))}
{isCustom && !edition.category && (
{t("versions.custom")}
)}
{!isInstalled && (
)}
{openMenuId === edition.id && (
{updatesAvailable?.[edition.instanceId] && (
)}
{!isAndroid && !isInstalled && (
)}
{edition.officialDLC && isInstalled ? (
{
e.stopPropagation();
playPressSound();
setDlcTargetEdition(edition);
setIsDlcModalOpen(true);
setOpenMenuId(null);
}}
className="w-full text-left px-3 py-2 text-[10px] text-[#dddddd] flex items-center gap-2 mc-text-shadow"
>
{t("versions.downloadDlc")}
) : null}{" "}
{argsSchemas[edition.instanceId] && (
{
e.stopPropagation();
playPressSound();
setOptionsTarget({
id: edition.instanceId,
name: edition.name,
});
setIsOptionsModalOpen(true);
setOpenMenuId(null);
}}
className="w-full text-left px-3 py-2 text-xs text-[#dddddd] flex items-center gap-2 mc-text-shadow"
>
{t("versions.options")}
)}
{Array.isArray(edition.branches) &&
edition.branches.length > 0 && (
{
e.stopPropagation();
playPressSound();
cycleBranch(edition.id);
}}
className="w-full text-left px-3 py-1.5 text-[10px] text-white mc-text-shadow flex items-center justify-between group"
>
{t("versions.channel")}
{edition.selectedBranch ?? t("versions.latest")}
)}
{
e.stopPropagation();
playPressSound();
toggleInstall(edition.instanceId);
setOpenMenuId(null);
}}
className="w-full text-left px-3 py-1.5 text-xs text-[#dddddd] hover:bg-[#ffff55]/20 flex items-center gap-2 group transition-colors mc-text-shadow font-bold border-b border-white/5 mb-1"
>
{t("versions.repair")}
{!isAndroid && (
{
e.stopPropagation();
playPressSound();
TauriService.openInstanceFolder(
edition.instanceId,
);
setOpenMenuId(null);
}}
className="w-full text-left px-3 py-2 text-xs text-[#dddddd] flex items-center gap-2 mc-text-shadow"
>
{t("versions.openFolder")}
)}{" "}
{!isAndroid && (
{
e.stopPropagation();
playPressSound();
const PANORAMA_PROFILES = [
"legacy_evolved",
"vanilla_tu19",
"360revived",
"vanilla_tu24",
];
const panoId = PANORAMA_PROFILES.includes(
edition.id,
)
? edition.id
: "vanilla_tu19";
const panoramaUrl = `/panorama/${panoId}_Panorama_Background_${isDayTime ? "Day" : "Night"}.png`;
addToSteam(
edition.instanceId,
edition.name,
edition.titleImage ?? "",
panoramaUrl,
);
setOpenMenuId(null);
}}
className="w-full text-left px-3 py-2 text-xs text-[#dddddd] flex items-center gap-2 mc-text-shadow"
>
{t("versions.addToSteam")}
)}{" "}
{!isAndroid && (
{
e.stopPropagation();
playPressSound();
handleImportWorld(edition.instanceId);
setOpenMenuId(null);
}}
className="w-full text-left px-3 py-2 text-xs text-[#dddddd] flex items-center gap-2 mc-text-shadow"
>
{t("versions.importWorld")}
)}{" "}
{!isAndroid && (
{
e.stopPropagation();
playPressSound();
TauriService.backupInstance(
edition.instanceId,
).catch((err) => {
if (err !== "CANCELED") console.error(err);
});
setOpenMenuId(null);
}}
className="w-full text-left px-3 py-2 text-xs text-[#dddddd] flex items-center gap-2 mc-text-shadow"
>
{t("versions.backup")}
)}{" "}
{!isAndroid && (
{
e.stopPropagation();
playPressSound();
setOpenMenuId(null);
try {
await TauriService.restoreInstance();
} catch (err) {
if (err !== "CANCELED") console.error(err);
}
}}
className="w-full text-left px-3 py-2 text-xs text-[#dddddd] flex items-center gap-2 mc-text-shadow"
>
{t("versions.restore")}
)}{" "}
{!isAndroid && (
{
e.stopPropagation();
playPressSound();
setCustomizeTarget(edition);
setIsCustomizeModalOpen(true);
setOpenMenuId(null);
}}
className="w-full text-left px-3 py-2 text-xs text-[#dddddd] flex items-center gap-2 mc-text-shadow"
>
{t("versions.customize")}
)}{" "}
{
e.stopPropagation();
playPressSound();
setSetUidTargetId(edition.instanceId);
setIsSetUidModalOpen(true);
setOpenMenuId(null);
}}
className="w-full text-left px-3 py-2 text-xs text-[#dddddd] flex items-center gap-2 mc-text-shadow"
>
{t("versions.setUid")}
{" "}
{isCustom ? (
{
e.stopPropagation();
playPressSound();
setEditingEdition(edition);
setIsImportModalOpen(true);
setOpenMenuId(null);
}}
className="w-full text-left px-3 py-2 text-xs text-[#aaaaaa] flex items-center gap-2 mc-text-shadow"
>
{t("versions.editCustom")}
) : null}{" "}
{
e.stopPropagation();
playBackSound();
if (isCustom) {
onDeleteEdition(edition.id);
} else {
setDeleteConfirmEdition(edition);
}
setOpenMenuId(null);
}}
className="w-full text-left px-3 py-2 text-xs text-red-500 hover:text-red-400 hover:bg-red-500/10 flex items-center gap-2 transition-colors mc-text-shadow font-bold"
>
{isCustom
? t("versions.removeCustom")
: t("versions.uninstall")}
)}
);
})}