示例#1
0
        public void PopulateModifiedBasegameFiles(Func <string, bool> restoreBasegamefileConfirmationCallback,
                                                  Func <string, bool> restoreSfarConfirmationCallback,
                                                  Action notifySFARRestoringCallback,
                                                  Action notifyFileRestoringCallback,
                                                  Action <object> notifyRestoredCallback)
        {
            ModifiedBasegameFiles.ClearEx();
            ModifiedSFARFiles.ClearEx();

            List <string> modifiedSfars = new List <string>();
            List <string> modifiedFiles = new List <string>();

            void failedCallback(string file)
            {
                if (file.EndsWith(@".sfar"))
                {
                    modifiedSfars.Add(file);
                    return;
                }

                if (file == getALOTMarkerFilePath())
                {
                    return; //Do not report this file as modified or user will desync game state with texture state
                }
                modifiedFiles.Add(file);
            }

            VanillaDatabaseService.ValidateTargetAgainstVanilla(this, failedCallback);

            ModifiedSFARFiles.AddRange(modifiedSfars.Select(file => new SFARObject(file, this, restoreSfarConfirmationCallback, notifySFARRestoringCallback, notifyRestoredCallback)));
            ModifiedBasegameFiles.AddRange(modifiedFiles.Select(file => new ModifiedFileObject(file.Substring(TargetPath.Length + 1), this,
                                                                                               restoreBasegamefileConfirmationCallback,
                                                                                               notifyFileRestoringCallback,
                                                                                               notifyRestoredCallback)));
        }
示例#2
0
        public void PopulateModifiedBasegameFiles(Func <string, bool> restoreBasegamefileConfirmationCallback,
                                                  Func <string, bool> restoreSfarConfirmationCallback,
                                                  Action notifySFARRestoringCallback,
                                                  Action notifyFileRestoringCallback,
                                                  Action <object> notifyRestoredCallback)
        {
            ModifiedBasegameFiles.ClearEx();
            ModifiedSFARFiles.ClearEx();

            List <string> modifiedSfars = new List <string>();
            List <string> modifiedFiles = new List <string>();

            void failedCallback(string file)
            {
                if (file.EndsWith(@".sfar"))
                {
                    modifiedSfars.Add(file);
                    return;
                }

                if (file == getALOTMarkerFilePath())
                {
                    return; //Do not report this file as modified or user will desync game state with texture state
                }
                modifiedFiles.Add(file);
            }

            VanillaDatabaseService.ValidateTargetAgainstVanilla(this, failedCallback);

            List <string> inconsistentDLC = new List <string>();

            VanillaDatabaseService.ValidateTargetDLCConsistency(this, x => inconsistentDLC.Add(x));

            modifiedSfars.AddRange(inconsistentDLC.Select(x => Path.Combine(x, "CookedPCConsole", "Default.sfar")));
            modifiedSfars = modifiedSfars.Distinct().ToList(); //filter out if modified + inconsistent

            ModifiedSFARFiles.AddRange(modifiedSfars.Select(file => new SFARObject(file, this, restoreSfarConfirmationCallback, notifySFARRestoringCallback, notifyRestoredCallback)));
            ModifiedBasegameFiles.AddRange(modifiedFiles.Select(file => new ModifiedFileObject(file.Substring(TargetPath.Length + 1), this,
                                                                                               restoreBasegamefileConfirmationCallback,
                                                                                               notifyFileRestoringCallback,
                                                                                               notifyRestoredCallback)));
        }