From 2d0a7b3fe0cecfe9da27467038f1f5aae6e9ce35 Mon Sep 17 00:00:00 2001 From: "SND\\eagleeyestudios_cp" Date: Sat, 9 Feb 2013 12:01:51 +0000 Subject: [PATCH] Content Pipeline: - Added default value for target platform when reading cproj files Compiler GUI: - fixed issue #1143, a message box should now be displayed if project path is wrong - added default case for empty configuration when loading projects --- .../Tasks/ContentProject.cs | 4 +++ .../MainWindow.Designer.cs | 34 ++++++++----------- Tools/ANXContentCompilerGUI/MainWindow.cs | 11 +++++- 3 files changed, 29 insertions(+), 20 deletions(-) diff --git a/ANX.Framework.Content.Pipeline/Tasks/ContentProject.cs b/ANX.Framework.Content.Pipeline/Tasks/ContentProject.cs index 696ed84f..8ba07a5e 100644 --- a/ANX.Framework.Content.Pipeline/Tasks/ContentProject.cs +++ b/ANX.Framework.Content.Pipeline/Tasks/ContentProject.cs @@ -289,6 +289,10 @@ namespace ANX.Framework.Content.Pipeline.Tasks { project.Platform = targetPlatform; } + else + { + project.Platform = TargetPlatform.Windows; + } } } break; diff --git a/Tools/ANXContentCompilerGUI/MainWindow.Designer.cs b/Tools/ANXContentCompilerGUI/MainWindow.Designer.cs index 012ce004..8ea2ea01 100644 --- a/Tools/ANXContentCompilerGUI/MainWindow.Designer.cs +++ b/Tools/ANXContentCompilerGUI/MainWindow.Designer.cs @@ -67,28 +67,26 @@ namespace ANX.ContentCompiler.GUI this.propertyGrid = new System.Windows.Forms.PropertyGrid(); this.show_timer = new System.Windows.Forms.Timer(this.components); this.menuState = new ANX.ContentCompiler.GUI.States.MenuState(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainerMenuLayout)).BeginInit(); this.splitContainerMenuLayout.Panel1.SuspendLayout(); this.splitContainerMenuLayout.Panel2.SuspendLayout(); this.splitContainerMenuLayout.SuspendLayout(); -#if !MONO - ((System.ComponentModel.ISupportInitialize)(this.splitContainerMenuLayout)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.show_pictureBoxRibbon)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.show_pictureBoxMenu)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.show_pictureBoxErrorLog)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainerFileTree)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.splitContainerProperties)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.show_pictureBoxProperties)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.show_pictureBoxProjectExplorer)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.show_pictureBoxMainPanel)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.show_pictureBoxSmiley)).BeginInit(); -#endif this.splitContainerFileTree.Panel1.SuspendLayout(); this.splitContainerFileTree.Panel2.SuspendLayout(); this.splitContainerFileTree.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.show_pictureBoxSmiley)).BeginInit(); this.treeViewContextMenu.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainerProperties)).BeginInit(); this.splitContainerProperties.Panel1.SuspendLayout(); this.splitContainerProperties.Panel2.SuspendLayout(); this.splitContainerProperties.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.show_pictureBoxProperties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.show_pictureBoxProjectExplorer)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.show_pictureBoxMainPanel)).BeginInit(); this.SuspendLayout(); // // splitContainerMenuLayout @@ -569,26 +567,24 @@ namespace ANX.ContentCompiler.GUI this.Shown += new System.EventHandler(this.MainWindowShown); this.splitContainerMenuLayout.Panel1.ResumeLayout(false); this.splitContainerMenuLayout.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainerMenuLayout)).EndInit(); this.splitContainerMenuLayout.ResumeLayout(false); - this.splitContainerFileTree.Panel1.ResumeLayout(false); - this.splitContainerFileTree.Panel2.ResumeLayout(false); - this.splitContainerFileTree.ResumeLayout(false); -#if !MONO ((System.ComponentModel.ISupportInitialize)(this.show_pictureBoxRibbon)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.show_pictureBoxMenu)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.show_pictureBoxErrorLog)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.show_pictureBoxSmiley)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.splitContainerProperties)).EndInit(); + this.splitContainerFileTree.Panel1.ResumeLayout(false); + this.splitContainerFileTree.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainerFileTree)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.splitContainerMenuLayout)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.show_pictureBoxProperties)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.show_pictureBoxProjectExplorer)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.show_pictureBoxMainPanel)).EndInit(); -#endif + this.splitContainerFileTree.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.show_pictureBoxSmiley)).EndInit(); this.treeViewContextMenu.ResumeLayout(false); this.splitContainerProperties.Panel1.ResumeLayout(false); this.splitContainerProperties.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainerProperties)).EndInit(); this.splitContainerProperties.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.show_pictureBoxProperties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.show_pictureBoxProjectExplorer)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.show_pictureBoxMainPanel)).EndInit(); this.ResumeLayout(false); } diff --git a/Tools/ANXContentCompilerGUI/MainWindow.cs b/Tools/ANXContentCompilerGUI/MainWindow.cs index 98d3bfff..4b3387a5 100644 --- a/Tools/ANXContentCompilerGUI/MainWindow.cs +++ b/Tools/ANXContentCompilerGUI/MainWindow.cs @@ -199,6 +199,9 @@ namespace ANX.ContentCompiler.GUI _contentProject.InputDirectory = ProjectFolder; ProjectImportersDir = _contentProject.ReferenceIncludeDirectory; ProjectPath = path; + if (String.IsNullOrEmpty(_contentProject.Configuration)) + _contentProject.Configuration = "Debug"; + if (string.IsNullOrEmpty(_contentProject.Creator)) _contentProject.Creator = "ANX Content Compiler (4.0)"; ChangeEnvironmentOpenProject(); @@ -228,8 +231,14 @@ namespace ANX.ContentCompiler.GUI SaveProjectAs(sender, e); foreach (var buildItem in _contentProject.BuildItems) { + var dir = Path.GetDirectoryName(ProjectPath); + if (String.IsNullOrEmpty(dir)) + { + MessageBox.Show("Error saving project: ProjectPath not set!", "Error"); + return; + } if (File.Exists(buildItem.SourceFilename)) - buildItem.SourceFilename = buildItem.SourceFilename.Remove(0, Path.GetDirectoryName(ProjectPath).Count() + 1); + buildItem.SourceFilename = buildItem.SourceFilename.Remove(0, dir.Count() + 1); } _contentProject.InputDirectory = ""; //Clear input dir, because we do not need it anymore _contentProject.Save(ProjectPath);