/// <summary> /// Gets a list of all files that *may* be installed by a mod. /// </summary> /// <returns></returns> public List <string> GetAllInstallableFiles() { var list = new List <string>(); foreach (var job in InstallationJobs) { if (ModJob.IsVanillaJob(job, Game)) { // Basegame, Official DLC list.AddRange(job.FilesToInstall.Keys); } else if (job.Header == ModJob.JobHeader.CUSTOMDLC) { foreach (var cdlcDir in job.CustomDLCFolderMapping) { var dlcSourceDir = Path.Combine(ModPath, cdlcDir.Key); var files = Directory.GetFiles(dlcSourceDir, @"*", SearchOption.AllDirectories).Select(x => x.Substring(dlcSourceDir.Length + 1)); list.AddRange(files.Select(x => $@"{MEDirectories.GetDLCPath(Game, @"")}\{cdlcDir.Value}\{x}")); // do not localize } } foreach (var v in job.AlternateFiles) { if (v.Operation == AlternateFile.AltFileOperation.OP_INSTALL) { list.Add(v.ModFile); } if (v.Operation == AlternateFile.AltFileOperation.OP_APPLY_MULTILISTFILES) { foreach (var mlFile in v.MultiListSourceFiles) { list.Add(v.MultiListTargetPath + @"\" + mlFile); } } } foreach (var v in job.AlternateDLCs) { if (v.Operation == AlternateDLC.AltDLCOperation.OP_ADD_CUSTOMDLC || v.Operation == AlternateDLC.AltDLCOperation.OP_ADD_FOLDERFILES_TO_CUSTOMDLC) { var dlcSourceDir = Path.Combine(ModPath, v.AlternateDLCFolder); var files = Directory.GetFiles(dlcSourceDir, @"*", SearchOption.AllDirectories).Select(x => x.Substring(dlcSourceDir.Length + 1)); list.AddRange(files.Select(x => $@"{MEDirectories.GetDLCPath(Game, @"")}\{v.DestinationDLCFolder}\{x}")); //do not localize } if (v.Operation == AlternateDLC.AltDLCOperation.OP_ADD_MULTILISTFILES_TO_CUSTOMDLC) { foreach (var mlFile in v.MultiListSourceFiles) { list.Add(v.DestinationDLCFolder + @"\" + mlFile); } } } } return(list.Distinct().OrderBy(x => x).ToList()); }