Пример #1
0
        // Discover new mods.
        public void DiscoverMods()
        {
            NewMods.Clear();
            ModDiscoveryStarted?.Invoke();
            _mods.Clear();
            BasePath.Refresh();

            if (Valid && BasePath.Exists)
            {
                foreach (var modFolder in BasePath.EnumerateDirectories())
                {
                    var mod = LoadMod(modFolder);
                    if (mod == null)
                    {
                        continue;
                    }

                    mod.Index = _mods.Count;
                    _mods.Add(mod);
                }
            }

            ModDiscoveryFinished?.Invoke();
            PluginLog.Information("Rediscovered mods.");
        }