Esempio n. 1
0
        public async Task Compile()
        {
            string outputFile = $"{ModlistSettings.ModListName}{ExtensionManager.Extension}";

            if (!string.IsNullOrWhiteSpace(Parent.OutputLocation.TargetPath))
            {
                outputFile = Path.Combine(Parent.OutputLocation.TargetPath, outputFile);
            }
            try
            {
                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,
                };
                await ActiveCompilation.Begin();
            }
            finally
            {
                StatusTracker = null;
                ActiveCompilation.Dispose();
                ActiveCompilation = null;
            }
        }
Esempio n. 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;
            }
        }