Skip to content
5 changes: 0 additions & 5 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import BindLoaderImpl from './providers/components/loaders/bind_impls/BindLoader
import PlatformInterceptorProvider from './providers/generic/game/platform_interceptor/PlatformInterceptorProvider';
import PlatformInterceptorImpl from './providers/generic/game/platform_interceptor/PlatformInterceptorImpl';
import ProfileInstallerProvider from './providers/ror2/installing/ProfileInstallerProvider';
import InstallationRules from './r2mm/installing/InstallationRules';
import GenericProfileInstaller from './r2mm/installing/profile_installers/GenericProfileInstaller';
import ErrorModal from './components/modals/ErrorModal.vue';
import { provideStoreImplementation } from './providers/generic/store/StoreProvider';
Expand Down Expand Up @@ -111,9 +110,6 @@ onMounted(async () => {
hookModInstallingViaProtocol(router);
await checkCdnConnection();

InstallationRules.apply();
InstallationRules.validate();

window.app.getAppDataDirectory().then(async (appData: string) => {
PathResolver.APPDATA_DIR = path.join(appData, 'r2modmanPlus-local');
// Legacy path. Needed for migration.
Expand Down Expand Up @@ -143,7 +139,6 @@ onMounted(async () => {
});
});

store.commit('updateModLoaderPackageNames');
store.dispatch('tsMods/updateExclusions');
});

Expand Down
14 changes: 8 additions & 6 deletions src/components/views/DownloadModVersionSelectModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
import ModalCard from "../ModalCard.vue";
import R2Error from "../../model/errors/R2Error";
import ManifestV2 from "../../model/ManifestV2";
import { EcosystemSchema } from "../../model/schema/ThunderstoreSchema";
import ThunderstoreVersion from "../../model/ThunderstoreVersion";
import { MOD_LOADER_VARIANTS } from "../../r2mm/installing/profile_installers/ModLoaderVariantRecord";
import * as PackageDb from "../../r2mm/manager/PackageDexieStore";
import ProfileModList from "../../r2mm/mods/ProfileModList";
import Game from '../../model/game/Game';
Expand Down Expand Up @@ -94,15 +94,17 @@ watch(() => store.state.modals.downloadModalMod, async () => {
mod.getFullName()
);

const foundRecommendedVersion = MOD_LOADER_VARIANTS[activeGame.internalFolderName]
.find(value => value.packageName === mod.getFullName());
const foundRecommendedVersion = EcosystemSchema.getRecommendedVersion(
thunderstoreMod.value.getFullName(),
activeGame.settingsIdentifier
);

if (foundRecommendedVersion && foundRecommendedVersion.recommendedVersion) {
recommendedVersion.value = foundRecommendedVersion.recommendedVersion.toString();
if (foundRecommendedVersion) {
recommendedVersion.value = foundRecommendedVersion;

// Auto-select recommended version if it's found.
const recommendedVersionToSelect = versionNumbers.value.find(
(ver) => ver === foundRecommendedVersion.recommendedVersion!.toString()
(ver) => ver === foundRecommendedVersion
);
if (recommendedVersionToSelect) {
selectedVersion.value = recommendedVersionToSelect;
Expand Down
3 changes: 2 additions & 1 deletion src/components/views/LocalModList/LocalModCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import DonateButton from '../../buttons/DonateButton.vue';
import DonateIconButton from '../../buttons/DonateIconButton.vue';
import R2Error from '../../../model/errors/R2Error';
import ManifestV2 from '../../../model/ManifestV2';
import { EcosystemSchema } from '../../../model/schema/ThunderstoreSchema';
import VersionNumber from '../../../model/VersionNumber';
import { LogSeverity } from '../../../providers/ror2/logging/LoggerProvider';
import Dependants from '../../../r2mm/mods/Dependants';
Expand All @@ -27,7 +28,7 @@ const disableChangePending = ref<boolean>(false);

// Mod loader packages can't be disabled as it's hard to define
// what that should even do in all cases.
const canBeDisabled = computed(() => !store.getters['isModLoader'](props.mod.getName()));
const canBeDisabled = computed(() => !EcosystemSchema.isModLoaderPackage(props.mod.getName()));

const isDeprecated = computed(() => store.state.tsMods.deprecated.get(props.mod.getName()) || false);
const isLatestVersion = computed(() => store.getters['tsMods/isLatestVersion'](props.mod));
Expand Down
5 changes: 2 additions & 3 deletions src/installers/BepInExInstaller.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { InstallArgs, PackageInstaller, uninstallModLoader } from "./PackageInstaller";
import path from "../providers/node/path/path";
import FsProvider from "../providers/generic/file/FsProvider";
import { MODLOADER_PACKAGES } from "../r2mm/installing/profile_installers/ModLoaderVariantRecord";
import { PackageLoader } from "../model/schema/ThunderstoreSchema";
import { EcosystemSchema } from "../model/schema/ThunderstoreSchema";

const basePackageFiles = ["manifest.json", "readme.md", "icon.png"];

Expand All @@ -17,7 +16,7 @@ export class BepInExInstaller implements PackageInstaller {
profile,
} = args;

const mapping = MODLOADER_PACKAGES.find((entry) => entry.packageName.toLowerCase() == mod.getName().toLowerCase());
const mapping = EcosystemSchema.getModLoaderMapping(mod.getName());
const mappingRoot = mapping ? mapping.rootFolder : "";

let bepInExRoot: string;
Expand Down
10 changes: 2 additions & 8 deletions src/installers/GDWeaveInstaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,15 @@ import {
import path from "../providers/node/path/path";
import FsProvider from '../providers/generic/file/FsProvider';
import FileUtils from '../utils/FileUtils';
import { MODLOADER_PACKAGES } from '../r2mm/installing/profile_installers/ModLoaderVariantRecord';
import { PackageLoader } from '../model/schema/ThunderstoreSchema';
import { EcosystemSchema } from '../model/schema/ThunderstoreSchema';
import FileWriteError from '../model/errors/FileWriteError';
import R2Error from '../model/errors/R2Error';

export class GDWeaveInstaller implements PackageInstaller {
async install(args: InstallArgs) {
const { mod, packagePath, profile } = args;

const mapping = MODLOADER_PACKAGES.find(
(entry) =>
entry.packageName.toLowerCase() ==
mod.getName().toLowerCase() &&
entry.loaderType == PackageLoader.GDWEAVE
);
const mapping = EcosystemSchema.getModLoaderMapping(mod.getName());

if (!mapping) {
throw new Error(`Missing modloader for ${mod.getName()}`);
Expand Down
Loading
Loading