public ModManifest GetManifest(Mod Mod) { if (ExistingMods.ContainsKey(Mod)) { return(ExistingMods[Mod]); } else { return(default);
private void ParseMod(string Path) { ModManifest NewMod; try { string Manifest = FilesystemUtil.Sys.FileRead(Path + '/' + "Manifest.json"); NewMod = JsonConvert.DeserializeObject <ModManifest>(Manifest); NewMod.Mod.Path = Path; } catch (System.Exception Exception) { ConsoleSys.Error("Failed to parse " + Path + '/' + "Manifest.json"); ConsoleSys.Error(Exception.Message); return; } if (NewMod.Mod.ModID == null) { ConsoleSys.Error("Failed to parse " + Path + '/' + "Manifest.json"); return; } if (ExistingMods.ContainsKey(NewMod.Mod)) { ConsoleSys.Error("Duplicate mod " + NewMod.Name); return; } if (NewMod.Core) { if (Core.Mod.ModID == null) { Core = NewMod; } else { ConsoleSys.Error("Duplicated Core ModID of " + Core.Name + " and " + NewMod.Name); } } else { ExistingMods[NewMod.Mod] = NewMod; } }
public override void Clear() { ExistingMods.Clear(); LoadOrder.Clear(); }