diff --git a/ANX.Framework.Content.Pipeline/ANX.Framework.Content.Pipeline.csproj b/ANX.Framework.Content.Pipeline/ANX.Framework.Content.Pipeline.csproj index b473867d..f49c3271 100644 --- a/ANX.Framework.Content.Pipeline/ANX.Framework.Content.Pipeline.csproj +++ b/ANX.Framework.Content.Pipeline/ANX.Framework.Content.Pipeline.csproj @@ -10,27 +10,26 @@ Properties ANX.Framework.Content.Pipeline ANX.Framework.Content.Pipeline - v4.0 512 - true + True full - false + False bin\Debug\ DEBUG;TRACE prompt 4 - true + True pdbonly - true + True bin\Release\ TRACE prompt 4 - true + True @@ -186,7 +185,9 @@ + + diff --git a/ANX.Framework.Content.Pipeline/Tasks/BuildItem.cs b/ANX.Framework.Content.Pipeline/Tasks/BuildItem.cs index a3f945de..e2f7e5fb 100644 --- a/ANX.Framework.Content.Pipeline/Tasks/BuildItem.cs +++ b/ANX.Framework.Content.Pipeline/Tasks/BuildItem.cs @@ -1,6 +1,7 @@ #region Using Statements using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; @@ -28,12 +29,14 @@ namespace ANX.Framework.Content.Pipeline.Tasks set; } + [TypeConverter(typeof(ImporterConverter))] public string ImporterName { get; set; } + [TypeConverter(typeof(ProcessorConverter))] public string ProcessorName { get; diff --git a/ANX.Framework.Content.Pipeline/Tasks/ImporterConverter.cs b/ANX.Framework.Content.Pipeline/Tasks/ImporterConverter.cs new file mode 100644 index 00000000..06b00059 --- /dev/null +++ b/ANX.Framework.Content.Pipeline/Tasks/ImporterConverter.cs @@ -0,0 +1,28 @@ +using System.Collections.Specialized; +using System.ComponentModel; + +namespace ANX.Framework.Content.Pipeline.Tasks +{ + /// + /// Class for enabling a dropdown list containing all available Importers for the PropertyGrid. + /// + public class ImporterConverter : StringConverter + { + public override bool GetStandardValuesSupported(ITypeDescriptorContext context) + { + //Show comboBox + return true; + } + + public override bool GetStandardValuesExclusive(ITypeDescriptorContext context) + { + //Non editable list + return true; + } + + public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) + { + return new StandardValuesCollection(new StringCollection()); //TODO: Implement correct call to get available Importers + } + } +} diff --git a/ANX.Framework.Content.Pipeline/Tasks/ProcessorConverter.cs b/ANX.Framework.Content.Pipeline/Tasks/ProcessorConverter.cs new file mode 100644 index 00000000..7779f9d9 --- /dev/null +++ b/ANX.Framework.Content.Pipeline/Tasks/ProcessorConverter.cs @@ -0,0 +1,29 @@ +using System.ComponentModel; +using System.Linq; + +namespace ANX.Framework.Content.Pipeline.Tasks +{ + /// + /// Class for enabling a dropdown list containing all available Processors for the PropertyGrid. + /// + public class ProcessorConverter : StringConverter + { + public override bool GetStandardValuesSupported(ITypeDescriptorContext context) + { + //Show comboBox + return true; + } + + public override bool GetStandardValuesExclusive(ITypeDescriptorContext context) + { + //Non editable list + return true; + } + + public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) + { + var pManager = new ProcessorManager(); + return new StandardValuesCollection(pManager.AvailableProcessors.Select(availableProcessor => availableProcessor.Key).ToArray()); + } + } +} diff --git a/Tools/ANXContentCompilerGUI/ANX.ContentCompiler.GUI.csproj b/Tools/ANXContentCompilerGUI/ANX.ContentCompiler.GUI.csproj index ce2020c3..5c4ff44e 100644 --- a/Tools/ANXContentCompilerGUI/ANX.ContentCompiler.GUI.csproj +++ b/Tools/ANXContentCompilerGUI/ANX.ContentCompiler.GUI.csproj @@ -25,11 +25,11 @@ x86 - true + True full - false + False ..\..\bin\ - DEBUG;TRACE + DEBUG;TRACE;MONO prompt 4 true @@ -37,7 +37,7 @@ AnyCPU pdbonly - true + True bin\Release\ TRACE prompt @@ -47,7 +47,7 @@ ANX.ContentCompiler.GUI.Program - true + True bin\x86\Debug\ DEBUG;TRACE full @@ -55,12 +55,12 @@ prompt MinimumRecommendedRules.ruleset 4 - false + False bin\x86\Release\ TRACE - true + True pdbonly x86 prompt @@ -233,11 +233,11 @@ - {2dafdfc1-223b-4741-87bb-be3d0a7617db} + {2DAFDFC1-223B-4741-87BB-BE3D0A7617DB} ANX.Framework.Content.Pipeline - {6899f0c9-70b9-4eb0-9dd3-e598d4be3e35} + {6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35} ANX.Framework diff --git a/Tools/ANXContentCompilerGUI/Controls/ArrowButton.Designer.cs b/Tools/ANXContentCompilerGUI/Controls/ArrowButton.Designer.cs index 12655a71..3efd4723 100644 --- a/Tools/ANXContentCompilerGUI/Controls/ArrowButton.Designer.cs +++ b/Tools/ANXContentCompilerGUI/Controls/ArrowButton.Designer.cs @@ -31,7 +31,7 @@ this.labelText = new System.Windows.Forms.Label(); this.splitContainer = new System.Windows.Forms.SplitContainer(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); -#if !LINUX +#if !MONO ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); #endif @@ -109,7 +109,7 @@ this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.ArrowButtonMouseUp); this.splitContainer.Panel1.ResumeLayout(false); this.splitContainer.Panel2.ResumeLayout(false); -#if !LINUX +#if !MONO ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); #endif diff --git a/Tools/ANXContentCompilerGUI/MainWindow.Designer.cs b/Tools/ANXContentCompilerGUI/MainWindow.Designer.cs index 54427c9a..012ce004 100644 --- a/Tools/ANXContentCompilerGUI/MainWindow.Designer.cs +++ b/Tools/ANXContentCompilerGUI/MainWindow.Designer.cs @@ -70,7 +70,7 @@ namespace ANX.ContentCompiler.GUI this.splitContainerMenuLayout.Panel1.SuspendLayout(); this.splitContainerMenuLayout.Panel2.SuspendLayout(); this.splitContainerMenuLayout.SuspendLayout(); -#if !LINUX +#if !MONO ((System.ComponentModel.ISupportInitialize)(this.splitContainerMenuLayout)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.show_pictureBoxRibbon)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.show_pictureBoxMenu)).BeginInit(); @@ -573,7 +573,7 @@ namespace ANX.ContentCompiler.GUI this.splitContainerFileTree.Panel1.ResumeLayout(false); this.splitContainerFileTree.Panel2.ResumeLayout(false); this.splitContainerFileTree.ResumeLayout(false); -#if !LINUX +#if !MONO ((System.ComponentModel.ISupportInitialize)(this.show_pictureBoxRibbon)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.show_pictureBoxMenu)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.show_pictureBoxErrorLog)).EndInit(); diff --git a/Tools/ANXContentCompilerGUI/MainWindow.cs b/Tools/ANXContentCompilerGUI/MainWindow.cs index dd272c61..d0d95fbe 100644 --- a/Tools/ANXContentCompilerGUI/MainWindow.cs +++ b/Tools/ANXContentCompilerGUI/MainWindow.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Diagnostics; using System.Drawing; using System.IO; @@ -33,6 +34,9 @@ namespace ANX.ContentCompiler.GUI private bool _mouseDown; private readonly string[] _args; private int _showCounter = 0; + + private ImporterManager iManager; + private ProcessorManager pManager; #endregion #region Properties @@ -74,6 +78,8 @@ namespace ANX.ContentCompiler.GUI treeViewItemDelete.MouseEnter += TreeViewItemMouseEnter; treeViewItemRename.MouseEnter += TreeViewItemMouseEnter; SetUpColors(); + iManager = new ImporterManager(); + pManager = new ProcessorManager(); } private void MainWindowShown(object sender, EventArgs e) @@ -264,6 +270,11 @@ namespace ANX.ContentCompiler.GUI { bI.ImporterName = ImporterManager.GuessImporterByFileExtension(bI.SourceFilename); } + + if (String.IsNullOrEmpty(bI.ProcessorName)) + { + bI.ProcessorName = pManager.GetProcessorForImporter(iManager.GetInstance(bI.ImporterName)); + } } try { @@ -340,8 +351,8 @@ namespace ANX.ContentCompiler.GUI OutputFilename = ProjectOutputDir + Path.DirectorySeparatorChar + folder + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(file) + ".xnb", //<- Change this if you want some other extension (i.e. to annoy modders or whatever) - ImporterName = ImporterManager.GuessImporterByFileExtension(file)//, - //ProcessorName = ProcessorManager.GuessImporterByFileExtension(file) //<- This still needs to be implemented, Pipeline devs! *poke* + ImporterName = ImporterManager.GuessImporterByFileExtension(file), + ProcessorName = pManager.GetProcessorForImporter(iManager.GetInstance(ImporterManager.GuessImporterByFileExtension(file))) }; _contentProject.BuildItems.Add(item); }