public void FileCompile() { _document.SaveFile(); if (_document.MapFile == null) { return; } var build = SettingsManager.Builds.FirstOrDefault(x => x.ID == _document.Game.BuildID); if (build == null) { if (MessageBox.Show("Please set up the build tools for this game profile.\n\nWould you like to open the settings page now?", "No build configuration", MessageBoxButtons.YesNo) == DialogResult.Yes) { Mediator.Publish(EditorMediator.OpenSettings); } return; } using (var cd = new CompileDialog(build)) { if (cd.ShowDialog() == DialogResult.OK) { var batch = new Batch(_document, build, cd.GetProfile()); batch.Compile(); } } }
protected override async Task Invoke(MapDocument document, CommandParameters parameters) { var spec = _compileSpecificationRegister.Value.GetCompileSpecificationsForEngine(document.Environment.Engine).FirstOrDefault(); if (spec == null) { return; } using (var cd = new CompileDialog(spec, _buildProfileRegister.Value)) { if (await cd.ShowDialogAsync() == DialogResult.OK) { var arguments = cd.SelectedBatchArguments; var batch = await document.Environment.CreateBatch(arguments, new BatchOptions()); if (batch == null) { return; } await batch.Run(document); } } }
private void Compile() { //Create MapCompilerModel compilerModel = new MapCompilerModel(); //Check if (Files.Any(f => (f is TagFileModel model) && model.GroupTag == HaloTags.scnr)) { compilerModel.ScenarioFileName = (Files.First(f => (f is TagFileModel model) && model.GroupTag == HaloTags.scnr)).FileName; } //Create and show CompileDialog compileDialog = new CompileDialog() { Owner = Owner, DataContext = compilerModel }; compileDialog.ShowDialog(); }