feat: extended description and required versions

This commit is contained in:
neoapps-dev 2026-07-07 17:09:52 +03:00
parent 7b4ecd9a56
commit caf36c60b5
2 changed files with 10 additions and 11 deletions

View file

@ -25,6 +25,7 @@ import {
type CustomEdition, type CustomEdition,
} from "../../services/TauriService"; } from "../../services/TauriService";
import { PluginManager } from "../../plugins/PluginManager"; import { PluginManager } from "../../plugins/PluginManager";
import { BASE_EDITIONS } from "../../hooks/useGameManager";
const REGISTRY_URL = const REGISTRY_URL =
"https://raw.githubusercontent.com/LCE-Hub/LCE-Workshop/refs/heads/main/registry.json"; "https://raw.githubusercontent.com/LCE-Hub/LCE-Workshop/refs/heads/main/registry.json";
const VERSIONS_URL = const VERSIONS_URL =
@ -123,13 +124,6 @@ interface PluginRegistryEntry {
} }
const COLS = 4; const COLS = 4;
const BUILTIN_EDITIONS: Record<string, string> = {
revelations: "Revelations",
legacy_evolved: "neoLegacy",
"360revived": "360Revived",
legacy_nether_fork: "Hellish Ends",
moon_edition: "Minecraft: Moon Edition",
};
interface WorkshopViewProps { interface WorkshopViewProps {
workshopTarget?: { id: string; type?: string } | null; workshopTarget?: { id: string; type?: string } | null;
onClearWorkshopTarget?: () => void; onClearWorkshopTarget?: () => void;
@ -1104,6 +1098,7 @@ const WorkshopView = memo(function WorkshopView({
pkg={selectedPkg} pkg={selectedPkg}
allPackages={allPackages} allPackages={allPackages}
versionPackages={versionPackages} versionPackages={versionPackages}
customEditions={config.customEditions || []}
installedPkgs={installedPkgs} installedPkgs={installedPkgs}
onClose={closeModal} onClose={closeModal}
playPressSound={playPressSound} playPressSound={playPressSound}
@ -1247,6 +1242,7 @@ function PackageModal({
pkg, pkg,
allPackages, allPackages,
versionPackages, versionPackages,
customEditions,
installedPkgs, installedPkgs,
onClose, onClose,
playPressSound, playPressSound,
@ -1263,6 +1259,7 @@ function PackageModal({
pkg: RegistryPackage; pkg: RegistryPackage;
allPackages: RegistryPackage[]; allPackages: RegistryPackage[];
versionPackages: RegistryPackage[]; versionPackages: RegistryPackage[];
customEditions: CustomEdition[];
installedPkgs: InstalledWorkshopPackage[]; installedPkgs: InstalledWorkshopPackage[];
onClose: () => void; onClose: () => void;
playPressSound: () => void; playPressSound: () => void;
@ -1713,15 +1710,17 @@ function PackageModal({
</span> </span>
<div className="flex flex-wrap gap-1.5 mt-1"> <div className="flex flex-wrap gap-1.5 mt-1">
{pkg.required_versions.map((verId) => { {pkg.required_versions.map((verId) => {
const builtin = BUILTIN_EDITIONS[verId]; const builtin = BASE_EDITIONS.find((e) => e.id === verId);
const versionPkg = versionPackages.find((v) => v.id === verId); const versionPkg = versionPackages.find((v) => v.id === verId);
if (!builtin && !versionPkg) return null; const customEd = customEditions.find((e) => e.id === verId);
const displayName = builtin?.name || customEd?.name || versionPkg?.name;
if (!displayName) return null;
return ( return (
<span <span
key={verId} key={verId}
className="text-[10px] bg-black/60 border border-[#55AAFF]/40 px-2 py-0.5 text-[#55AAFF] mc-text-shadow uppercase tracking-widest" className="text-[10px] bg-black/60 border border-[#55AAFF]/40 px-2 py-0.5 text-[#55AAFF] mc-text-shadow uppercase tracking-widest"
> >
{builtin || versionPkg!.name} {displayName}
</span> </span>
); );
})} })}

View file

@ -25,7 +25,7 @@ async function imageUrlToBase64(url: string): Promise<string> {
reader.readAsDataURL(blob); reader.readAsDataURL(blob);
}); });
} }
const BASE_EDITIONS = [ export const BASE_EDITIONS = [
{ {
id: "legacy_evolved", id: "legacy_evolved",
name: "neoLegacy", name: "neoLegacy",