From 8b735c16c2f20e4f3c97ee34e4b68e3d6d5f6091 Mon Sep 17 00:00:00 2001 From: "SND\\eagleeyestudios_cp" Date: Mon, 10 Sep 2012 19:10:39 +0000 Subject: [PATCH] Content Compiler: - Added Developer Attributes & did some cleaning - Fixed RibbonButton image aligning bug (Worldicon not centered) - Added some comments to da code - Implemented cleaning of ContentProject (Deleting bin files) --- .../ANX.ContentCompiler.GUI.csproj | 44 +++- Tools/ANXContentCompilerGUI/App.config | 8 +- .../CCompilerBuildLogger.cs | 8 +- .../Controls/ArrowButton.cs | 5 +- .../Controls/RibbonButton.Designer.cs | 33 +-- .../Controls/RibbonButton.cs | 4 + .../Controls/RibbonTextBox.cs | 10 +- .../Controls/RibbonTextBox.resx | 120 --------- .../Dialogues/ErrorLogScreen.cs | 5 +- .../Dialogues/FirstStartScreen.cs | 4 + .../Dialogues/NewFolderScreen.cs | 8 +- .../Dialogues/NewProjectImportersScreen.cs | 4 + .../Dialogues/NewProjectOutputScreen.cs | 4 + .../Dialogues/NewProjectScreen.cs | 7 +- .../Dialogues/NewProjectSummaryScreen.cs | 15 +- .../Dialogues/OpenProjectScreen.cs | 10 +- .../MainWindow.Designer.cs | 206 +++++++-------- Tools/ANXContentCompilerGUI/MainWindow.cs | 235 +++++++++++++----- Tools/ANXContentCompilerGUI/MainWindow.resx | 123 --------- Tools/ANXContentCompilerGUI/Program.cs | 8 +- Tools/ANXContentCompilerGUI/RecentProjects.cs | 9 +- Tools/ANXContentCompilerGUI/Settings.cs | 28 ++- .../States/EditingState.cs | 7 +- .../ANXContentCompilerGUI/States/MenuState.cs | 25 +- .../States/StartState.cs | 13 +- .../TreeViewExtensions.cs | 10 +- 26 files changed, 468 insertions(+), 485 deletions(-) delete mode 100644 Tools/ANXContentCompilerGUI/Controls/RibbonTextBox.resx delete mode 100644 Tools/ANXContentCompilerGUI/MainWindow.resx diff --git a/Tools/ANXContentCompilerGUI/ANX.ContentCompiler.GUI.csproj b/Tools/ANXContentCompilerGUI/ANX.ContentCompiler.GUI.csproj index 7545a602..c356e3a7 100644 --- a/Tools/ANXContentCompilerGUI/ANX.ContentCompiler.GUI.csproj +++ b/Tools/ANXContentCompilerGUI/ANX.ContentCompiler.GUI.csproj @@ -14,11 +14,11 @@ - AnyCPU + x86 true full false - ..\..\bin\Debug\ + ..\..\bin\ DEBUG;TRACE prompt 4 @@ -36,6 +36,24 @@ ANX.ContentCompiler.GUI.Program + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + prompt + MinimumRecommendedRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + prompt + MinimumRecommendedRules.ruleset + @@ -145,15 +163,9 @@ - - RibbonTextBox.cs - ErrorLogScreen.cs - - MainWindow.cs - ResXFileCodeGenerator Resources.Designer.cs @@ -201,6 +213,22 @@ {6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35} ANX.Framework + + {5be49183-2f6f-4527-ac90-d816911fcf90} + ANX.RenderSystem.Windows.DX10 + + + {eb8258e0-6741-4db9-b756-1ebdf67b1ed6} + ANX.RenderSystem.Windows.GL3 + + + {b30de9c2-0926-46b6-8351-9af276c472d5} + ANX.RenderSystem.Windows.DX11 + + + {6a582788-c4d2-410c-96cd-177f75712d65} + ANX.SoundSystem.Windows.XAudio + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Tools/ANXContentCompilerGUI/Dialogues/ErrorLogScreen.cs b/Tools/ANXContentCompilerGUI/Dialogues/ErrorLogScreen.cs index dde1b9a4..719ba92a 100644 --- a/Tools/ANXContentCompilerGUI/Dialogues/ErrorLogScreen.cs +++ b/Tools/ANXContentCompilerGUI/Dialogues/ErrorLogScreen.cs @@ -1,9 +1,12 @@ using System; -using System.IO; using System.Windows.Forms; +using ANX.Framework.NonXNA.Development; namespace ANX.ContentCompiler.GUI.Dialogues { + [Developer("SilentWarrior/Eagle Eye Studios")] + [PercentageComplete(100)] + [TestState(TestStateAttribute.TestState.Tested)] public partial class ErrorLogScreen : Form { public ErrorLogScreen(string[] errorLog) diff --git a/Tools/ANXContentCompilerGUI/Dialogues/FirstStartScreen.cs b/Tools/ANXContentCompilerGUI/Dialogues/FirstStartScreen.cs index f4a8092a..df1d07ad 100644 --- a/Tools/ANXContentCompilerGUI/Dialogues/FirstStartScreen.cs +++ b/Tools/ANXContentCompilerGUI/Dialogues/FirstStartScreen.cs @@ -1,7 +1,11 @@ using System.Windows.Forms; +using ANX.Framework.NonXNA.Development; namespace ANX.ContentCompiler.GUI.Dialogues { + [Developer("SilentWarrior/Eagle Eye Studios")] + [PercentageComplete(80)] //TODO: Implement tour in MainWindow and launch it from here! + [TestState(TestStateAttribute.TestState.Untested)] public partial class FirstStartScreen : Form { public FirstStartScreen() diff --git a/Tools/ANXContentCompilerGUI/Dialogues/NewFolderScreen.cs b/Tools/ANXContentCompilerGUI/Dialogues/NewFolderScreen.cs index 43cc107a..a9f210c5 100644 --- a/Tools/ANXContentCompilerGUI/Dialogues/NewFolderScreen.cs +++ b/Tools/ANXContentCompilerGUI/Dialogues/NewFolderScreen.cs @@ -1,9 +1,12 @@ using System; -using System.IO; using System.Windows.Forms; +using ANX.Framework.NonXNA.Development; namespace ANX.ContentCompiler.GUI.Dialogues { + [Developer("SilentWarrior/Eagle Eye Studios")] + [PercentageComplete(100)] + [TestState(TestStateAttribute.TestState.Tested)] public partial class NewFolderScreen : Form { public NewFolderScreen() @@ -32,7 +35,8 @@ namespace ANX.ContentCompiler.GUI.Dialogues private void ButtonNextClick(object sender, EventArgs e) { if (String.IsNullOrEmpty(textBoxName.Text)) - MessageBox.Show("You need to type a name!", "Missing value", MessageBoxButtons.OK, MessageBoxIcon.Warning); + MessageBox.Show("You need to type a name!", "Missing value", MessageBoxButtons.OK, + MessageBoxIcon.Warning); else DialogResult = DialogResult.OK; } diff --git a/Tools/ANXContentCompilerGUI/Dialogues/NewProjectImportersScreen.cs b/Tools/ANXContentCompilerGUI/Dialogues/NewProjectImportersScreen.cs index c35a4998..aea15ec1 100644 --- a/Tools/ANXContentCompilerGUI/Dialogues/NewProjectImportersScreen.cs +++ b/Tools/ANXContentCompilerGUI/Dialogues/NewProjectImportersScreen.cs @@ -1,8 +1,12 @@ using System; using System.Windows.Forms; +using ANX.Framework.NonXNA.Development; namespace ANX.ContentCompiler.GUI.Dialogues { + [Developer("SilentWarrior/Eagle Eye Studios")] + [PercentageComplete(100)] + [TestState(TestStateAttribute.TestState.InProgress)] public partial class NewProjectImportersScreen : Form { public NewProjectImportersScreen() diff --git a/Tools/ANXContentCompilerGUI/Dialogues/NewProjectOutputScreen.cs b/Tools/ANXContentCompilerGUI/Dialogues/NewProjectOutputScreen.cs index d9da15e9..f9e79e61 100644 --- a/Tools/ANXContentCompilerGUI/Dialogues/NewProjectOutputScreen.cs +++ b/Tools/ANXContentCompilerGUI/Dialogues/NewProjectOutputScreen.cs @@ -1,8 +1,12 @@ using System; using System.Windows.Forms; +using ANX.Framework.NonXNA.Development; namespace ANX.ContentCompiler.GUI.Dialogues { + [Developer("SilentWarrior/Eagle Eye Studios")] + [PercentageComplete(100)] + [TestState(TestStateAttribute.TestState.InProgress)] public partial class NewProjectOutputScreen : Form { public NewProjectOutputScreen() diff --git a/Tools/ANXContentCompilerGUI/Dialogues/NewProjectScreen.cs b/Tools/ANXContentCompilerGUI/Dialogues/NewProjectScreen.cs index e877ea11..b7667086 100644 --- a/Tools/ANXContentCompilerGUI/Dialogues/NewProjectScreen.cs +++ b/Tools/ANXContentCompilerGUI/Dialogues/NewProjectScreen.cs @@ -1,9 +1,13 @@ using System; using System.IO; using System.Windows.Forms; +using ANX.Framework.NonXNA.Development; namespace ANX.ContentCompiler.GUI.Dialogues { + [Developer("SilentWarrior/Eagle Eye Studios")] + [PercentageComplete(100)] + [TestState(TestStateAttribute.TestState.Tested)] public partial class NewProjectScreen : Form { public NewProjectScreen() @@ -60,7 +64,8 @@ namespace ANX.ContentCompiler.GUI.Dialogues if (String.IsNullOrEmpty(textBoxName.Text)) MessageBox.Show("Give your child a name!", "Missing value", MessageBoxButtons.OK, MessageBoxIcon.Warning); else if (Directory.Exists(textBoxLocation.Text)) - MessageBox.Show("A project with this name already exists in that path!", "Will not overwrite existing stuff", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show("A project with this name already exists in that path!", + "Will not overwrite existing stuff", MessageBoxButtons.OK, MessageBoxIcon.Error); else DialogResult = DialogResult.OK; } diff --git a/Tools/ANXContentCompilerGUI/Dialogues/NewProjectSummaryScreen.cs b/Tools/ANXContentCompilerGUI/Dialogues/NewProjectSummaryScreen.cs index d53d5793..243b3e2f 100644 --- a/Tools/ANXContentCompilerGUI/Dialogues/NewProjectSummaryScreen.cs +++ b/Tools/ANXContentCompilerGUI/Dialogues/NewProjectSummaryScreen.cs @@ -1,30 +1,35 @@ using System; using System.Windows.Forms; +using ANX.Framework.NonXNA.Development; namespace ANX.ContentCompiler.GUI.Dialogues { + [Developer("SilentWarrior/Eagle Eye Studios")] + [PercentageComplete(100)] + [TestState(TestStateAttribute.TestState.InProgress)] public partial class NewProjectSummaryScreen : Form { - public NewProjectSummaryScreen(String projectName, String projectDir, String outputDir, bool customImporters, String customImportersDir, int customImportersFound, int customProcessorsFound) + public NewProjectSummaryScreen(String projectName, String projectDir, String outputDir, bool customImporters, + String customImportersDir, int customImportersFound, int customProcessorsFound) { InitializeComponent(); SetUpColors(); textBox.Text = "Summary for new project " + projectName + Environment.NewLine + "=========================================" + Environment.NewLine + - "Name: " + projectName + Environment.NewLine + + "Name: " + projectName + Environment.NewLine + "Media Directory: " + projectDir + Environment.NewLine + Environment.NewLine + "Output Directory: " + outputDir + Environment.NewLine + Environment.NewLine + "Custom Importers/Processors: " + customImporters + Environment.NewLine; if (customImporters) { textBox.Text += - "Custom Importers/Processors Location: " + customImportersDir + Environment.NewLine + Environment.NewLine + - "Importers/Processors found in given Location:" + Environment.NewLine + + "Custom Importers/Processors Location: " + customImportersDir + Environment.NewLine + + Environment.NewLine + + "Importers/Processors found in given Location:" + Environment.NewLine + "Importers: " + customImportersFound + Environment.NewLine + "Processors: " + customProcessorsFound; } - } private void SetUpColors() diff --git a/Tools/ANXContentCompilerGUI/Dialogues/OpenProjectScreen.cs b/Tools/ANXContentCompilerGUI/Dialogues/OpenProjectScreen.cs index 8c8277fa..bfba5ee2 100644 --- a/Tools/ANXContentCompilerGUI/Dialogues/OpenProjectScreen.cs +++ b/Tools/ANXContentCompilerGUI/Dialogues/OpenProjectScreen.cs @@ -1,9 +1,12 @@ using System; -using System.IO; using System.Windows.Forms; +using ANX.Framework.NonXNA.Development; namespace ANX.ContentCompiler.GUI.Dialogues { + [Developer("SilentWarrior/Eagle Eye Studios")] + [PercentageComplete(100)] + [TestState(TestStateAttribute.TestState.Tested)] public partial class OpenProjectScreen : Form { public OpenProjectScreen() @@ -11,7 +14,7 @@ namespace ANX.ContentCompiler.GUI.Dialogues InitializeComponent(); SetUpColors(); listBoxRecentProjects.Items.Clear(); - foreach(var project in MainWindow.Instance.RecentProjects) + foreach (string project in MainWindow.Instance.RecentProjects) { listBoxRecentProjects.Items.Add(project); } @@ -57,7 +60,8 @@ namespace ANX.ContentCompiler.GUI.Dialogues private void ButtonNextClick(object sender, EventArgs e) { if (String.IsNullOrEmpty(textBoxLocation.Text) && listBoxRecentProjects.SelectedItem == null) - MessageBox.Show("You need to select a project!", "Missing value", MessageBoxButtons.OK, MessageBoxIcon.Warning); + MessageBox.Show("You need to select a project!", "Missing value", MessageBoxButtons.OK, + MessageBoxIcon.Warning); else DialogResult = DialogResult.OK; } diff --git a/Tools/ANXContentCompilerGUI/MainWindow.Designer.cs b/Tools/ANXContentCompilerGUI/MainWindow.Designer.cs index 803d9f9f..e14a4823 100644 --- a/Tools/ANXContentCompilerGUI/MainWindow.Designer.cs +++ b/Tools/ANXContentCompilerGUI/MainWindow.Designer.cs @@ -1,4 +1,5 @@ using ANX.ContentCompiler.GUI.States; +using ANX.Framework.NonXNA.Development; namespace ANX.ContentCompiler.GUI { @@ -32,13 +33,6 @@ namespace ANX.ContentCompiler.GUI { this.components = new System.ComponentModel.Container(); this.splitContainerMenuLayout = new System.Windows.Forms.SplitContainer(); - this.ribbonTextBox = new ANX.ContentCompiler.GUI.Controls.RibbonTextBox(); - this.ribbonButtonHelp = new ANX.ContentCompiler.GUI.Controls.RibbonButton(); - this.ribbonButtonWeb = new ANX.ContentCompiler.GUI.Controls.RibbonButton(); - this.ribbonButtonClean = new ANX.ContentCompiler.GUI.Controls.RibbonButton(); - this.ribbonButtonSave = new ANX.ContentCompiler.GUI.Controls.RibbonButton(); - this.ribbonButtonLoad = new ANX.ContentCompiler.GUI.Controls.RibbonButton(); - this.ribbonButtonNew = new ANX.ContentCompiler.GUI.Controls.RibbonButton(); this.buttonQuit = new System.Windows.Forms.Button(); this.buttonMenu = new System.Windows.Forms.Button(); this.labelTitle = new System.Windows.Forms.Label(); @@ -50,11 +44,18 @@ namespace ANX.ContentCompiler.GUI this.treeViewItemRename = new System.Windows.Forms.ToolStripMenuItem(); this.treeViewItemDelete = new System.Windows.Forms.ToolStripMenuItem(); this.splitContainerProperties = new System.Windows.Forms.SplitContainer(); - this.editingState = new ANX.ContentCompiler.GUI.States.EditingState(); - this.startState = new ANX.ContentCompiler.GUI.States.StartState(); this.labelProperties = new System.Windows.Forms.Label(); this.propertyGrid = new System.Windows.Forms.PropertyGrid(); this.menuState = new ANX.ContentCompiler.GUI.States.MenuState(); + this.ribbonTextBox = new ANX.ContentCompiler.GUI.Controls.RibbonTextBox(); + this.ribbonButtonHelp = new ANX.ContentCompiler.GUI.Controls.RibbonButton(); + this.ribbonButtonWeb = new ANX.ContentCompiler.GUI.Controls.RibbonButton(); + this.ribbonButtonClean = new ANX.ContentCompiler.GUI.Controls.RibbonButton(); + this.ribbonButtonSave = new ANX.ContentCompiler.GUI.Controls.RibbonButton(); + this.ribbonButtonLoad = new ANX.ContentCompiler.GUI.Controls.RibbonButton(); + this.ribbonButtonNew = new ANX.ContentCompiler.GUI.Controls.RibbonButton(); + this.editingState = new ANX.ContentCompiler.GUI.States.EditingState(); + this.startState = new ANX.ContentCompiler.GUI.States.StartState(); ((System.ComponentModel.ISupportInitialize)(this.splitContainerMenuLayout)).BeginInit(); this.splitContainerMenuLayout.Panel1.SuspendLayout(); this.splitContainerMenuLayout.Panel2.SuspendLayout(); @@ -100,79 +101,6 @@ namespace ANX.ContentCompiler.GUI this.splitContainerMenuLayout.SplitterDistance = 99; this.splitContainerMenuLayout.TabIndex = 0; // - // ribbonTextBox - // - this.ribbonTextBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.ribbonTextBox.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ribbonTextBox.Location = new System.Drawing.Point(532, 26); - this.ribbonTextBox.Name = "ribbonTextBox"; - this.ribbonTextBox.Size = new System.Drawing.Size(320, 70); - this.ribbonTextBox.TabIndex = 9; - // - // ribbonButtonHelp - // - this.ribbonButtonHelp.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.ribbonButtonHelp.Content = "Help"; - this.ribbonButtonHelp.Image = global::ANX.ContentCompiler.GUI.Properties.Resources.appbar_question; - this.ribbonButtonHelp.Location = new System.Drawing.Point(299, 26); - this.ribbonButtonHelp.Name = "ribbonButtonHelp"; - this.ribbonButtonHelp.Size = new System.Drawing.Size(52, 68); - this.ribbonButtonHelp.TabIndex = 8; - // - // ribbonButtonWeb - // - this.ribbonButtonWeb.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.ribbonButtonWeb.Content = "Website"; - this.ribbonButtonWeb.Image = global::ANX.ContentCompiler.GUI.Properties.Resources.appbar_globe; - this.ribbonButtonWeb.Location = new System.Drawing.Point(237, 26); - this.ribbonButtonWeb.Name = "ribbonButtonWeb"; - this.ribbonButtonWeb.Size = new System.Drawing.Size(63, 68); - this.ribbonButtonWeb.TabIndex = 7; - // - // ribbonButtonClean - // - this.ribbonButtonClean.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.ribbonButtonClean.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.ribbonButtonClean.Content = "Clean"; - this.ribbonButtonClean.Image = global::ANX.ContentCompiler.GUI.Properties.Resources.appbar_clean; - this.ribbonButtonClean.Location = new System.Drawing.Point(186, 26); - this.ribbonButtonClean.Name = "ribbonButtonClean"; - this.ribbonButtonClean.Size = new System.Drawing.Size(52, 68); - this.ribbonButtonClean.TabIndex = 6; - // - // ribbonButtonSave - // - this.ribbonButtonSave.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.ribbonButtonSave.Content = "Save"; - this.ribbonButtonSave.Image = global::ANX.ContentCompiler.GUI.Properties.Resources.appbar_save; - this.ribbonButtonSave.Location = new System.Drawing.Point(105, 26); - this.ribbonButtonSave.Name = "ribbonButtonSave"; - this.ribbonButtonSave.Size = new System.Drawing.Size(52, 68); - this.ribbonButtonSave.TabIndex = 5; - this.ribbonButtonSave.Click += new System.EventHandler(this.SaveProject); - // - // ribbonButtonLoad - // - this.ribbonButtonLoad.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.ribbonButtonLoad.Content = "Open"; - this.ribbonButtonLoad.Image = global::ANX.ContentCompiler.GUI.Properties.Resources.appbar_folder_open; - this.ribbonButtonLoad.Location = new System.Drawing.Point(54, 26); - this.ribbonButtonLoad.Name = "ribbonButtonLoad"; - this.ribbonButtonLoad.Size = new System.Drawing.Size(52, 68); - this.ribbonButtonLoad.TabIndex = 4; - this.ribbonButtonLoad.Click += new System.EventHandler(this.OpenProjectDialog); - // - // ribbonButtonNew - // - this.ribbonButtonNew.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.ribbonButtonNew.Content = "New"; - this.ribbonButtonNew.Image = global::ANX.ContentCompiler.GUI.Properties.Resources.appbar_page_multiple; - this.ribbonButtonNew.Location = new System.Drawing.Point(3, 26); - this.ribbonButtonNew.Name = "ribbonButtonNew"; - this.ribbonButtonNew.Size = new System.Drawing.Size(52, 68); - this.ribbonButtonNew.TabIndex = 3; - this.ribbonButtonNew.Click += new System.EventHandler(this.NewProject); - // // buttonQuit // this.buttonQuit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -334,26 +262,6 @@ namespace ANX.ContentCompiler.GUI this.splitContainerProperties.SplitterDistance = 366; this.splitContainerProperties.TabIndex = 0; // - // editingState - // - this.editingState.Dock = System.Windows.Forms.DockStyle.Fill; - this.editingState.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.editingState.Location = new System.Drawing.Point(0, 0); - this.editingState.Name = "editingState"; - this.editingState.Size = new System.Drawing.Size(364, 547); - this.editingState.TabIndex = 1; - this.editingState.Visible = false; - // - // startState - // - this.startState.Dock = System.Windows.Forms.DockStyle.Fill; - this.startState.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.startState.Location = new System.Drawing.Point(0, 0); - this.startState.Name = "startState"; - this.startState.Size = new System.Drawing.Size(364, 547); - this.startState.TabIndex = 0; - this.startState.Visible = false; - // // labelProperties // this.labelProperties.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) @@ -402,6 +310,100 @@ namespace ANX.ContentCompiler.GUI this.menuState.TabIndex = 1; this.menuState.Visible = false; // + // ribbonTextBox + // + this.ribbonTextBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.ribbonTextBox.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.ribbonTextBox.Location = new System.Drawing.Point(532, 26); + this.ribbonTextBox.Name = "ribbonTextBox"; + this.ribbonTextBox.Size = new System.Drawing.Size(320, 70); + this.ribbonTextBox.TabIndex = 9; + // + // ribbonButtonHelp + // + this.ribbonButtonHelp.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.ribbonButtonHelp.Content = "Help"; + this.ribbonButtonHelp.Image = global::ANX.ContentCompiler.GUI.Properties.Resources.appbar_question; + this.ribbonButtonHelp.Location = new System.Drawing.Point(299, 26); + this.ribbonButtonHelp.Name = "ribbonButtonHelp"; + this.ribbonButtonHelp.Size = new System.Drawing.Size(52, 68); + this.ribbonButtonHelp.TabIndex = 8; + // + // ribbonButtonWeb + // + this.ribbonButtonWeb.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.ribbonButtonWeb.Content = "Website"; + this.ribbonButtonWeb.Image = global::ANX.ContentCompiler.GUI.Properties.Resources.appbar_globe; + this.ribbonButtonWeb.Location = new System.Drawing.Point(237, 26); + this.ribbonButtonWeb.Name = "ribbonButtonWeb"; + this.ribbonButtonWeb.Size = new System.Drawing.Size(63, 68); + this.ribbonButtonWeb.TabIndex = 7; + // + // ribbonButtonClean + // + this.ribbonButtonClean.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.ribbonButtonClean.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.ribbonButtonClean.Content = "Clean"; + this.ribbonButtonClean.Image = global::ANX.ContentCompiler.GUI.Properties.Resources.appbar_clean; + this.ribbonButtonClean.Location = new System.Drawing.Point(186, 26); + this.ribbonButtonClean.Name = "ribbonButtonClean"; + this.ribbonButtonClean.Size = new System.Drawing.Size(52, 68); + this.ribbonButtonClean.TabIndex = 6; + this.ribbonButtonClean.Click += new System.EventHandler(this.RibbonButtonCleanClick); + // + // ribbonButtonSave + // + this.ribbonButtonSave.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.ribbonButtonSave.Content = "Save"; + this.ribbonButtonSave.Image = global::ANX.ContentCompiler.GUI.Properties.Resources.appbar_save; + this.ribbonButtonSave.Location = new System.Drawing.Point(105, 26); + this.ribbonButtonSave.Name = "ribbonButtonSave"; + this.ribbonButtonSave.Size = new System.Drawing.Size(52, 68); + this.ribbonButtonSave.TabIndex = 5; + this.ribbonButtonSave.Click += new System.EventHandler(this.SaveProject); + // + // ribbonButtonLoad + // + this.ribbonButtonLoad.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.ribbonButtonLoad.Content = "Open"; + this.ribbonButtonLoad.Image = global::ANX.ContentCompiler.GUI.Properties.Resources.appbar_folder_open; + this.ribbonButtonLoad.Location = new System.Drawing.Point(54, 26); + this.ribbonButtonLoad.Name = "ribbonButtonLoad"; + this.ribbonButtonLoad.Size = new System.Drawing.Size(52, 68); + this.ribbonButtonLoad.TabIndex = 4; + this.ribbonButtonLoad.Click += new System.EventHandler(this.OpenProjectDialog); + // + // ribbonButtonNew + // + this.ribbonButtonNew.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.ribbonButtonNew.Content = "New"; + this.ribbonButtonNew.Image = global::ANX.ContentCompiler.GUI.Properties.Resources.appbar_page_multiple; + this.ribbonButtonNew.Location = new System.Drawing.Point(3, 26); + this.ribbonButtonNew.Name = "ribbonButtonNew"; + this.ribbonButtonNew.Size = new System.Drawing.Size(52, 68); + this.ribbonButtonNew.TabIndex = 3; + this.ribbonButtonNew.Click += new System.EventHandler(this.NewProject); + // + // editingState + // + this.editingState.Dock = System.Windows.Forms.DockStyle.Fill; + this.editingState.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.editingState.Location = new System.Drawing.Point(0, 0); + this.editingState.Name = "editingState"; + this.editingState.Size = new System.Drawing.Size(364, 547); + this.editingState.TabIndex = 1; + this.editingState.Visible = false; + // + // startState + // + this.startState.Dock = System.Windows.Forms.DockStyle.Fill; + this.startState.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.startState.Location = new System.Drawing.Point(0, 0); + this.startState.Name = "startState"; + this.startState.Size = new System.Drawing.Size(364, 547); + this.startState.TabIndex = 0; + this.startState.Visible = false; + // // MainWindow // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); diff --git a/Tools/ANXContentCompilerGUI/MainWindow.cs b/Tools/ANXContentCompilerGUI/MainWindow.cs index 56f2d7a8..f4dad48e 100644 --- a/Tools/ANXContentCompilerGUI/MainWindow.cs +++ b/Tools/ANXContentCompilerGUI/MainWindow.cs @@ -1,31 +1,39 @@ using System; -using System.Collections.Generic; using System.Drawing; using System.IO; using System.Linq; -using System.Threading; using System.Windows.Forms; using ANX.ContentCompiler.GUI.Dialogues; using ANX.Framework.Content.Pipeline; using ANX.Framework.Content.Pipeline.Tasks; +using ANX.Framework.NonXNA.Development; namespace ANX.ContentCompiler.GUI { + [Developer("SilentWarrior/Eagle Eye Studios")] + [PercentageComplete(71)] //TODO: Implement parameter handling, Tour, HelpButton, WebsiteButton, Preview! + [TestState(TestStateAttribute.TestState.InProgress)] public partial class MainWindow : Form { #region Fields - public static String DefaultOutputPath = "bin"; - public static String SettingsFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "ANX Content Compiler" + Path.DirectorySeparatorChar + "settings.ees"); - private Point _lastPos; - private bool _mouseDown; - private bool _menuMode; + public static String DefaultOutputPath = "bin"; + + public static String SettingsFile = + Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), + "ANX Content Compiler" + Path.DirectorySeparatorChar + "settings.ees"); + private readonly bool _firstStart = true; private ContentProject _contentProject; + private Point _lastPos; + private bool _menuMode; + private bool _mouseDown; + #endregion #region Properties + public static MainWindow Instance { get; private set; } public String ProjectName { get; set; } @@ -34,10 +42,12 @@ namespace ANX.ContentCompiler.GUI public String ProjectOutputDir { get; set; } public String ProjectImportersDir { get; set; } public RecentProjects RecentProjects { get; set; } + #endregion #region Init - public MainWindow() + + public MainWindow(string[] args) { InitializeComponent(); Instance = this; @@ -67,9 +77,11 @@ namespace ANX.ContentCompiler.GUI ShowFirstStartStuff(); ChangeEnvironmentStartState(); } + #endregion #region NewProject + public void NewProject(object sender, EventArgs e) { using (var dlg = new NewProjectScreen()) @@ -77,7 +89,9 @@ namespace ANX.ContentCompiler.GUI if (dlg.ShowDialog() == DialogResult.OK) { ProjectName = dlg.textBoxName.Text; - ProjectFolder = !String.IsNullOrEmpty(dlg.textBoxLocation.Text) ? dlg.textBoxLocation.Text : Path.Combine(Settings.DefaultProjectPath, ProjectName); + ProjectFolder = !String.IsNullOrEmpty(dlg.textBoxLocation.Text) + ? dlg.textBoxLocation.Text + : Path.Combine(Settings.DefaultProjectPath, ProjectName); ProjectPath = Path.Combine(ProjectFolder, ProjectName + ".cproj"); } else @@ -89,7 +103,9 @@ namespace ANX.ContentCompiler.GUI { if (dlg2.ShowDialog() == DialogResult.OK) { - ProjectOutputDir = !String.IsNullOrEmpty(dlg2.textBoxLocation.Text) ? dlg2.textBoxLocation.Text : Path.Combine(ProjectFolder, DefaultOutputPath); + ProjectOutputDir = !String.IsNullOrEmpty(dlg2.textBoxLocation.Text) + ? dlg2.textBoxLocation.Text + : Path.Combine(ProjectFolder, DefaultOutputPath); } else return; @@ -101,11 +117,13 @@ namespace ANX.ContentCompiler.GUI else return; } - var importersEnabled = !String.IsNullOrEmpty(ProjectImportersDir); - var importers = 0; - var processors = 0; + bool importersEnabled = !String.IsNullOrEmpty(ProjectImportersDir); + int importers = 0; + int processors = 0; - using (var dlg4 = new NewProjectSummaryScreen(ProjectName, ProjectFolder, ProjectOutputDir, importersEnabled, ProjectImportersDir, importers, processors)) + using ( + var dlg4 = new NewProjectSummaryScreen(ProjectName, ProjectFolder, ProjectOutputDir, importersEnabled, + ProjectImportersDir, importers, processors)) { dlg4.ShowDialog(); } @@ -120,9 +138,11 @@ namespace ANX.ContentCompiler.GUI }; ChangeEnvironmentOpenProject(); } + #endregion #region OpenProject + public void OpenProjectDialog(object sender, EventArgs e) { using (var dlg = new OpenProjectScreen()) @@ -132,9 +152,10 @@ namespace ANX.ContentCompiler.GUI if (dlg.listBoxRecentProjects.SelectedItem == null) OpenProject(dlg.textBoxLocation.Text); else - OpenProject((string)dlg.listBoxRecentProjects.SelectedItem); + OpenProject((string) dlg.listBoxRecentProjects.SelectedItem); } } + public void OpenProject(string path) { if (!File.Exists(path)) @@ -152,9 +173,11 @@ namespace ANX.ContentCompiler.GUI _contentProject.Creator = "ANX Content Compiler (4.0)"; ChangeEnvironmentOpenProject(); } + #endregion #region SaveProject + public void SaveProject(object sender, EventArgs e) { if (_contentProject == null) return; @@ -166,9 +189,11 @@ namespace ANX.ContentCompiler.GUI RecentProjects.Remove(ProjectPath); RecentProjects.Add(ProjectPath); } + #endregion #region SaveProjectAs + public void SaveProjectAs(object sender, EventArgs e) { using (var dlg = new SaveFileDialog()) @@ -183,25 +208,42 @@ namespace ANX.ContentCompiler.GUI } } } + + #endregion + + #region CleanProject + public void CleanProject() + { + if (Directory.Exists(ProjectOutputDir)) + Directory.Delete(ProjectOutputDir, true); + } #endregion #region BuildProject + public void BuildProject(object sender, EventArgs e) { DisableUI(); - BuildContent builderTask = new BuildContent(); - builderTask.BuildLogger = new CCompilerBuildLogger(); - builderTask.OutputDirectory = _contentProject.OutputDirectory; - builderTask.TargetPlatform = _contentProject.Platform; - builderTask.TargetProfile = _contentProject.Profile; - builderTask.CompressContent = false; + var builderTask = new BuildContent + { + BuildLogger = new CCompilerBuildLogger(), + OutputDirectory = _contentProject.OutputDirectory, + TargetPlatform = _contentProject.Platform, + TargetProfile = _contentProject.Profile, + CompressContent = false + }; try { + foreach (var dir in _contentProject.BuildItems.Select(buildItem => Path.GetDirectoryName(buildItem.OutputFilename)).Where(dir => !Directory.Exists(dir))) + { + Directory.CreateDirectory(dir); + } builderTask.Execute(_contentProject.BuildItems); + ribbonTextBox.AddMessage("[Info] Build process successfully finished."); } - catch(Exception ex) + catch (Exception ex) { - ribbonTextBox.AddMessage("[ERROR] " + ex.ToString() + "\n Stack: " + ex.StackTrace); + ribbonTextBox.AddMessage("[ERROR] " + ex + "\n Stack: " + ex.StackTrace); EnableUI(); } EnableUI(); @@ -232,35 +274,52 @@ namespace ANX.ContentCompiler.GUI ribbonButtonLoad.Enabled = true; ribbonButtonClean.Enabled = true; } + #endregion #region FileMethods + /// + /// Adds a file to the project + /// + /// the file to add private void AddFile(string file) { if (!File.Exists(file)) throw new FileNotFoundException(); - var folder = _contentProject.ContentRoot; - var node = treeView.SelectedNode; + string folder = _contentProject.ContentRoot; + TreeNode node = treeView.SelectedNode; if (node != null) folder = node.Name; - var absPath = ProjectFolder + Path.DirectorySeparatorChar + folder + Path.DirectorySeparatorChar + Path.GetFileName(file); + string absPath = ProjectFolder + Path.DirectorySeparatorChar + folder + Path.DirectorySeparatorChar + + Path.GetFileName(file); if (!Directory.Exists(Path.Combine(ProjectFolder, folder))) Directory.CreateDirectory(Path.Combine(ProjectFolder, folder)); File.Copy(file, absPath, true); var item = new BuildItem { - AssetName = folder.Equals(_contentProject.ContentRoot) ? Path.GetFileNameWithoutExtension(file) : folder.Replace(_contentProject.ContentRoot + Path.DirectorySeparatorChar, "") + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(file), + AssetName = + folder.Equals(_contentProject.ContentRoot) + ? Path.GetFileNameWithoutExtension(file) + : folder.Replace(_contentProject.ContentRoot + Path.DirectorySeparatorChar, "") + + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(file), SourceFilename = absPath, - OutputFilename = ProjectOutputDir + Path.DirectorySeparatorChar + folder + Path.DirectorySeparatorChar + Path.GetFileName(file), - ImporterName = ImporterManager.GuessImporterByFileExtension(file) + 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* }; _contentProject.BuildItems.Add(item); } + /// + /// Wrapper for adding moar files! (Just a foreach loop, nothing special) + /// + /// files to add public void AddFiles(string[] files) { - foreach (var file in files) + foreach (string file in files) { AddFile(file); } @@ -270,34 +329,35 @@ namespace ANX.ContentCompiler.GUI public void AddFolder(string name) { string folder = _contentProject.ContentRoot; - var node = treeView.SelectedNode; + TreeNode node = treeView.SelectedNode; if (node != null) folder = node.Name; else node = treeView.Nodes[0]; - var newFolder = new TreeNode(name) { Name = folder + Path.DirectorySeparatorChar + name}; + var newFolder = new TreeNode(name) {Name = folder + Path.DirectorySeparatorChar + name}; node.Nodes.Add(newFolder); - } public void RemoveFile(string name) { - } public void RemoveFiles(string[] files) { - } public void RemoveFolder(string name) { - } + #endregion #region EnvironmentStates + + /// + /// Changes the current editor state to the "No project open" state + /// public void ChangeEnvironmentStartState() { editingState.Visible = false; @@ -308,6 +368,9 @@ namespace ANX.ContentCompiler.GUI propertyGrid.SelectedObject = null; } + /// + /// Changes the current editor state to edit mode + /// public void ChangeEnvironmentOpenProject() { startState.Visible = false; @@ -317,40 +380,47 @@ namespace ANX.ContentCompiler.GUI ProjectFolder = _contentProject.InputDirectory; treeView.Nodes.Clear(); - var rootNode = new TreeNode(ProjectName + "(" + _contentProject.ContentRoot + ")") {Name = _contentProject.ContentRoot}; + var rootNode = new TreeNode(ProjectName + "(" + _contentProject.ContentRoot + ")") + {Name = _contentProject.ContentRoot}; treeView.Nodes.Add(rootNode); - var lastNode = rootNode; - foreach (var parts in _contentProject.BuildItems.Select(buildItem => buildItem.AssetName.Split(Path.DirectorySeparatorChar)).Where(parts => parts.Length >= 2)) + TreeNode lastNode = rootNode; + //aaaand here comes the nasty part. Watch out, it bites...um bugs! + foreach ( + var parts in + _contentProject.BuildItems.Select( + buildItem => buildItem.AssetName.Split(Path.DirectorySeparatorChar)).Where( + parts => parts.Length >= 2)) //all BuildItems which names contain more than two elements (ContentRoot + FileName), Split by SeperatorChar (=> platform independent coding :)) { string folder = ""; string parent = _contentProject.ContentRoot; - for (int i=0; i < parts.Length - 1; i++) + for (int i = 0; i < parts.Length - 1; i++) //Examine everything between ContentRoot and fileName. If we find something, add a folder! { - if (parts[i] == null) continue; - if (i > 0) + if (parts[i] == null) continue; + if (i > 0) //if there is already a path we need to add the new part with a SeperatorChar! folder += Path.DirectorySeparatorChar + parts[i]; else - folder = parts[0]; + folder = parts[0]; //Yay! We are first! Let's make ourselves comfortable here! - if (parts.Length > 2 && i < parts.Length -2) + if (parts.Length > 2 && i < parts.Length - 2) // if we have more than two parts we have another parent than the content root! parent += Path.DirectorySeparatorChar + parts[i]; //else if (parts.Length == 2) - // parent += Path.DirectorySeparatorChar + parts[0]; + // parent += Path.DirectorySeparatorChar + parts[0]; } - lastNode = treeView.RecursiveSearch(parent); - var node = new TreeNode(parts[parts.Length - 2]) { Name = _contentProject.ContentRoot + Path.DirectorySeparatorChar + folder }; + lastNode = treeView.RecursiveSearch(parent); //Search for parent node! Often an Exception Candidate! Check the 'parent' var then. + var node = new TreeNode(parts[parts.Length - 2]) + {Name = _contentProject.ContentRoot + Path.DirectorySeparatorChar + folder}; //Finally glue a new folder node together if (!ContainsTreeNode(lastNode, node)) { - lastNode.Nodes.Add(node); + lastNode.Nodes.Add(node); // If the folder is new, add it - else it's just wasted memory :) } lastNode = rootNode; } - if (_contentProject.BuildItems.Count > 0) + if (_contentProject.BuildItems.Count > 0) //Only do this when there are items, it'll get nasty soon if there isn't one! { - foreach (var buildItem in _contentProject.BuildItems) + foreach (BuildItem buildItem in _contentProject.BuildItems) { - String[] parts = null; + String[] parts = null; //Split by seperator char if (buildItem.AssetName.Contains("\\")) parts = buildItem.AssetName.Split('\\'); else if (buildItem.AssetName.Contains("/")) @@ -362,8 +432,9 @@ namespace ANX.ContentCompiler.GUI lastNode = lastNode.Nodes[parts[i]]; } }*/ + //Add the actual files to the tree in their apropriate subdirs string path = _contentProject.ContentRoot; - if (parts != null) + if (parts != null) { for (int i = 0; i < parts.Length - 1; i++) { @@ -372,39 +443,56 @@ namespace ANX.ContentCompiler.GUI } if (parts != null) { - var node = treeView.RecursiveSearch(path); + TreeNode node = treeView.RecursiveSearch(path); if (node == null) throw new ArgumentNullException("Node not found!"); var item = new TreeNode(parts[parts.Length - 1]) {Name = buildItem.AssetName}; node.Nodes.Add(item); } - else + else //if the node is "forever alone", put him into the rootNode to make some friends! { var item = new TreeNode(buildItem.AssetName) {Name = buildItem.AssetName}; treeView.Nodes[0].Nodes.Add(item); } } } - } + #endregion #region ButtonHandlers + private void ButtonQuitClick(object sender, EventArgs e) { Application.Exit(); } + private void ButtonMenuClick(object sender, EventArgs e) { ToggleMenuMode(); } + + private void RibbonButtonCleanClick(object sender, EventArgs e) + { + if (!Directory.Exists(ProjectOutputDir)) return; + if (MessageBox.Show( + "You are about to delete stuff you previously built! That already built content will be lost forever (which is a very long time!). Still want to continue?", + "Delete Output?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) + { + CleanProject(); + MessageBox.Show("Your build directory has been emptied. Goodbye Files!", "Success", MessageBoxButtons.OK, + MessageBoxIcon.Information); + } + } + #endregion #region WindowMoveMethods + private void LabelTitleMouseMove(object sender, MouseEventArgs e) { if (!_mouseDown) return; - var xoffset = MousePosition.X - _lastPos.X; - var yoffset = MousePosition.Y - _lastPos.Y; + int xoffset = MousePosition.X - _lastPos.X; + int yoffset = MousePosition.Y - _lastPos.Y; Left += xoffset; Top += yoffset; _lastPos = MousePosition; @@ -420,21 +508,25 @@ namespace ANX.ContentCompiler.GUI { _mouseDown = false; } + #endregion #region TreeVieItemDesignMethods - void TreeViewItemeLeave(object sender, EventArgs e) + + private void TreeViewItemeLeave(object sender, EventArgs e) { - ((ToolStripItem)sender).BackColor = Color.FromArgb(0, 64, 64, 64); + ((ToolStripItem) sender).BackColor = Color.FromArgb(0, 64, 64, 64); } - void TreeViewItemMouseEnter(object sender, EventArgs e) + private void TreeViewItemMouseEnter(object sender, EventArgs e) { - ((ToolStripItem)sender).BackColor = Color.Green; + ((ToolStripItem) sender).BackColor = Color.Green; } + #endregion #region MenuMethods + public void ToggleMenuMode() { _menuMode = !_menuMode; @@ -453,19 +545,21 @@ namespace ANX.ContentCompiler.GUI #endregion #region ShowFirstStartStuff + private void ShowFirstStartStuff() { using (var dlg = new FirstStartScreen()) { if (dlg.ShowDialog() == DialogResult.OK) { - } } } + #endregion #region SetUpColors + private void SetUpColors() { BackColor = Settings.MainColor; @@ -486,9 +580,11 @@ namespace ANX.ContentCompiler.GUI propertyGrid.ViewBackColor = Settings.DarkMainColor; propertyGrid.ViewForeColor = Settings.ForeColor; } + #endregion #region Exit + private void MainWindowFormClosed(object sender, FormClosedEventArgs e) { Settings.Save(SettingsFile); @@ -497,18 +593,22 @@ namespace ANX.ContentCompiler.GUI private void MainWindowFormClosing(object sender, FormClosingEventArgs e) { - } + #endregion #region TreeViewEvents + private void TreeViewAfterSelect(object sender, TreeViewEventArgs e) { if (treeView.SelectedNode == treeView.TopNode) propertyGrid.SelectedObject = _contentProject; else { - foreach (var buildItem in _contentProject.BuildItems.Where(buildItem => buildItem.AssetName.Equals(treeView.SelectedNode.Name))) + foreach ( + BuildItem buildItem in + _contentProject.BuildItems.Where( + buildItem => buildItem.AssetName.Equals(treeView.SelectedNode.Name))) { propertyGrid.SelectedObject = buildItem; } @@ -523,6 +623,7 @@ namespace ANX.ContentCompiler.GUI #endregion #region PropertyGridEvents + private void PropertyGridPropertyValueChanged(object s, PropertyValueChangedEventArgs e) { ProjectName = _contentProject.Name; @@ -533,12 +634,14 @@ namespace ANX.ContentCompiler.GUI { foreach (BuildItem buildItem in _contentProject.BuildItems) { - buildItem.AssetName = buildItem.AssetName.Replace((string)e.OldValue, _contentProject.ContentRoot); + buildItem.AssetName = buildItem.AssetName.Replace((string) e.OldValue, _contentProject.ContentRoot); } - treeView.Nodes[0].RecursivelyReplacePartOfName((string)e.OldValue, _contentProject.ContentRoot); + treeView.Nodes[0].RecursivelyReplacePartOfName((string) e.OldValue, _contentProject.ContentRoot); } ChangeEnvironmentOpenProject(); } + #endregion + } } \ No newline at end of file diff --git a/Tools/ANXContentCompilerGUI/MainWindow.resx b/Tools/ANXContentCompilerGUI/MainWindow.resx deleted file mode 100644 index 5397b4b7..00000000 --- a/Tools/ANXContentCompilerGUI/MainWindow.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 16, 30 - - \ No newline at end of file diff --git a/Tools/ANXContentCompilerGUI/Program.cs b/Tools/ANXContentCompilerGUI/Program.cs index d9a5244f..9b1fac3b 100644 --- a/Tools/ANXContentCompilerGUI/Program.cs +++ b/Tools/ANXContentCompilerGUI/Program.cs @@ -1,19 +1,23 @@ using System; using System.Windows.Forms; +using ANX.Framework.NonXNA.Development; namespace ANX.ContentCompiler.GUI { + [Developer("SilentWarrior/Eagle Eye Studios")] + [PercentageComplete(100)] + [TestState(TestStateAttribute.TestState.Tested)] internal static class Program { /// /// Der Haupteinstiegspunkt für die Anwendung. /// [STAThread] - private static void Main() + private static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new MainWindow()); + Application.Run(new MainWindow(args)); } } } \ No newline at end of file diff --git a/Tools/ANXContentCompilerGUI/RecentProjects.cs b/Tools/ANXContentCompilerGUI/RecentProjects.cs index 1e8fedbf..52ef09a4 100644 --- a/Tools/ANXContentCompilerGUI/RecentProjects.cs +++ b/Tools/ANXContentCompilerGUI/RecentProjects.cs @@ -2,18 +2,23 @@ using System.Collections.Generic; using System.Text; using System.Xml; +using ANX.Framework.NonXNA.Development; namespace ANX.ContentCompiler.GUI { + [Developer("SilentWarrior/Eagle Eye Studios")] + [PercentageComplete(100)] + [TestState(TestStateAttribute.TestState.Tested)] public class RecentProjects : List { private static readonly string Path = - Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + System.IO.Path.DirectorySeparatorChar + "ANX Content Compiler" + System.IO.Path.DirectorySeparatorChar + "recentProjects.ees"; + Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + + System.IO.Path.DirectorySeparatorChar + "ANX Content Compiler" + System.IO.Path.DirectorySeparatorChar + + "recentProjects.ees"; public RecentProjects() : base(10) { - } public void Save() diff --git a/Tools/ANXContentCompilerGUI/Settings.cs b/Tools/ANXContentCompilerGUI/Settings.cs index 57e6dfa9..5b36a88f 100644 --- a/Tools/ANXContentCompilerGUI/Settings.cs +++ b/Tools/ANXContentCompilerGUI/Settings.cs @@ -4,9 +4,13 @@ using System.Drawing; using System.IO; using System.Text; using System.Xml; +using ANX.Framework.NonXNA.Development; namespace ANX.ContentCompiler.GUI { + [Developer("SilentWarrior/Eagle Eye Studios")] + [PercentageComplete(90)] + [TestState(TestStateAttribute.TestState.Tested)] public static class Settings { public static String DefaultProjectPath { get; set; } @@ -17,12 +21,13 @@ namespace ANX.ContentCompiler.GUI public static Color AccentColor { get; set; } public static Color AccentColor2 { get; set; } public static Color AccentColor3 { get; set; } - public static List RecentProjects { get; set; } + public static List RecentProjects { get; set; } public static void Defaults() { DefaultProjectPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), - "ANX Content Compiler" + Path.DirectorySeparatorChar + "4.0" + Path.DirectorySeparatorChar); + "ANX Content Compiler" + Path.DirectorySeparatorChar + "4.0" + + Path.DirectorySeparatorChar); RecentProjects = new List(); MainColor = Color.FromArgb(64, 64, 64); //MainColor = Color.Goldenrod; @@ -32,7 +37,7 @@ namespace ANX.ContentCompiler.GUI //LightMainColor = Color.Gold; ForeColor = Color.White; //ForeColor = Color.DarkRed; - AccentColor = Color.FromArgb(0, 192, 0); + AccentColor = Color.FromArgb(0, 192, 0); //AccentColor = Color.HotPink; AccentColor2 = Color.LimeGreen; //AccentColor2 = Color.IndianRed; @@ -42,7 +47,8 @@ namespace ANX.ContentCompiler.GUI public static void Load(string path) { DefaultProjectPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), - "ANX Content Compiler" + Path.DirectorySeparatorChar + "4.0" + Path.DirectorySeparatorChar); + "ANX Content Compiler" + Path.DirectorySeparatorChar + "4.0" + + Path.DirectorySeparatorChar); RecentProjects = new List(); if (!File.Exists(path)) return; XmlReader reader = new XmlTextReader(path); @@ -95,7 +101,13 @@ namespace ANX.ContentCompiler.GUI if (!Directory.Exists(Path.GetDirectoryName(path))) Directory.CreateDirectory(Path.GetDirectoryName(path)); - XmlWriter writer = XmlWriter.Create(path, new XmlWriterSettings() { Encoding = Encoding.UTF8, Indent = true, NewLineHandling = NewLineHandling.Entitize }); + XmlWriter writer = XmlWriter.Create(path, + new XmlWriterSettings + { + Encoding = Encoding.UTF8, + Indent = true, + NewLineHandling = NewLineHandling.Entitize + }); writer.WriteStartDocument(); writer.WriteStartElement("CCompiler4Settings"); writer.WriteStartElement("MainColor"); @@ -120,7 +132,7 @@ namespace ANX.ContentCompiler.GUI writer.WriteValue(GetStringFromColor(AccentColor3)); writer.WriteFullEndElement(); writer.WriteStartElement("RecentProjects"); - foreach (var recentProject in RecentProjects) + foreach (string recentProject in RecentProjects) { writer.WriteStartElement("Path"); writer.WriteString(recentProject); @@ -140,8 +152,8 @@ namespace ANX.ContentCompiler.GUI private static Color GetColorFromString(string xml) { - var s = xml.Split(new[] {','}, 3); + string[] s = xml.Split(new[] {','}, 3); return Color.FromArgb(Convert.ToInt32(s[0]), Convert.ToInt32(s[1]), Convert.ToInt32(s[2])); } } -} +} \ No newline at end of file diff --git a/Tools/ANXContentCompilerGUI/States/EditingState.cs b/Tools/ANXContentCompilerGUI/States/EditingState.cs index 073603f9..0f752c69 100644 --- a/Tools/ANXContentCompilerGUI/States/EditingState.cs +++ b/Tools/ANXContentCompilerGUI/States/EditingState.cs @@ -1,9 +1,13 @@ using System; using System.Windows.Forms; using ANX.ContentCompiler.GUI.Dialogues; +using ANX.Framework.NonXNA.Development; namespace ANX.ContentCompiler.GUI.States { + [Developer("SilentWarrior/Eagle Eye Studios")] + [PercentageComplete(90)] //TODO: Add click event to open preview window! + [TestState(TestStateAttribute.TestState.Tested)] public partial class EditingState : UserControl { public EditingState() @@ -43,6 +47,5 @@ namespace ANX.ContentCompiler.GUI.States { MainWindow.Instance.BuildProject(sender, e); } - } -} +} \ No newline at end of file diff --git a/Tools/ANXContentCompilerGUI/States/MenuState.cs b/Tools/ANXContentCompilerGUI/States/MenuState.cs index eaa74ec4..e2250268 100644 --- a/Tools/ANXContentCompilerGUI/States/MenuState.cs +++ b/Tools/ANXContentCompilerGUI/States/MenuState.cs @@ -1,15 +1,13 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Data; -using System.Linq; -using System.Text; using System.Windows.Forms; using ANX.ContentCompiler.GUI.Dialogues; +using ANX.Framework.NonXNA.Development; namespace ANX.ContentCompiler.GUI.States { + [Developer("SilentWarrior/Eagle Eye Studios")] + [PercentageComplete(90)] //TODO: Actually implement Import dialogue, for now just using the usual one + [TestState(TestStateAttribute.TestState.Tested)] public partial class MenuState : UserControl { public MenuState() @@ -18,6 +16,7 @@ namespace ANX.ContentCompiler.GUI.States } #region HelperMethods + private void SetUpColors() { BackColor = Settings.MainColor; @@ -60,15 +59,18 @@ namespace ANX.ContentCompiler.GUI.States panelSaveAs.Visible = false; panelSettings.Visible = false; } + #endregion #region MenuButtons + private void ButtonNewClick(object sender, EventArgs e) { ResetMenuState(); buttonNew.BackColor = Settings.AccentColor; panelNew.Visible = true; } + private void ButtonOpenClick(object sender, EventArgs e) { ResetMenuState(); @@ -108,9 +110,11 @@ namespace ANX.ContentCompiler.GUI.States ResetMenuState(); Application.Exit(); } + #endregion #region MenuNew + private void ArrowButtonFileClick(object sender, EventArgs e) { using (var dlg = new OpenFileDialog()) @@ -139,9 +143,11 @@ namespace ANX.ContentCompiler.GUI.States { MainWindow.Instance.NewProject(sender, e); } + #endregion #region MenuOpen + private void ArrowButtonOpenClick(object sender, EventArgs e) { MainWindow.Instance.OpenProjectDialog(sender, e); @@ -153,9 +159,11 @@ namespace ANX.ContentCompiler.GUI.States MainWindow.Instance.OpenProjectDialog(sender, e); MainWindow.Instance.ToggleMenuMode(); } + #endregion #region MenuSave + private void ArrowButtonSaveAsCprojClick(object sender, EventArgs e) { MainWindow.Instance.SaveProjectAs(sender, e); @@ -167,8 +175,10 @@ namespace ANX.ContentCompiler.GUI.States MainWindow.Instance.SaveProjectAs(sender, e); MainWindow.Instance.ToggleMenuMode(); } + #endregion + #region Load private void MenuState_Load(object sender, EventArgs e) { SetUpColors(); @@ -176,5 +186,6 @@ namespace ANX.ContentCompiler.GUI.States buttonNew.BackColor = Settings.AccentColor; panelNew.Visible = true; } + #endregion } -} +} \ No newline at end of file diff --git a/Tools/ANXContentCompilerGUI/States/StartState.cs b/Tools/ANXContentCompilerGUI/States/StartState.cs index d133b8bf..8bb9cb17 100644 --- a/Tools/ANXContentCompilerGUI/States/StartState.cs +++ b/Tools/ANXContentCompilerGUI/States/StartState.cs @@ -1,7 +1,12 @@ -using System.Windows.Forms; +using System; +using System.Windows.Forms; +using ANX.Framework.NonXNA.Development; namespace ANX.ContentCompiler.GUI.States { + [Developer("SilentWarrior/Eagle Eye Studios")] + [PercentageComplete(100)] + [TestState(TestStateAttribute.TestState.Tested)] public partial class StartState : UserControl { public StartState() @@ -15,17 +20,17 @@ namespace ANX.ContentCompiler.GUI.States ForeColor = Settings.ForeColor; } - private void StartStateLoad(object sender, System.EventArgs e) + private void StartStateLoad(object sender, EventArgs e) { SetUpColor(); } - private void ArrowButtonNewClick(object sender, System.EventArgs e) + private void ArrowButtonNewClick(object sender, EventArgs e) { MainWindow.Instance.NewProject(sender, e); } - private void ArrowButtonLoadClick(object sender, System.EventArgs e) + private void ArrowButtonLoadClick(object sender, EventArgs e) { MainWindow.Instance.OpenProjectDialog(sender, e); } diff --git a/Tools/ANXContentCompilerGUI/TreeViewExtensions.cs b/Tools/ANXContentCompilerGUI/TreeViewExtensions.cs index 89f6a67a..0e924b79 100644 --- a/Tools/ANXContentCompilerGUI/TreeViewExtensions.cs +++ b/Tools/ANXContentCompilerGUI/TreeViewExtensions.cs @@ -1,8 +1,12 @@ using System; using System.Windows.Forms; +using ANX.Framework.NonXNA.Development; namespace ANX.ContentCompiler.GUI { + [Developer("SilentWarrior/Eagle Eye Studios")] + [PercentageComplete(100)] + [TestState(TestStateAttribute.TestState.Tested)] public static class TreeViewExtensions { /// @@ -18,7 +22,7 @@ namespace ANX.ContentCompiler.GUI if (treeNode.Name.Equals(name)) return treeNode; - var retNode = treeNode.RecursiveSearch(name); + TreeNode retNode = treeNode.RecursiveSearch(name); if (retNode != null) { return retNode; @@ -40,7 +44,7 @@ namespace ANX.ContentCompiler.GUI if (node.Name.Equals(name)) return node; - var ret = node.RecursiveSearch(name); + TreeNode ret = node.RecursiveSearch(name); if (ret != null) return ret; } @@ -63,4 +67,4 @@ namespace ANX.ContentCompiler.GUI } } } -} +} \ No newline at end of file