Exemplo n.º 1
0
 public ModManifest GetManifest(Mod Mod)
 {
     if (ExistingMods.ContainsKey(Mod))
     {
         return(ExistingMods[Mod]);
     }
     else
     {
         return(default);
Exemplo n.º 2
0
        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;
            }
        }
Exemplo n.º 3
0
 public override void Clear()
 {
     ExistingMods.Clear();
     LoadOrder.Clear();
 }