Example #1
0
        private void RemoveModPath(string path)
        {
            if (!_modPaths.ContainsKey(path))
            {
                return;
            }

            _modPaths.Remove(path);
            ModRemoved?.Invoke(path);
        }
Example #2
0
        private void RemoveMod(Mod mod)
        {
            mod.Loaded             -= OnModLoaded;
            mod.Unloaded           -= OnModUnloaded;
            mod.LoadCancelled      -= OnModLoadCancelled;
            mod.SceneLoaded        -= OnSceneLoaded;
            mod.SceneUnloaded      -= OnSceneUnloaded;
            mod.SceneLoadCancelled -= OnSceneLoadCancelled;
            mod.SetInvalid();

            foreach (Mod other in _mods)
            {
                other.UpdateConflicts(mod);
            }

            LogUtility.LogInfo("Mod removed: " + mod.name);
            _mods.Remove(mod);

            ModRemoved?.Invoke(mod);
            ModsChanged?.Invoke();
        }