private void LoadME3FilesList() { var me3files = new List <BackupFile>(); var bup = BackupService.GetGameBackupPath(Mod.MEGame.ME3); if (bup != null) { var target = new GameTarget(Mod.MEGame.ME3, bup, false); var cookedPath = MEDirectories.CookedPath(target); foreach (var f in Extensions.GetFiles(cookedPath, @"\.pcc|\.tfc|\.afc|\.bin|\.tlk", SearchOption.AllDirectories)) { me3files.Add(new BackupFile(@"BASEGAME", Path.GetFileName(f))); } me3files.Sort(); //sort basegame var dlcDir = MEDirectories.DLCPath(target); var officialDLC = VanillaDatabaseService.GetInstalledOfficialDLC(target); foreach (var v in officialDLC) { var sfarPath = Path.Combine(dlcDir, v, @"CookedPCConsole", @"Default.sfar"); if (File.Exists(sfarPath)) { var filesToAdd = new List <BackupFile>(); DLCPackage dlc = new DLCPackage(sfarPath); foreach (var f in dlc.Files) { filesToAdd.Add(new BackupFile(v, Path.GetFileName(f.FileName))); } filesToAdd.Sort(); me3files.AddRange(filesToAdd); } } //TESTPATCH var tpPath = ME3Directory.GetTestPatchPath(target); if (File.Exists(tpPath)) { var filesToAdd = new List <BackupFile>(); DLCPackage dlc = new DLCPackage(tpPath); foreach (var f in dlc.Files) { filesToAdd.Add(new BackupFile(@"TESTPATCH", Path.GetFileName(f.FileName))); } filesToAdd.Sort(); me3files.AddRange(filesToAdd); } } Application.Current.Dispatcher.Invoke(delegate { ME3Files.ReplaceAll(me3files); }); Debug.WriteLine(@"Num ME3 files: " + ME3Files.Count); }
public override void OnPanelVisible() { var db = VanillaDatabaseService.LoadDatabaseFor(Mod.MEGame.ME1, false); ME1Files.ReplaceAll(getDBItems(db)); db = VanillaDatabaseService.LoadDatabaseFor(Mod.MEGame.ME2, false); ME2Files.ReplaceAll(getDBItems(db)); db = VanillaDatabaseService.LoadDatabaseFor(Mod.MEGame.ME3, false); ME3Files.ReplaceAll(getDBItems(db)); LoadingInProgress = false; ME1FilesView.Filter = FilterBackupFilesME1; ME2FilesView.Filter = FilterBackupFilesME2; ME3FilesView.Filter = FilterBackupFilesME3; }