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)
This commit is contained in:
SND\eagleeyestudios_cp 2012-09-10 19:10:39 +00:00
parent 0251a7a2e7
commit 8b735c16c2
26 changed files with 468 additions and 485 deletions

View File

@ -14,11 +14,11 @@
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>..\..\bin\Debug\</OutputPath> <OutputPath>..\..\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
@ -36,6 +36,24 @@
<PropertyGroup> <PropertyGroup>
<StartupObject>ANX.ContentCompiler.GUI.Program</StartupObject> <StartupObject>ANX.ContentCompiler.GUI.Program</StartupObject>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
@ -145,15 +163,9 @@
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TreeViewExtensions.cs" /> <Compile Include="TreeViewExtensions.cs" />
<EmbeddedResource Include="Controls\RibbonTextBox.resx">
<DependentUpon>RibbonTextBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Dialogues\ErrorLogScreen.resx"> <EmbeddedResource Include="Dialogues\ErrorLogScreen.resx">
<DependentUpon>ErrorLogScreen.cs</DependentUpon> <DependentUpon>ErrorLogScreen.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="MainWindow.resx">
<DependentUpon>MainWindow.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx"> <EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
@ -201,6 +213,22 @@
<Project>{6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35}</Project> <Project>{6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35}</Project>
<Name>ANX.Framework</Name> <Name>ANX.Framework</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\RenderSystems\ANX.Framework.Windows.DX10\ANX.RenderSystem.Windows.DX10.csproj">
<Project>{5be49183-2f6f-4527-ac90-d816911fcf90}</Project>
<Name>ANX.RenderSystem.Windows.DX10</Name>
</ProjectReference>
<ProjectReference Include="..\..\RenderSystems\ANX.Framework.Windows.GL3\ANX.RenderSystem.Windows.GL3.csproj">
<Project>{eb8258e0-6741-4db9-b756-1ebdf67b1ed6}</Project>
<Name>ANX.RenderSystem.Windows.GL3</Name>
</ProjectReference>
<ProjectReference Include="..\..\RenderSystems\ANX.RenderSystem.Windows.DX11\ANX.RenderSystem.Windows.DX11.csproj">
<Project>{b30de9c2-0926-46b6-8351-9af276c472d5}</Project>
<Name>ANX.RenderSystem.Windows.DX11</Name>
</ProjectReference>
<ProjectReference Include="..\..\SoundSystems\ANX.SoundSystem.Windows.XAudio\ANX.SoundSystem.Windows.XAudio.csproj">
<Project>{6a582788-c4d2-410c-96cd-177f75712d65}</Project>
<Name>ANX.SoundSystem.Windows.XAudio</Name>
</ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@ -1,7 +1,9 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<configuration> <configuration>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</configuration> </startup>
</configuration>

View File

@ -1,18 +1,22 @@
using System; using System;
using ANX.Framework.Content.Pipeline; using ANX.Framework.Content.Pipeline;
using ANX.Framework.NonXNA.Development;
namespace ANX.ContentCompiler.GUI namespace ANX.ContentCompiler.GUI
{ {
[Developer("SilentWarrior/Eagle Eye Studios")]
[PercentageComplete(99)] //TODO: Logging to a file and (RTF) colors would be cool!
[TestState(TestStateAttribute.TestState.Tested)]
public class CCompilerBuildLogger : ContentBuildLogger public class CCompilerBuildLogger : ContentBuildLogger
{ {
public override void LogImportantMessage(string message, params object[] messageArgs) public override void LogImportantMessage(string message, params object[] messageArgs)
{ {
MainWindow.Instance.ribbonTextBox.AddMessage("[IMPORTANT] " + String.Format(message, messageArgs)); MainWindow.Instance.ribbonTextBox.AddMessage("[IMPORTANT] " + String.Format(message, messageArgs));
} }
public override void LogMessage(string message, params object[] messageArgs) public override void LogMessage(string message, params object[] messageArgs)
{ {
MainWindow.Instance.ribbonTextBox.AddMessage("[Info] " + String.Format(message, messageArgs)); MainWindow.Instance.ribbonTextBox.AddMessage("[Info] " + String.Format(message, messageArgs));
} }
public override void LogWarning(string helpLink, ContentIdentity contentIdentity, string message, public override void LogWarning(string helpLink, ContentIdentity contentIdentity, string message,

View File

@ -1,10 +1,13 @@
using System; using System;
using System.ComponentModel; using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using ANX.Framework.NonXNA.Development;
namespace ANX.ContentCompiler.GUI.Controls namespace ANX.ContentCompiler.GUI.Controls
{ {
[Developer("SilentWarrior/Eagle Eye Studios")]
[PercentageComplete(100)]
[TestState(TestStateAttribute.TestState.Tested)]
public partial class ArrowButton : UserControl public partial class ArrowButton : UserControl
{ {
public ArrowButton() public ArrowButton()

View File

@ -28,24 +28,11 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.pictureBox = new System.Windows.Forms.PictureBox();
this.labelText = new System.Windows.Forms.Label(); this.labelText = new System.Windows.Forms.Label();
this.pictureBox = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// pictureBox
//
this.pictureBox.Location = new System.Drawing.Point(0, 0);
this.pictureBox.Name = "pictureBox";
this.pictureBox.Size = new System.Drawing.Size(60, 60);
this.pictureBox.TabIndex = 0;
this.pictureBox.TabStop = false;
this.pictureBox.MouseDown += new System.Windows.Forms.MouseEventHandler(this.RibbonButtonMouseDown);
this.pictureBox.MouseEnter += new System.EventHandler(this.RibbonButtonMouseEnter);
this.pictureBox.MouseLeave += new System.EventHandler(this.RibbonButtonMouseLeave);
this.pictureBox.MouseHover += new System.EventHandler(this.RibbonButtonMouseHover);
this.pictureBox.MouseUp += new System.Windows.Forms.MouseEventHandler(this.RibbonButtonMouseUp);
//
// labelText // labelText
// //
this.labelText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) this.labelText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
@ -62,6 +49,22 @@
this.labelText.MouseHover += new System.EventHandler(this.RibbonButtonMouseHover); this.labelText.MouseHover += new System.EventHandler(this.RibbonButtonMouseHover);
this.labelText.MouseUp += new System.Windows.Forms.MouseEventHandler(this.RibbonButtonMouseUp); this.labelText.MouseUp += new System.Windows.Forms.MouseEventHandler(this.RibbonButtonMouseUp);
// //
// pictureBox
//
this.pictureBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pictureBox.Location = new System.Drawing.Point(0, 0);
this.pictureBox.Name = "pictureBox";
this.pictureBox.Size = new System.Drawing.Size(60, 60);
this.pictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.pictureBox.TabIndex = 0;
this.pictureBox.TabStop = false;
this.pictureBox.MouseDown += new System.Windows.Forms.MouseEventHandler(this.RibbonButtonMouseDown);
this.pictureBox.MouseEnter += new System.EventHandler(this.RibbonButtonMouseEnter);
this.pictureBox.MouseLeave += new System.EventHandler(this.RibbonButtonMouseLeave);
this.pictureBox.MouseHover += new System.EventHandler(this.RibbonButtonMouseHover);
this.pictureBox.MouseUp += new System.Windows.Forms.MouseEventHandler(this.RibbonButtonMouseUp);
//
// RibbonButton // RibbonButton
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -85,7 +88,7 @@
#endregion #endregion
private System.Windows.Forms.PictureBox pictureBox;
private System.Windows.Forms.Label labelText; private System.Windows.Forms.Label labelText;
private System.Windows.Forms.PictureBox pictureBox;
} }
} }

View File

@ -2,9 +2,13 @@
using System.ComponentModel; using System.ComponentModel;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using ANX.Framework.NonXNA.Development;
namespace ANX.ContentCompiler.GUI.Controls namespace ANX.ContentCompiler.GUI.Controls
{ {
[Developer("SilentWarrior/Eagle Eye Studios")]
[PercentageComplete(100)]
[TestState(TestStateAttribute.TestState.Tested)]
public partial class RibbonButton : UserControl public partial class RibbonButton : UserControl
{ {
public RibbonButton() public RibbonButton()

View File

@ -1,15 +1,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq; using System.Linq;
using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using ANX.ContentCompiler.GUI.Dialogues; using ANX.ContentCompiler.GUI.Dialogues;
using ANX.Framework.NonXNA.Development;
namespace ANX.ContentCompiler.GUI.Controls namespace ANX.ContentCompiler.GUI.Controls
{ {
[Developer("SilentWarrior/Eagle Eye Studios")]
[PercentageComplete(100)]
[TestState(TestStateAttribute.TestState.Tested)]
public partial class RibbonTextBox : UserControl public partial class RibbonTextBox : UserControl
{ {
public RibbonTextBox() public RibbonTextBox()
@ -32,4 +32,4 @@ namespace ANX.ContentCompiler.GUI.Controls
} }
} }
} }
} }

View File

@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1,9 +1,12 @@
using System; using System;
using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using ANX.Framework.NonXNA.Development;
namespace ANX.ContentCompiler.GUI.Dialogues namespace ANX.ContentCompiler.GUI.Dialogues
{ {
[Developer("SilentWarrior/Eagle Eye Studios")]
[PercentageComplete(100)]
[TestState(TestStateAttribute.TestState.Tested)]
public partial class ErrorLogScreen : Form public partial class ErrorLogScreen : Form
{ {
public ErrorLogScreen(string[] errorLog) public ErrorLogScreen(string[] errorLog)

View File

@ -1,7 +1,11 @@
using System.Windows.Forms; using System.Windows.Forms;
using ANX.Framework.NonXNA.Development;
namespace ANX.ContentCompiler.GUI.Dialogues 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 partial class FirstStartScreen : Form
{ {
public FirstStartScreen() public FirstStartScreen()

View File

@ -1,9 +1,12 @@
using System; using System;
using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using ANX.Framework.NonXNA.Development;
namespace ANX.ContentCompiler.GUI.Dialogues namespace ANX.ContentCompiler.GUI.Dialogues
{ {
[Developer("SilentWarrior/Eagle Eye Studios")]
[PercentageComplete(100)]
[TestState(TestStateAttribute.TestState.Tested)]
public partial class NewFolderScreen : Form public partial class NewFolderScreen : Form
{ {
public NewFolderScreen() public NewFolderScreen()
@ -32,7 +35,8 @@ namespace ANX.ContentCompiler.GUI.Dialogues
private void ButtonNextClick(object sender, EventArgs e) private void ButtonNextClick(object sender, EventArgs e)
{ {
if (String.IsNullOrEmpty(textBoxName.Text)) 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 else
DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
} }

View File

@ -1,8 +1,12 @@
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using ANX.Framework.NonXNA.Development;
namespace ANX.ContentCompiler.GUI.Dialogues namespace ANX.ContentCompiler.GUI.Dialogues
{ {
[Developer("SilentWarrior/Eagle Eye Studios")]
[PercentageComplete(100)]
[TestState(TestStateAttribute.TestState.InProgress)]
public partial class NewProjectImportersScreen : Form public partial class NewProjectImportersScreen : Form
{ {
public NewProjectImportersScreen() public NewProjectImportersScreen()

View File

@ -1,8 +1,12 @@
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using ANX.Framework.NonXNA.Development;
namespace ANX.ContentCompiler.GUI.Dialogues namespace ANX.ContentCompiler.GUI.Dialogues
{ {
[Developer("SilentWarrior/Eagle Eye Studios")]
[PercentageComplete(100)]
[TestState(TestStateAttribute.TestState.InProgress)]
public partial class NewProjectOutputScreen : Form public partial class NewProjectOutputScreen : Form
{ {
public NewProjectOutputScreen() public NewProjectOutputScreen()

View File

@ -1,9 +1,13 @@
using System; using System;
using System.IO; using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using ANX.Framework.NonXNA.Development;
namespace ANX.ContentCompiler.GUI.Dialogues namespace ANX.ContentCompiler.GUI.Dialogues
{ {
[Developer("SilentWarrior/Eagle Eye Studios")]
[PercentageComplete(100)]
[TestState(TestStateAttribute.TestState.Tested)]
public partial class NewProjectScreen : Form public partial class NewProjectScreen : Form
{ {
public NewProjectScreen() public NewProjectScreen()
@ -60,7 +64,8 @@ namespace ANX.ContentCompiler.GUI.Dialogues
if (String.IsNullOrEmpty(textBoxName.Text)) if (String.IsNullOrEmpty(textBoxName.Text))
MessageBox.Show("Give your child a name!", "Missing value", MessageBoxButtons.OK, MessageBoxIcon.Warning); MessageBox.Show("Give your child a name!", "Missing value", MessageBoxButtons.OK, MessageBoxIcon.Warning);
else if (Directory.Exists(textBoxLocation.Text)) 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 else
DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
} }

View File

@ -1,30 +1,35 @@
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using ANX.Framework.NonXNA.Development;
namespace ANX.ContentCompiler.GUI.Dialogues namespace ANX.ContentCompiler.GUI.Dialogues
{ {
[Developer("SilentWarrior/Eagle Eye Studios")]
[PercentageComplete(100)]
[TestState(TestStateAttribute.TestState.InProgress)]
public partial class NewProjectSummaryScreen : Form 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(); InitializeComponent();
SetUpColors(); SetUpColors();
textBox.Text = textBox.Text =
"Summary for new project " + projectName + Environment.NewLine + "Summary for new project " + projectName + Environment.NewLine +
"=========================================" + Environment.NewLine + "=========================================" + Environment.NewLine +
"Name: " + projectName + Environment.NewLine + "Name: " + projectName + Environment.NewLine +
"Media Directory: " + projectDir + Environment.NewLine + Environment.NewLine + "Media Directory: " + projectDir + Environment.NewLine + Environment.NewLine +
"Output Directory: " + outputDir + Environment.NewLine + Environment.NewLine + "Output Directory: " + outputDir + Environment.NewLine + Environment.NewLine +
"Custom Importers/Processors: " + customImporters + Environment.NewLine; "Custom Importers/Processors: " + customImporters + Environment.NewLine;
if (customImporters) if (customImporters)
{ {
textBox.Text += textBox.Text +=
"Custom Importers/Processors Location: " + customImportersDir + Environment.NewLine + Environment.NewLine + "Custom Importers/Processors Location: " + customImportersDir + Environment.NewLine +
"Importers/Processors found in given Location:" + Environment.NewLine + Environment.NewLine +
"Importers/Processors found in given Location:" + Environment.NewLine +
"Importers: " + customImportersFound + Environment.NewLine + "Importers: " + customImportersFound + Environment.NewLine +
"Processors: " + customProcessorsFound; "Processors: " + customProcessorsFound;
} }
} }
private void SetUpColors() private void SetUpColors()

View File

@ -1,9 +1,12 @@
using System; using System;
using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using ANX.Framework.NonXNA.Development;
namespace ANX.ContentCompiler.GUI.Dialogues namespace ANX.ContentCompiler.GUI.Dialogues
{ {
[Developer("SilentWarrior/Eagle Eye Studios")]
[PercentageComplete(100)]
[TestState(TestStateAttribute.TestState.Tested)]
public partial class OpenProjectScreen : Form public partial class OpenProjectScreen : Form
{ {
public OpenProjectScreen() public OpenProjectScreen()
@ -11,7 +14,7 @@ namespace ANX.ContentCompiler.GUI.Dialogues
InitializeComponent(); InitializeComponent();
SetUpColors(); SetUpColors();
listBoxRecentProjects.Items.Clear(); listBoxRecentProjects.Items.Clear();
foreach(var project in MainWindow.Instance.RecentProjects) foreach (string project in MainWindow.Instance.RecentProjects)
{ {
listBoxRecentProjects.Items.Add(project); listBoxRecentProjects.Items.Add(project);
} }
@ -57,7 +60,8 @@ namespace ANX.ContentCompiler.GUI.Dialogues
private void ButtonNextClick(object sender, EventArgs e) private void ButtonNextClick(object sender, EventArgs e)
{ {
if (String.IsNullOrEmpty(textBoxLocation.Text) && listBoxRecentProjects.SelectedItem == null) 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 else
DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
} }

View File

@ -1,4 +1,5 @@
using ANX.ContentCompiler.GUI.States; using ANX.ContentCompiler.GUI.States;
using ANX.Framework.NonXNA.Development;
namespace ANX.ContentCompiler.GUI namespace ANX.ContentCompiler.GUI
{ {
@ -32,13 +33,6 @@ namespace ANX.ContentCompiler.GUI
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
this.splitContainerMenuLayout = new System.Windows.Forms.SplitContainer(); 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.buttonQuit = new System.Windows.Forms.Button();
this.buttonMenu = new System.Windows.Forms.Button(); this.buttonMenu = new System.Windows.Forms.Button();
this.labelTitle = new System.Windows.Forms.Label(); this.labelTitle = new System.Windows.Forms.Label();
@ -50,11 +44,18 @@ namespace ANX.ContentCompiler.GUI
this.treeViewItemRename = new System.Windows.Forms.ToolStripMenuItem(); this.treeViewItemRename = new System.Windows.Forms.ToolStripMenuItem();
this.treeViewItemDelete = new System.Windows.Forms.ToolStripMenuItem(); this.treeViewItemDelete = new System.Windows.Forms.ToolStripMenuItem();
this.splitContainerProperties = new System.Windows.Forms.SplitContainer(); 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.labelProperties = new System.Windows.Forms.Label();
this.propertyGrid = new System.Windows.Forms.PropertyGrid(); this.propertyGrid = new System.Windows.Forms.PropertyGrid();
this.menuState = new ANX.ContentCompiler.GUI.States.MenuState(); 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(); ((System.ComponentModel.ISupportInitialize)(this.splitContainerMenuLayout)).BeginInit();
this.splitContainerMenuLayout.Panel1.SuspendLayout(); this.splitContainerMenuLayout.Panel1.SuspendLayout();
this.splitContainerMenuLayout.Panel2.SuspendLayout(); this.splitContainerMenuLayout.Panel2.SuspendLayout();
@ -100,79 +101,6 @@ namespace ANX.ContentCompiler.GUI
this.splitContainerMenuLayout.SplitterDistance = 99; this.splitContainerMenuLayout.SplitterDistance = 99;
this.splitContainerMenuLayout.TabIndex = 0; 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 // buttonQuit
// //
this.buttonQuit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 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.SplitterDistance = 366;
this.splitContainerProperties.TabIndex = 0; 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 // labelProperties
// //
this.labelProperties.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 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.TabIndex = 1;
this.menuState.Visible = false; 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 // MainWindow
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

View File

@ -1,31 +1,39 @@
using System; using System;
using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Threading;
using System.Windows.Forms; using System.Windows.Forms;
using ANX.ContentCompiler.GUI.Dialogues; using ANX.ContentCompiler.GUI.Dialogues;
using ANX.Framework.Content.Pipeline; using ANX.Framework.Content.Pipeline;
using ANX.Framework.Content.Pipeline.Tasks; using ANX.Framework.Content.Pipeline.Tasks;
using ANX.Framework.NonXNA.Development;
namespace ANX.ContentCompiler.GUI 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 public partial class MainWindow : Form
{ {
#region Fields #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; public static String DefaultOutputPath = "bin";
private bool _mouseDown;
private bool _menuMode; public static String SettingsFile =
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
"ANX Content Compiler" + Path.DirectorySeparatorChar + "settings.ees");
private readonly bool _firstStart = true; private readonly bool _firstStart = true;
private ContentProject _contentProject; private ContentProject _contentProject;
private Point _lastPos;
private bool _menuMode;
private bool _mouseDown;
#endregion #endregion
#region Properties #region Properties
public static MainWindow Instance { get; private set; } public static MainWindow Instance { get; private set; }
public String ProjectName { get; set; } public String ProjectName { get; set; }
@ -34,10 +42,12 @@ namespace ANX.ContentCompiler.GUI
public String ProjectOutputDir { get; set; } public String ProjectOutputDir { get; set; }
public String ProjectImportersDir { get; set; } public String ProjectImportersDir { get; set; }
public RecentProjects RecentProjects { get; set; } public RecentProjects RecentProjects { get; set; }
#endregion #endregion
#region Init #region Init
public MainWindow()
public MainWindow(string[] args)
{ {
InitializeComponent(); InitializeComponent();
Instance = this; Instance = this;
@ -67,9 +77,11 @@ namespace ANX.ContentCompiler.GUI
ShowFirstStartStuff(); ShowFirstStartStuff();
ChangeEnvironmentStartState(); ChangeEnvironmentStartState();
} }
#endregion #endregion
#region NewProject #region NewProject
public void NewProject(object sender, EventArgs e) public void NewProject(object sender, EventArgs e)
{ {
using (var dlg = new NewProjectScreen()) using (var dlg = new NewProjectScreen())
@ -77,7 +89,9 @@ namespace ANX.ContentCompiler.GUI
if (dlg.ShowDialog() == DialogResult.OK) if (dlg.ShowDialog() == DialogResult.OK)
{ {
ProjectName = dlg.textBoxName.Text; 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"); ProjectPath = Path.Combine(ProjectFolder, ProjectName + ".cproj");
} }
else else
@ -89,7 +103,9 @@ namespace ANX.ContentCompiler.GUI
{ {
if (dlg2.ShowDialog() == DialogResult.OK) 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 else
return; return;
@ -101,11 +117,13 @@ namespace ANX.ContentCompiler.GUI
else else
return; return;
} }
var importersEnabled = !String.IsNullOrEmpty(ProjectImportersDir); bool importersEnabled = !String.IsNullOrEmpty(ProjectImportersDir);
var importers = 0; int importers = 0;
var processors = 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(); dlg4.ShowDialog();
} }
@ -120,9 +138,11 @@ namespace ANX.ContentCompiler.GUI
}; };
ChangeEnvironmentOpenProject(); ChangeEnvironmentOpenProject();
} }
#endregion #endregion
#region OpenProject #region OpenProject
public void OpenProjectDialog(object sender, EventArgs e) public void OpenProjectDialog(object sender, EventArgs e)
{ {
using (var dlg = new OpenProjectScreen()) using (var dlg = new OpenProjectScreen())
@ -132,9 +152,10 @@ namespace ANX.ContentCompiler.GUI
if (dlg.listBoxRecentProjects.SelectedItem == null) if (dlg.listBoxRecentProjects.SelectedItem == null)
OpenProject(dlg.textBoxLocation.Text); OpenProject(dlg.textBoxLocation.Text);
else else
OpenProject((string)dlg.listBoxRecentProjects.SelectedItem); OpenProject((string) dlg.listBoxRecentProjects.SelectedItem);
} }
} }
public void OpenProject(string path) public void OpenProject(string path)
{ {
if (!File.Exists(path)) if (!File.Exists(path))
@ -152,9 +173,11 @@ namespace ANX.ContentCompiler.GUI
_contentProject.Creator = "ANX Content Compiler (4.0)"; _contentProject.Creator = "ANX Content Compiler (4.0)";
ChangeEnvironmentOpenProject(); ChangeEnvironmentOpenProject();
} }
#endregion #endregion
#region SaveProject #region SaveProject
public void SaveProject(object sender, EventArgs e) public void SaveProject(object sender, EventArgs e)
{ {
if (_contentProject == null) return; if (_contentProject == null) return;
@ -166,9 +189,11 @@ namespace ANX.ContentCompiler.GUI
RecentProjects.Remove(ProjectPath); RecentProjects.Remove(ProjectPath);
RecentProjects.Add(ProjectPath); RecentProjects.Add(ProjectPath);
} }
#endregion #endregion
#region SaveProjectAs #region SaveProjectAs
public void SaveProjectAs(object sender, EventArgs e) public void SaveProjectAs(object sender, EventArgs e)
{ {
using (var dlg = new SaveFileDialog()) 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 #endregion
#region BuildProject #region BuildProject
public void BuildProject(object sender, EventArgs e) public void BuildProject(object sender, EventArgs e)
{ {
DisableUI(); DisableUI();
BuildContent builderTask = new BuildContent(); var builderTask = new BuildContent
builderTask.BuildLogger = new CCompilerBuildLogger(); {
builderTask.OutputDirectory = _contentProject.OutputDirectory; BuildLogger = new CCompilerBuildLogger(),
builderTask.TargetPlatform = _contentProject.Platform; OutputDirectory = _contentProject.OutputDirectory,
builderTask.TargetProfile = _contentProject.Profile; TargetPlatform = _contentProject.Platform,
builderTask.CompressContent = false; TargetProfile = _contentProject.Profile,
CompressContent = false
};
try 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); 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();
} }
EnableUI(); EnableUI();
@ -232,35 +274,52 @@ namespace ANX.ContentCompiler.GUI
ribbonButtonLoad.Enabled = true; ribbonButtonLoad.Enabled = true;
ribbonButtonClean.Enabled = true; ribbonButtonClean.Enabled = true;
} }
#endregion #endregion
#region FileMethods #region FileMethods
/// <summary>
/// Adds a file to the project
/// </summary>
/// <param name="file">the file to add</param>
private void AddFile(string file) private void AddFile(string file)
{ {
if (!File.Exists(file)) if (!File.Exists(file))
throw new FileNotFoundException(); throw new FileNotFoundException();
var folder = _contentProject.ContentRoot; string folder = _contentProject.ContentRoot;
var node = treeView.SelectedNode; TreeNode node = treeView.SelectedNode;
if (node != null) if (node != null)
folder = node.Name; 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))) if (!Directory.Exists(Path.Combine(ProjectFolder, folder)))
Directory.CreateDirectory(Path.Combine(ProjectFolder, folder)); Directory.CreateDirectory(Path.Combine(ProjectFolder, folder));
File.Copy(file, absPath, true); File.Copy(file, absPath, true);
var item = new BuildItem 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, SourceFilename = absPath,
OutputFilename = ProjectOutputDir + Path.DirectorySeparatorChar + folder + Path.DirectorySeparatorChar + Path.GetFileName(file), OutputFilename =
ImporterName = ImporterManager.GuessImporterByFileExtension(file) 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); _contentProject.BuildItems.Add(item);
} }
/// <summary>
/// Wrapper for adding moar files! (Just a foreach loop, nothing special)
/// </summary>
/// <param name="files">files to add</param>
public void AddFiles(string[] files) public void AddFiles(string[] files)
{ {
foreach (var file in files) foreach (string file in files)
{ {
AddFile(file); AddFile(file);
} }
@ -270,34 +329,35 @@ namespace ANX.ContentCompiler.GUI
public void AddFolder(string name) public void AddFolder(string name)
{ {
string folder = _contentProject.ContentRoot; string folder = _contentProject.ContentRoot;
var node = treeView.SelectedNode; TreeNode node = treeView.SelectedNode;
if (node != null) if (node != null)
folder = node.Name; folder = node.Name;
else else
node = treeView.Nodes[0]; 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); node.Nodes.Add(newFolder);
} }
public void RemoveFile(string name) public void RemoveFile(string name)
{ {
} }
public void RemoveFiles(string[] files) public void RemoveFiles(string[] files)
{ {
} }
public void RemoveFolder(string name) public void RemoveFolder(string name)
{ {
} }
#endregion #endregion
#region EnvironmentStates #region EnvironmentStates
/// <summary>
/// Changes the current editor state to the "No project open" state
/// </summary>
public void ChangeEnvironmentStartState() public void ChangeEnvironmentStartState()
{ {
editingState.Visible = false; editingState.Visible = false;
@ -308,6 +368,9 @@ namespace ANX.ContentCompiler.GUI
propertyGrid.SelectedObject = null; propertyGrid.SelectedObject = null;
} }
/// <summary>
/// Changes the current editor state to edit mode
/// </summary>
public void ChangeEnvironmentOpenProject() public void ChangeEnvironmentOpenProject()
{ {
startState.Visible = false; startState.Visible = false;
@ -317,40 +380,47 @@ namespace ANX.ContentCompiler.GUI
ProjectFolder = _contentProject.InputDirectory; ProjectFolder = _contentProject.InputDirectory;
treeView.Nodes.Clear(); 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); treeView.Nodes.Add(rootNode);
var lastNode = rootNode; TreeNode lastNode = rootNode;
foreach (var parts in _contentProject.BuildItems.Select(buildItem => buildItem.AssetName.Split(Path.DirectorySeparatorChar)).Where(parts => parts.Length >= 2)) //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 folder = "";
string parent = _contentProject.ContentRoot; 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 (parts[i] == null) continue;
if (i > 0) if (i > 0) //if there is already a path we need to add the new part with a SeperatorChar!
folder += Path.DirectorySeparatorChar + parts[i]; folder += Path.DirectorySeparatorChar + parts[i];
else 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]; parent += Path.DirectorySeparatorChar + parts[i];
//else if (parts.Length == 2) //else if (parts.Length == 2)
// parent += Path.DirectorySeparatorChar + parts[0]; // parent += Path.DirectorySeparatorChar + parts[0];
} }
lastNode = treeView.RecursiveSearch(parent); 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 }; 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)) 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; 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("\\")) if (buildItem.AssetName.Contains("\\"))
parts = buildItem.AssetName.Split('\\'); parts = buildItem.AssetName.Split('\\');
else if (buildItem.AssetName.Contains("/")) else if (buildItem.AssetName.Contains("/"))
@ -362,8 +432,9 @@ namespace ANX.ContentCompiler.GUI
lastNode = lastNode.Nodes[parts[i]]; lastNode = lastNode.Nodes[parts[i]];
} }
}*/ }*/
//Add the actual files to the tree in their apropriate subdirs
string path = _contentProject.ContentRoot; string path = _contentProject.ContentRoot;
if (parts != null) if (parts != null)
{ {
for (int i = 0; i < parts.Length - 1; i++) for (int i = 0; i < parts.Length - 1; i++)
{ {
@ -372,39 +443,56 @@ namespace ANX.ContentCompiler.GUI
} }
if (parts != null) if (parts != null)
{ {
var node = treeView.RecursiveSearch(path); TreeNode node = treeView.RecursiveSearch(path);
if (node == null) throw new ArgumentNullException("Node not found!"); if (node == null) throw new ArgumentNullException("Node not found!");
var item = new TreeNode(parts[parts.Length - 1]) {Name = buildItem.AssetName}; var item = new TreeNode(parts[parts.Length - 1]) {Name = buildItem.AssetName};
node.Nodes.Add(item); 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}; var item = new TreeNode(buildItem.AssetName) {Name = buildItem.AssetName};
treeView.Nodes[0].Nodes.Add(item); treeView.Nodes[0].Nodes.Add(item);
} }
} }
} }
} }
#endregion #endregion
#region ButtonHandlers #region ButtonHandlers
private void ButtonQuitClick(object sender, EventArgs e) private void ButtonQuitClick(object sender, EventArgs e)
{ {
Application.Exit(); Application.Exit();
} }
private void ButtonMenuClick(object sender, EventArgs e) private void ButtonMenuClick(object sender, EventArgs e)
{ {
ToggleMenuMode(); 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 #endregion
#region WindowMoveMethods #region WindowMoveMethods
private void LabelTitleMouseMove(object sender, MouseEventArgs e) private void LabelTitleMouseMove(object sender, MouseEventArgs e)
{ {
if (!_mouseDown) return; if (!_mouseDown) return;
var xoffset = MousePosition.X - _lastPos.X; int xoffset = MousePosition.X - _lastPos.X;
var yoffset = MousePosition.Y - _lastPos.Y; int yoffset = MousePosition.Y - _lastPos.Y;
Left += xoffset; Left += xoffset;
Top += yoffset; Top += yoffset;
_lastPos = MousePosition; _lastPos = MousePosition;
@ -420,21 +508,25 @@ namespace ANX.ContentCompiler.GUI
{ {
_mouseDown = false; _mouseDown = false;
} }
#endregion #endregion
#region TreeVieItemDesignMethods #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 #endregion
#region MenuMethods #region MenuMethods
public void ToggleMenuMode() public void ToggleMenuMode()
{ {
_menuMode = !_menuMode; _menuMode = !_menuMode;
@ -453,19 +545,21 @@ namespace ANX.ContentCompiler.GUI
#endregion #endregion
#region ShowFirstStartStuff #region ShowFirstStartStuff
private void ShowFirstStartStuff() private void ShowFirstStartStuff()
{ {
using (var dlg = new FirstStartScreen()) using (var dlg = new FirstStartScreen())
{ {
if (dlg.ShowDialog() == DialogResult.OK) if (dlg.ShowDialog() == DialogResult.OK)
{ {
} }
} }
} }
#endregion #endregion
#region SetUpColors #region SetUpColors
private void SetUpColors() private void SetUpColors()
{ {
BackColor = Settings.MainColor; BackColor = Settings.MainColor;
@ -486,9 +580,11 @@ namespace ANX.ContentCompiler.GUI
propertyGrid.ViewBackColor = Settings.DarkMainColor; propertyGrid.ViewBackColor = Settings.DarkMainColor;
propertyGrid.ViewForeColor = Settings.ForeColor; propertyGrid.ViewForeColor = Settings.ForeColor;
} }
#endregion #endregion
#region Exit #region Exit
private void MainWindowFormClosed(object sender, FormClosedEventArgs e) private void MainWindowFormClosed(object sender, FormClosedEventArgs e)
{ {
Settings.Save(SettingsFile); Settings.Save(SettingsFile);
@ -497,18 +593,22 @@ namespace ANX.ContentCompiler.GUI
private void MainWindowFormClosing(object sender, FormClosingEventArgs e) private void MainWindowFormClosing(object sender, FormClosingEventArgs e)
{ {
} }
#endregion #endregion
#region TreeViewEvents #region TreeViewEvents
private void TreeViewAfterSelect(object sender, TreeViewEventArgs e) private void TreeViewAfterSelect(object sender, TreeViewEventArgs e)
{ {
if (treeView.SelectedNode == treeView.TopNode) if (treeView.SelectedNode == treeView.TopNode)
propertyGrid.SelectedObject = _contentProject; propertyGrid.SelectedObject = _contentProject;
else 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; propertyGrid.SelectedObject = buildItem;
} }
@ -523,6 +623,7 @@ namespace ANX.ContentCompiler.GUI
#endregion #endregion
#region PropertyGridEvents #region PropertyGridEvents
private void PropertyGridPropertyValueChanged(object s, PropertyValueChangedEventArgs e) private void PropertyGridPropertyValueChanged(object s, PropertyValueChangedEventArgs e)
{ {
ProjectName = _contentProject.Name; ProjectName = _contentProject.Name;
@ -533,12 +634,14 @@ namespace ANX.ContentCompiler.GUI
{ {
foreach (BuildItem buildItem in _contentProject.BuildItems) 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(); ChangeEnvironmentOpenProject();
} }
#endregion #endregion
} }
} }

View File

@ -1,123 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="treeViewContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>16, 30</value>
</metadata>
</root>

View File

@ -1,19 +1,23 @@
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using ANX.Framework.NonXNA.Development;
namespace ANX.ContentCompiler.GUI namespace ANX.ContentCompiler.GUI
{ {
[Developer("SilentWarrior/Eagle Eye Studios")]
[PercentageComplete(100)]
[TestState(TestStateAttribute.TestState.Tested)]
internal static class Program internal static class Program
{ {
/// <summary> /// <summary>
/// Der Haupteinstiegspunkt für die Anwendung. /// Der Haupteinstiegspunkt für die Anwendung.
/// </summary> /// </summary>
[STAThread] [STAThread]
private static void Main() private static void Main(string[] args)
{ {
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainWindow()); Application.Run(new MainWindow(args));
} }
} }
} }

View File

@ -2,18 +2,23 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using System.Xml; using System.Xml;
using ANX.Framework.NonXNA.Development;
namespace ANX.ContentCompiler.GUI namespace ANX.ContentCompiler.GUI
{ {
[Developer("SilentWarrior/Eagle Eye Studios")]
[PercentageComplete(100)]
[TestState(TestStateAttribute.TestState.Tested)]
public class RecentProjects : List<String> public class RecentProjects : List<String>
{ {
private static readonly string Path = 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() public RecentProjects()
: base(10) : base(10)
{ {
} }
public void Save() public void Save()

View File

@ -4,9 +4,13 @@ using System.Drawing;
using System.IO; using System.IO;
using System.Text; using System.Text;
using System.Xml; using System.Xml;
using ANX.Framework.NonXNA.Development;
namespace ANX.ContentCompiler.GUI namespace ANX.ContentCompiler.GUI
{ {
[Developer("SilentWarrior/Eagle Eye Studios")]
[PercentageComplete(90)]
[TestState(TestStateAttribute.TestState.Tested)]
public static class Settings public static class Settings
{ {
public static String DefaultProjectPath { get; set; } public static String DefaultProjectPath { get; set; }
@ -17,12 +21,13 @@ namespace ANX.ContentCompiler.GUI
public static Color AccentColor { get; set; } public static Color AccentColor { get; set; }
public static Color AccentColor2 { get; set; } public static Color AccentColor2 { get; set; }
public static Color AccentColor3 { get; set; } public static Color AccentColor3 { get; set; }
public static List<String> RecentProjects { get; set; } public static List<String> RecentProjects { get; set; }
public static void Defaults() public static void Defaults()
{ {
DefaultProjectPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), 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<string>(); RecentProjects = new List<string>();
MainColor = Color.FromArgb(64, 64, 64); MainColor = Color.FromArgb(64, 64, 64);
//MainColor = Color.Goldenrod; //MainColor = Color.Goldenrod;
@ -32,7 +37,7 @@ namespace ANX.ContentCompiler.GUI
//LightMainColor = Color.Gold; //LightMainColor = Color.Gold;
ForeColor = Color.White; ForeColor = Color.White;
//ForeColor = Color.DarkRed; //ForeColor = Color.DarkRed;
AccentColor = Color.FromArgb(0, 192, 0); AccentColor = Color.FromArgb(0, 192, 0);
//AccentColor = Color.HotPink; //AccentColor = Color.HotPink;
AccentColor2 = Color.LimeGreen; AccentColor2 = Color.LimeGreen;
//AccentColor2 = Color.IndianRed; //AccentColor2 = Color.IndianRed;
@ -42,7 +47,8 @@ namespace ANX.ContentCompiler.GUI
public static void Load(string path) public static void Load(string path)
{ {
DefaultProjectPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), 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<string>(); RecentProjects = new List<string>();
if (!File.Exists(path)) return; if (!File.Exists(path)) return;
XmlReader reader = new XmlTextReader(path); XmlReader reader = new XmlTextReader(path);
@ -95,7 +101,13 @@ namespace ANX.ContentCompiler.GUI
if (!Directory.Exists(Path.GetDirectoryName(path))) if (!Directory.Exists(Path.GetDirectoryName(path)))
Directory.CreateDirectory(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.WriteStartDocument();
writer.WriteStartElement("CCompiler4Settings"); writer.WriteStartElement("CCompiler4Settings");
writer.WriteStartElement("MainColor"); writer.WriteStartElement("MainColor");
@ -120,7 +132,7 @@ namespace ANX.ContentCompiler.GUI
writer.WriteValue(GetStringFromColor(AccentColor3)); writer.WriteValue(GetStringFromColor(AccentColor3));
writer.WriteFullEndElement(); writer.WriteFullEndElement();
writer.WriteStartElement("RecentProjects"); writer.WriteStartElement("RecentProjects");
foreach (var recentProject in RecentProjects) foreach (string recentProject in RecentProjects)
{ {
writer.WriteStartElement("Path"); writer.WriteStartElement("Path");
writer.WriteString(recentProject); writer.WriteString(recentProject);
@ -140,8 +152,8 @@ namespace ANX.ContentCompiler.GUI
private static Color GetColorFromString(string xml) 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])); return Color.FromArgb(Convert.ToInt32(s[0]), Convert.ToInt32(s[1]), Convert.ToInt32(s[2]));
} }
} }
} }

View File

@ -1,9 +1,13 @@
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using ANX.ContentCompiler.GUI.Dialogues; using ANX.ContentCompiler.GUI.Dialogues;
using ANX.Framework.NonXNA.Development;
namespace ANX.ContentCompiler.GUI.States 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 partial class EditingState : UserControl
{ {
public EditingState() public EditingState()
@ -43,6 +47,5 @@ namespace ANX.ContentCompiler.GUI.States
{ {
MainWindow.Instance.BuildProject(sender, e); MainWindow.Instance.BuildProject(sender, e);
} }
} }
} }

View File

@ -1,15 +1,13 @@
using System; 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 System.Windows.Forms;
using ANX.ContentCompiler.GUI.Dialogues; using ANX.ContentCompiler.GUI.Dialogues;
using ANX.Framework.NonXNA.Development;
namespace ANX.ContentCompiler.GUI.States 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 partial class MenuState : UserControl
{ {
public MenuState() public MenuState()
@ -18,6 +16,7 @@ namespace ANX.ContentCompiler.GUI.States
} }
#region HelperMethods #region HelperMethods
private void SetUpColors() private void SetUpColors()
{ {
BackColor = Settings.MainColor; BackColor = Settings.MainColor;
@ -60,15 +59,18 @@ namespace ANX.ContentCompiler.GUI.States
panelSaveAs.Visible = false; panelSaveAs.Visible = false;
panelSettings.Visible = false; panelSettings.Visible = false;
} }
#endregion #endregion
#region MenuButtons #region MenuButtons
private void ButtonNewClick(object sender, EventArgs e) private void ButtonNewClick(object sender, EventArgs e)
{ {
ResetMenuState(); ResetMenuState();
buttonNew.BackColor = Settings.AccentColor; buttonNew.BackColor = Settings.AccentColor;
panelNew.Visible = true; panelNew.Visible = true;
} }
private void ButtonOpenClick(object sender, EventArgs e) private void ButtonOpenClick(object sender, EventArgs e)
{ {
ResetMenuState(); ResetMenuState();
@ -108,9 +110,11 @@ namespace ANX.ContentCompiler.GUI.States
ResetMenuState(); ResetMenuState();
Application.Exit(); Application.Exit();
} }
#endregion #endregion
#region MenuNew #region MenuNew
private void ArrowButtonFileClick(object sender, EventArgs e) private void ArrowButtonFileClick(object sender, EventArgs e)
{ {
using (var dlg = new OpenFileDialog()) using (var dlg = new OpenFileDialog())
@ -139,9 +143,11 @@ namespace ANX.ContentCompiler.GUI.States
{ {
MainWindow.Instance.NewProject(sender, e); MainWindow.Instance.NewProject(sender, e);
} }
#endregion #endregion
#region MenuOpen #region MenuOpen
private void ArrowButtonOpenClick(object sender, EventArgs e) private void ArrowButtonOpenClick(object sender, EventArgs e)
{ {
MainWindow.Instance.OpenProjectDialog(sender, e); MainWindow.Instance.OpenProjectDialog(sender, e);
@ -153,9 +159,11 @@ namespace ANX.ContentCompiler.GUI.States
MainWindow.Instance.OpenProjectDialog(sender, e); MainWindow.Instance.OpenProjectDialog(sender, e);
MainWindow.Instance.ToggleMenuMode(); MainWindow.Instance.ToggleMenuMode();
} }
#endregion #endregion
#region MenuSave #region MenuSave
private void ArrowButtonSaveAsCprojClick(object sender, EventArgs e) private void ArrowButtonSaveAsCprojClick(object sender, EventArgs e)
{ {
MainWindow.Instance.SaveProjectAs(sender, e); MainWindow.Instance.SaveProjectAs(sender, e);
@ -167,8 +175,10 @@ namespace ANX.ContentCompiler.GUI.States
MainWindow.Instance.SaveProjectAs(sender, e); MainWindow.Instance.SaveProjectAs(sender, e);
MainWindow.Instance.ToggleMenuMode(); MainWindow.Instance.ToggleMenuMode();
} }
#endregion #endregion
#region Load
private void MenuState_Load(object sender, EventArgs e) private void MenuState_Load(object sender, EventArgs e)
{ {
SetUpColors(); SetUpColors();
@ -176,5 +186,6 @@ namespace ANX.ContentCompiler.GUI.States
buttonNew.BackColor = Settings.AccentColor; buttonNew.BackColor = Settings.AccentColor;
panelNew.Visible = true; panelNew.Visible = true;
} }
#endregion
} }
} }

View File

@ -1,7 +1,12 @@
using System.Windows.Forms; using System;
using System.Windows.Forms;
using ANX.Framework.NonXNA.Development;
namespace ANX.ContentCompiler.GUI.States namespace ANX.ContentCompiler.GUI.States
{ {
[Developer("SilentWarrior/Eagle Eye Studios")]
[PercentageComplete(100)]
[TestState(TestStateAttribute.TestState.Tested)]
public partial class StartState : UserControl public partial class StartState : UserControl
{ {
public StartState() public StartState()
@ -15,17 +20,17 @@ namespace ANX.ContentCompiler.GUI.States
ForeColor = Settings.ForeColor; ForeColor = Settings.ForeColor;
} }
private void StartStateLoad(object sender, System.EventArgs e) private void StartStateLoad(object sender, EventArgs e)
{ {
SetUpColor(); SetUpColor();
} }
private void ArrowButtonNewClick(object sender, System.EventArgs e) private void ArrowButtonNewClick(object sender, EventArgs e)
{ {
MainWindow.Instance.NewProject(sender, 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); MainWindow.Instance.OpenProjectDialog(sender, e);
} }

View File

@ -1,8 +1,12 @@
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using ANX.Framework.NonXNA.Development;
namespace ANX.ContentCompiler.GUI namespace ANX.ContentCompiler.GUI
{ {
[Developer("SilentWarrior/Eagle Eye Studios")]
[PercentageComplete(100)]
[TestState(TestStateAttribute.TestState.Tested)]
public static class TreeViewExtensions public static class TreeViewExtensions
{ {
/// <summary> /// <summary>
@ -18,7 +22,7 @@ namespace ANX.ContentCompiler.GUI
if (treeNode.Name.Equals(name)) if (treeNode.Name.Equals(name))
return treeNode; return treeNode;
var retNode = treeNode.RecursiveSearch(name); TreeNode retNode = treeNode.RecursiveSearch(name);
if (retNode != null) if (retNode != null)
{ {
return retNode; return retNode;
@ -40,7 +44,7 @@ namespace ANX.ContentCompiler.GUI
if (node.Name.Equals(name)) if (node.Name.Equals(name))
return node; return node;
var ret = node.RecursiveSearch(name); TreeNode ret = node.RecursiveSearch(name);
if (ret != null) if (ret != null)
return ret; return ret;
} }
@ -63,4 +67,4 @@ namespace ANX.ContentCompiler.GUI
} }
} }
} }
} }