Example #1
0
        public void LoadBepinexMods(string path)
        {
            Logger.LogInfo("Discovering mods...");
            var mods = DiscoverMods(path);

            Logger.LogInfo($"{mods.Count} mods discovered!");

            Logger.LogInfo("Verifying dependencies...");
            VerifyDependencies(mods, mods);

            Logger.LogInfo("Loading BepInEx mods...");
            var bepinexLoader = new BepinexLoader(Logger, mods);

            bepinexLoader.LoadMods();
            Logger.LogInfo($"Loaded {bepinexLoader.LoadedMods.Count} BepInEx mods!");
        }
Example #2
0
        public void LoadBepinexMods()
        {
            var mods = ModDiscovery.GetModsForLoader(LoaderReference);

            var bepinexMods = new List <ModInfo>();

            foreach (var mod in mods)
            {
                var args = mod.GetLoaderArgs(LoaderReference, true, false);
                if (args != null && args.ContainsKey("UseBepinex") && (bool)args["UseBepinex"])
                {
                    bepinexMods.Add(mod);
                }
            }

            Logger.LogInfo("Loading BepInEx mods...");
            var bepinexLoader = new BepinexLoader(Logger, bepinexMods);

            bepinexLoader.LoadMods();
            Logger.LogInfo($"Loaded {bepinexLoader.LoadedMods.Count} BepInEx mods!");
        }