Beispiel #1
0
 public static void SetActiveToList(List <string> mods)
 {
     data.activeMods = mods.Where((string mod) => ModLister.GetModWithIdentifier(mod) != null).ToList();
     RecacheActiveMods();
 }
Beispiel #2
0
 static ModLister()
 {
     ModLister.mods = new List <ModMetaData>();
     ModLister.RebuildModList();
 }
Beispiel #3
0
 internal void DeleteContent()
 {
     rootDirInt.Delete(recursive: true);
     ModLister.RebuildModList();
 }
Beispiel #4
0
 static ModLister()
 {
     ModLister.RebuildModList();
 }
Beispiel #5
0
        private void InitLoadFolders()
        {
            foldersToLoadDescendingOrder = new List <string>();
            ModMetaData modWithIdentifier = ModLister.GetModWithIdentifier(PackageId);

            if (modWithIdentifier?.loadFolders != null && modWithIdentifier.loadFolders.DefinedVersions().Count > 0)
            {
                List <LoadFolder> list = modWithIdentifier.LoadFoldersForVersion(VersionControl.CurrentVersionStringWithoutBuild);
                if (list != null && list.Count > 0)
                {
                    AddFolders(list);
                    return;
                }
                int num  = VersionControl.CurrentVersion.Major;
                int num2 = VersionControl.CurrentVersion.Minor;
                while (true)
                {
                    if (num2 == 0)
                    {
                        num--;
                        num2 = 9;
                    }
                    else
                    {
                        num2--;
                    }
                    if (num < 1)
                    {
                        break;
                    }
                    List <LoadFolder> list2 = modWithIdentifier.LoadFoldersForVersion(num + "." + num2);
                    if (list2 != null)
                    {
                        AddFolders(list2);
                        return;
                    }
                }
                List <LoadFolder> list3 = modWithIdentifier.LoadFoldersForVersion("default");
                if (list3 != null)
                {
                    AddFolders(list3);
                    return;
                }
            }
            if (foldersToLoadDescendingOrder.Count != 0)
            {
                return;
            }
            string text = Path.Combine(RootDir, VersionControl.CurrentVersionStringWithoutBuild);

            if (Directory.Exists(text))
            {
                foldersToLoadDescendingOrder.Add(text);
            }
            else
            {
                Version         version     = new Version(0, 0);
                DirectoryInfo[] directories = rootDirInt.GetDirectories();
                for (int i = 0; i < directories.Length; i++)
                {
                    if (VersionControl.TryParseVersionString(directories[i].Name, out var version2) && version2 > version)
                    {
                        version = version2;
                    }
                }
                if (version.Major > 0)
                {
                    foldersToLoadDescendingOrder.Add(Path.Combine(RootDir, version.ToString()));
                }
            }
            string text2 = Path.Combine(RootDir, CommonFolderName);

            if (Directory.Exists(text2))
            {
                foldersToLoadDescendingOrder.Add(text2);
            }
            foldersToLoadDescendingOrder.Add(RootDir);
            void AddFolders(List <LoadFolder> folders)
            {
                for (int num3 = folders.Count - 1; num3 >= 0; num3--)
                {
                    if (folders[num3].ShouldLoad)
                    {
                        foldersToLoadDescendingOrder.Add(Path.Combine(RootDir, folders[num3].folderName));
                    }
                }
            }
        }
Beispiel #6
0
 public static void SetActiveToList(List <string> mods)
 {
     data.activeMods = (from mod in mods
                        where ModLister.GetModWithIdentifier(mod) != null
                        select mod).ToList();
 }
 private static bool <SetActiveToList> m__0(string mod)
 {
     return(ModLister.GetModWithIdentifier(mod) != null);
 }
 internal void DeleteContent()
 {
     this.rootDirInt.Delete(true);
     ModLister.RebuildModList();
 }