コード例 #1
0
ファイル: MO2CompilerVM.cs プロジェクト: bahaynes/wabbajack
        public async Task <GetResponse <ModList> > Compile()
        {
            string outputFile;

            if (string.IsNullOrWhiteSpace(Parent.OutputLocation.TargetPath))
            {
                outputFile = MOProfile + Consts.ModListExtension;
            }
            else
            {
                outputFile = Path.Combine(Parent.OutputLocation.TargetPath, MOProfile + Consts.ModListExtension);
            }

            try
            {
                using (ActiveCompilation = new MO2Compiler(
                           mo2Folder: Mo2Folder,
                           mo2Profile: MOProfile,
                           outputFile: outputFile)
                {
                    ModListName = ModlistSettings.ModListName,
                    ModListAuthor = ModlistSettings.AuthorText,
                    ModListDescription = ModlistSettings.Description,
                    ModListImage = ModlistSettings.ImagePath.TargetPath,
                    ModListWebsite = ModlistSettings.Website,
                    ModListReadme = ModlistSettings.ReadmeIsWebsite ? ModlistSettings.ReadmeWebsite : ModlistSettings.ReadmeFilePath.TargetPath,
                    ReadmeIsWebsite = ModlistSettings.ReadmeIsWebsite,
                    MO2DownloadsFolder = DownloadLocation.TargetPath,
                })
                {
                    Parent.MWVM.Settings.Performance.AttachToBatchProcessor(ActiveCompilation);

                    var success = await ActiveCompilation.Begin();

                    return(GetResponse <ModList> .Create(success, ActiveCompilation.ModList));
                }
            }
            finally
            {
                StatusTracker     = null;
                ActiveCompilation = null;
            }
        }
コード例 #2
0
        public async Task <GetResponse <ModList> > Compile()
        {
            string outputFile = $"{ModlistSettings.ModListName}{Consts.ModListExtension}";

            if (!string.IsNullOrWhiteSpace(Parent.OutputLocation.TargetPath))
            {
                outputFile = Path.Combine(Parent.OutputLocation.TargetPath, outputFile);
            }
            try
            {
                using (ActiveCompilation = new VortexCompiler(
                           game: SelectedGame.Game,
                           gamePath: GameLocation.TargetPath,
                           vortexFolder: VortexCompiler.TypicalVortexFolder(),
                           downloadsFolder: DownloadsLocation.TargetPath,
                           stagingFolder: StagingLocation.TargetPath,
                           outputFile: outputFile)
                {
                    ModListName = ModlistSettings.ModListName,
                    ModListAuthor = ModlistSettings.AuthorText,
                    ModListDescription = ModlistSettings.Description,
                    ModListImage = ModlistSettings.ImagePath.TargetPath,
                    ModListWebsite = ModlistSettings.Website,
                    ModListReadme = ModlistSettings.ReadmeIsWebsite ? ModlistSettings.ReadmeWebsite : ModlistSettings.ReadmeFilePath.TargetPath,
                    ReadmeIsWebsite = ModlistSettings.ReadmeIsWebsite,
                })
                {
                    Parent.MWVM.Settings.Performance.AttachToBatchProcessor(ActiveCompilation);
                    var success = await ActiveCompilation.Begin();

                    return(GetResponse <ModList> .Create(success, ActiveCompilation.ModList));
                }
            }
            finally
            {
                StatusTracker = null;
                ActiveCompilation.Dispose();
                ActiveCompilation = null;
            }
        }