Content Compiler:
- Added missing FakeBuildLogger.cs - changed the preview implementation to support previewing while working in the main window (handy for multiple screens!) - Did some cleaning and added #region tags and copyright text
This commit is contained in:
parent
93c729e31f
commit
01cac2c358
@ -1,6 +1,13 @@
|
||||
using System;
|
||||
#region Using Statements
|
||||
using System;
|
||||
using ANX.Framework.Content.Pipeline;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
#endregion
|
||||
|
||||
// This file is part of the EES Content Compiler 4,
|
||||
// © 2008 - 2012 by Eagle Eye Studios.
|
||||
// The EES Content Compiler 4 is released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.ContentCompiler.GUI
|
||||
{
|
||||
|
@ -1,7 +1,14 @@
|
||||
using System;
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
#endregion
|
||||
|
||||
// This file is part of the EES Content Compiler 4,
|
||||
// © 2008 - 2012 by Eagle Eye Studios.
|
||||
// The EES Content Compiler 4 is released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.ContentCompiler.GUI.Controls
|
||||
{
|
||||
@ -15,13 +22,16 @@ namespace ANX.ContentCompiler.GUI.Controls
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
#region Properties
|
||||
[EditorBrowsable(EditorBrowsableState.Always)]
|
||||
public String Content
|
||||
{
|
||||
get { return labelText.Text; }
|
||||
set { labelText.Text = value; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Private
|
||||
private void ArrowButtonMouseEnter(object sender, EventArgs e)
|
||||
{
|
||||
BorderStyle = BorderStyle.FixedSingle;
|
||||
@ -62,5 +72,6 @@ namespace ANX.ContentCompiler.GUI.Controls
|
||||
BackColor = Settings.MainColor;
|
||||
ForeColor = Settings.ForeColor;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,8 +1,15 @@
|
||||
using System;
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
#endregion
|
||||
|
||||
// This file is part of the EES Content Compiler 4,
|
||||
// © 2008 - 2012 by Eagle Eye Studios.
|
||||
// The EES Content Compiler 4 is released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.ContentCompiler.GUI.Controls
|
||||
{
|
||||
@ -11,25 +18,31 @@ namespace ANX.ContentCompiler.GUI.Controls
|
||||
[TestState(TestStateAttribute.TestState.Tested)]
|
||||
public partial class RibbonButton : UserControl
|
||||
{
|
||||
#region Constructor
|
||||
public RibbonButton()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
#endregion
|
||||
|
||||
[Category("Content"), Description("Text der auf dem Button gezeigt werden soll.")]
|
||||
#region Properties
|
||||
[Category("Content"), Description("Text that will be displayed on the button.")]
|
||||
public String Content
|
||||
{
|
||||
get { return labelText.Text; }
|
||||
set { labelText.Text = value; }
|
||||
}
|
||||
|
||||
[Category("Design"), Description("Das Bild, das als Icon dienen soll. (60x60)")]
|
||||
[Category("Design"), Description("Picture that will be the icon. (60x60)")]
|
||||
public Image Image
|
||||
{
|
||||
get { return pictureBox.Image; }
|
||||
set { pictureBox.Image = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private
|
||||
private void RibbonButtonMouseEnter(object sender, EventArgs e)
|
||||
{
|
||||
BackColor = Settings.LightMainColor;
|
||||
@ -62,5 +75,6 @@ namespace ANX.ContentCompiler.GUI.Controls
|
||||
ForeColor = Settings.ForeColor;
|
||||
Refresh();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,9 +1,16 @@
|
||||
using System;
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using ANX.ContentCompiler.GUI.Dialogues;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
#endregion
|
||||
|
||||
// This file is part of the EES Content Compiler 4,
|
||||
// © 2008 - 2012 by Eagle Eye Studios.
|
||||
// The EES Content Compiler 4 is released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.ContentCompiler.GUI.Controls
|
||||
{
|
||||
@ -12,18 +19,23 @@ namespace ANX.ContentCompiler.GUI.Controls
|
||||
[TestState(TestStateAttribute.TestState.Tested)]
|
||||
public partial class RibbonTextBox : UserControl
|
||||
{
|
||||
#region Constructor
|
||||
public RibbonTextBox()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Public
|
||||
public void AddMessage(string msg)
|
||||
{
|
||||
List<string> contents = textBox.Lines.ToList();
|
||||
contents.Add(msg);
|
||||
textBox.Lines = contents.ToArray();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Private
|
||||
private void ButtonDownClick(object sender, EventArgs e)
|
||||
{
|
||||
using (var dlg = new ErrorLogScreen(textBox.Lines))
|
||||
@ -31,5 +43,6 @@ namespace ANX.ContentCompiler.GUI.Controls
|
||||
dlg.ShowDialog();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,6 +1,13 @@
|
||||
using System;
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
#endregion
|
||||
|
||||
// This file is part of the EES Content Compiler 4,
|
||||
// © 2008 - 2012 by Eagle Eye Studios.
|
||||
// The EES Content Compiler 4 is released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
{
|
||||
@ -9,13 +16,16 @@ namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
[TestState(TestStateAttribute.TestState.Tested)]
|
||||
public partial class ErrorLogScreen : Form
|
||||
{
|
||||
#region Constructor
|
||||
public ErrorLogScreen(string[] errorLog)
|
||||
{
|
||||
InitializeComponent();
|
||||
SetUpColors();
|
||||
textBox.Lines = errorLog;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Private Methods
|
||||
private void SetUpColors()
|
||||
{
|
||||
BackColor = Settings.MainColor;
|
||||
@ -31,6 +41,7 @@ namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
buttonCancel.FlatAppearance.BorderColor = Settings.LightMainColor;
|
||||
}
|
||||
|
||||
#region Events
|
||||
private void ButtonNextClick(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.OK;
|
||||
@ -41,5 +52,7 @@ namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
Clipboard.SetText(textBox.Text);
|
||||
buttonCancel.Text = "Copied.";
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,13 +1,21 @@
|
||||
using System.Windows.Forms;
|
||||
#region Using Statements
|
||||
using System.Windows.Forms;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
#endregion
|
||||
|
||||
// This file is part of the EES Content Compiler 4,
|
||||
// © 2008 - 2012 by Eagle Eye Studios.
|
||||
// The EES Content Compiler 4 is released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
{
|
||||
[Developer("SilentWarrior/Eagle Eye Studios")]
|
||||
[PercentageComplete(100)] //TODO: Implement tour in MainWindow and launch it from here!
|
||||
[PercentageComplete(100)]
|
||||
[TestState(TestStateAttribute.TestState.Tested)]
|
||||
public partial class FirstStartScreen : Form
|
||||
{
|
||||
#region Constructor
|
||||
public FirstStartScreen()
|
||||
{
|
||||
InitializeComponent();
|
||||
@ -20,10 +28,13 @@ namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
button2.FlatAppearance.MouseDownBackColor = Settings.AccentColor3;
|
||||
button3.FlatAppearance.MouseDownBackColor = Settings.AccentColor3;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Private Methods
|
||||
private void Button2Click(object sender, System.EventArgs e)
|
||||
{
|
||||
MainWindow.Instance.StartShow();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,6 +1,13 @@
|
||||
using System;
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
#endregion
|
||||
|
||||
// This file is part of the EES Content Compiler 4,
|
||||
// © 2008 - 2012 by Eagle Eye Studios.
|
||||
// The EES Content Compiler 4 is released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
{
|
||||
@ -9,12 +16,15 @@ namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
[TestState(TestStateAttribute.TestState.Tested)]
|
||||
public partial class NewFolderScreen : Form
|
||||
{
|
||||
#region Constructor
|
||||
public NewFolderScreen()
|
||||
{
|
||||
InitializeComponent();
|
||||
SetUpColors();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Private Methods
|
||||
private void SetUpColors()
|
||||
{
|
||||
BackColor = Settings.MainColor;
|
||||
@ -40,5 +50,6 @@ namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
else
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,6 +1,13 @@
|
||||
using System;
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
#endregion
|
||||
|
||||
// This file is part of the EES Content Compiler 4,
|
||||
// © 2008 - 2012 by Eagle Eye Studios.
|
||||
// The EES Content Compiler 4 is released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
{
|
||||
@ -9,12 +16,15 @@ namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
[TestState(TestStateAttribute.TestState.InProgress)]
|
||||
public partial class NewProjectImportersScreen : Form
|
||||
{
|
||||
#region Constructor
|
||||
public NewProjectImportersScreen()
|
||||
{
|
||||
InitializeComponent();
|
||||
SetUpColors();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Private Methods
|
||||
private void SetUpColors()
|
||||
{
|
||||
BackColor = Settings.MainColor;
|
||||
@ -71,5 +81,6 @@ namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
else
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,6 +1,13 @@
|
||||
using System;
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
#endregion
|
||||
|
||||
// This file is part of the EES Content Compiler 4,
|
||||
// © 2008 - 2012 by Eagle Eye Studios.
|
||||
// The EES Content Compiler 4 is released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
{
|
||||
@ -9,12 +16,15 @@ namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
[TestState(TestStateAttribute.TestState.InProgress)]
|
||||
public partial class NewProjectOutputScreen : Form
|
||||
{
|
||||
#region Constructor
|
||||
public NewProjectOutputScreen()
|
||||
{
|
||||
InitializeComponent();
|
||||
SetUpColors();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Private Methods
|
||||
private void ArrowButtonYesClick(object sender, EventArgs e)
|
||||
{
|
||||
labelLocation.Visible = true;
|
||||
@ -63,5 +73,6 @@ namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
}
|
||||
DialogResult = DialogResult.None;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,7 +1,14 @@
|
||||
using System;
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
#endregion
|
||||
|
||||
// This file is part of the EES Content Compiler 4,
|
||||
// © 2008 - 2012 by Eagle Eye Studios.
|
||||
// The EES Content Compiler 4 is released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
{
|
||||
@ -10,13 +17,16 @@ namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
[TestState(TestStateAttribute.TestState.Tested)]
|
||||
public partial class NewProjectScreen : Form
|
||||
{
|
||||
#region Constructor
|
||||
public NewProjectScreen()
|
||||
{
|
||||
InitializeComponent();
|
||||
textBoxLocation.Text = Settings.DefaultProjectPath;
|
||||
SetUpColors();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Private Methods
|
||||
private void SetUpColors()
|
||||
{
|
||||
BackColor = Settings.MainColor;
|
||||
@ -69,5 +79,7 @@ namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
else
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,6 +1,13 @@
|
||||
using System;
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
#endregion
|
||||
|
||||
// This file is part of the EES Content Compiler 4,
|
||||
// © 2008 - 2012 by Eagle Eye Studios.
|
||||
// The EES Content Compiler 4 is released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
{
|
||||
@ -9,6 +16,7 @@ namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
[TestState(TestStateAttribute.TestState.InProgress)]
|
||||
public partial class NewProjectSummaryScreen : Form
|
||||
{
|
||||
#region Contructor
|
||||
public NewProjectSummaryScreen(String projectName, String projectDir, String outputDir, bool customImporters,
|
||||
String customImportersDir, int customImportersFound, int customProcessorsFound)
|
||||
{
|
||||
@ -31,7 +39,9 @@ namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
"Processors: " + customProcessorsFound;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Private Methods
|
||||
private void SetUpColors()
|
||||
{
|
||||
BackColor = Settings.MainColor;
|
||||
@ -50,5 +60,6 @@ namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
{
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,6 +1,13 @@
|
||||
using System;
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
#endregion
|
||||
|
||||
// This file is part of the EES Content Compiler 4,
|
||||
// © 2008 - 2012 by Eagle Eye Studios.
|
||||
// The EES Content Compiler 4 is released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
{
|
||||
@ -9,6 +16,7 @@ namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
[TestState(TestStateAttribute.TestState.Tested)]
|
||||
public partial class OpenProjectScreen : Form
|
||||
{
|
||||
#region Constructor
|
||||
public OpenProjectScreen()
|
||||
{
|
||||
InitializeComponent();
|
||||
@ -19,7 +27,9 @@ namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
listBoxRecentProjects.Items.Add(project);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Private Methods
|
||||
private void SetUpColors()
|
||||
{
|
||||
BackColor = Settings.MainColor;
|
||||
@ -65,5 +75,6 @@ namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
else
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -100,9 +100,8 @@
|
||||
this.Name = "PreviewScreen";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Preview";
|
||||
this.Load += new System.EventHandler(this.PreviewScreenLoad);
|
||||
this.drawSurface.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
|
@ -1,30 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using ANX.Framework.Content;
|
||||
using ANX.Framework.Content.Pipeline;
|
||||
using ANX.Framework.Content.Pipeline.Tasks;
|
||||
using ANX.Framework.Graphics;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
using Timer = System.Windows.Forms.Timer;
|
||||
#endregion
|
||||
|
||||
// This file is part of the EES Content Compiler 4,
|
||||
// © 2008 - 2012 by Eagle Eye Studios.
|
||||
// The EES Content Compiler 4 is released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
{
|
||||
[PercentageComplete(50)]
|
||||
[Developer("SilentWarrior/Eagle Eye Studios")]
|
||||
[TestState(TestStateAttribute.TestState.InProgress)]
|
||||
public partial class PreviewScreen : Form
|
||||
{
|
||||
#region Fields
|
||||
private Point _lastPos;
|
||||
private bool _mouseDown;
|
||||
private readonly BuildItem _item;
|
||||
private BuildItem _item;
|
||||
private Thread _loaderThread;
|
||||
private readonly string _outputFile;
|
||||
private readonly string _outputDir;
|
||||
private string _outputFile;
|
||||
private string _outputDir;
|
||||
private volatile bool _started;
|
||||
private volatile bool _error;
|
||||
private volatile string _errorMessage;
|
||||
@ -35,12 +40,10 @@ namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
private SpriteBatch _batch;
|
||||
#endregion
|
||||
|
||||
public PreviewScreen(BuildItem item)
|
||||
#region Constructor
|
||||
public PreviewScreen()
|
||||
{
|
||||
InitializeComponent();
|
||||
_item = item;
|
||||
_outputFile = Path.GetTempFileName();
|
||||
_outputDir = Path.GetTempPath();
|
||||
_graphicsDevice = new GraphicsDevice(
|
||||
GraphicsAdapter.DefaultAdapter,
|
||||
GraphicsProfile.HiDef,
|
||||
@ -53,6 +56,7 @@ namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
PresentationInterval = PresentInterval.Default,
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region WindowMoveMethods
|
||||
|
||||
@ -79,12 +83,54 @@ namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
|
||||
#endregion
|
||||
|
||||
#region Events
|
||||
private void ButtonQuitClick(object sender, EventArgs e)
|
||||
{
|
||||
Close();
|
||||
DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
|
||||
|
||||
void CheckThread(object sender, EventArgs e)
|
||||
{
|
||||
if (!_started)
|
||||
{
|
||||
((Timer)sender).Interval = 100;
|
||||
_loaderThread = new Thread(CompileFile);
|
||||
_loaderThread.Start();
|
||||
_started = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_loaderThread.IsAlive)
|
||||
return;
|
||||
if (_error)
|
||||
{
|
||||
labelStatus.Text = "Loading of Preview failed with: \n" + _errorMessage;
|
||||
return;
|
||||
}
|
||||
labelStatus.Text = "Loading successful";
|
||||
labelStatus.Hide();
|
||||
_tickTimer = new Timer { Interval = 120 };
|
||||
_tickTimer.Tick += Tick;
|
||||
_batch = new SpriteBatch(_graphicsDevice);
|
||||
_tickTimer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
void Tick(object sender, EventArgs e)
|
||||
{
|
||||
_graphicsDevice.Clear(Framework.Color.CornflowerBlue);
|
||||
if (_processor == "TextureProcessor")
|
||||
{
|
||||
_batch.Begin();
|
||||
|
||||
_batch.End();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Public methods
|
||||
public void CompileFile()
|
||||
{
|
||||
var builderTask = new BuildContent
|
||||
@ -117,49 +163,16 @@ namespace ANX.ContentCompiler.GUI.Dialogues
|
||||
}
|
||||
}
|
||||
|
||||
private void PreviewScreenLoad(object sender, EventArgs e)
|
||||
public void SetFile(BuildItem item)
|
||||
{
|
||||
_checkTimer = new Timer {Interval = 1000};
|
||||
labelStatus.Text = "Loading Preview...";
|
||||
_item = item;
|
||||
_outputFile = Path.GetTempFileName();
|
||||
_outputDir = Path.GetTempPath();
|
||||
_checkTimer = new Timer { Interval = 1000 };
|
||||
_checkTimer.Tick += CheckThread;
|
||||
_checkTimer.Start();
|
||||
}
|
||||
|
||||
void CheckThread(object sender, EventArgs e)
|
||||
{
|
||||
if (!_started)
|
||||
{
|
||||
((Timer) sender).Interval = 100;
|
||||
_loaderThread = new Thread(CompileFile);
|
||||
_loaderThread.Start();
|
||||
_started = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_loaderThread.IsAlive)
|
||||
return;
|
||||
if (_error)
|
||||
{
|
||||
labelStatus.Text = "Loading of Preview failed with: \n" + _errorMessage;
|
||||
return;
|
||||
}
|
||||
labelStatus.Text = "Loading successful";
|
||||
labelStatus.Hide();
|
||||
_tickTimer = new Timer {Interval = 120};
|
||||
_tickTimer.Tick += Tick;
|
||||
_batch = new SpriteBatch(_graphicsDevice);
|
||||
_tickTimer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
void Tick(object sender, EventArgs e)
|
||||
{
|
||||
_graphicsDevice.Clear(Framework.Color.CornflowerBlue);
|
||||
if (_processor == "TextureProcessor")
|
||||
{
|
||||
_batch.Begin();
|
||||
|
||||
_batch.End();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
35
Tools/ANXContentCompilerGUI/FakeBuildLogger.cs
Normal file
35
Tools/ANXContentCompilerGUI/FakeBuildLogger.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using ANX.Framework.Content.Pipeline;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
|
||||
// This file is part of the EES Content Compiler 4,
|
||||
// © 2008 - 2012 by Eagle Eye Studios.
|
||||
// The EES Content Compiler 4 is released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.ContentCompiler.GUI
|
||||
{
|
||||
[PercentageComplete(100)]
|
||||
[Developer("SilentWarrior/Eagle Eye Studios")]
|
||||
[TestState(TestStateAttribute.TestState.Tested)]
|
||||
public class FakeBuildLogger : ContentBuildLogger
|
||||
{
|
||||
#region Overrides of ContentBuildLogger
|
||||
|
||||
public override void LogImportantMessage(string message, params object[] messageArgs)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void LogMessage(string message, params object[] messageArgs)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void LogWarning(string helpLink, ContentIdentity contentIdentity, string message, params object[] messageArgs)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
@ -10,6 +10,12 @@ using ANX.ContentCompiler.GUI.Properties;
|
||||
using ANX.Framework.Content.Pipeline;
|
||||
using ANX.Framework.Content.Pipeline.Tasks;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
#endregion
|
||||
|
||||
// This file is part of the EES Content Compiler 4,
|
||||
// © 2008 - 2012 by Eagle Eye Studios.
|
||||
// The EES Content Compiler 4 is released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.ContentCompiler.GUI
|
||||
{
|
||||
@ -35,8 +41,9 @@ namespace ANX.ContentCompiler.GUI
|
||||
private readonly string[] _args;
|
||||
private int _showCounter = 0;
|
||||
|
||||
private ImporterManager iManager;
|
||||
private ProcessorManager pManager;
|
||||
private readonly ImporterManager _iManager;
|
||||
private readonly ProcessorManager _pManager;
|
||||
private PreviewScreen _previewScreen;
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
@ -78,8 +85,8 @@ namespace ANX.ContentCompiler.GUI
|
||||
treeViewItemDelete.MouseEnter += TreeViewItemMouseEnter;
|
||||
treeViewItemRename.MouseEnter += TreeViewItemMouseEnter;
|
||||
SetUpColors();
|
||||
iManager = new ImporterManager();
|
||||
pManager = new ProcessorManager();
|
||||
_iManager = new ImporterManager();
|
||||
_pManager = new ProcessorManager();
|
||||
}
|
||||
|
||||
private void MainWindowShown(object sender, EventArgs e)
|
||||
@ -273,7 +280,7 @@ namespace ANX.ContentCompiler.GUI
|
||||
|
||||
if (String.IsNullOrEmpty(bI.ProcessorName))
|
||||
{
|
||||
bI.ProcessorName = pManager.GetProcessorForImporter(iManager.GetInstance(bI.ImporterName));
|
||||
bI.ProcessorName = _pManager.GetProcessorForImporter(_iManager.GetInstance(bI.ImporterName));
|
||||
}
|
||||
}
|
||||
try
|
||||
@ -352,7 +359,7 @@ namespace ANX.ContentCompiler.GUI
|
||||
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 = pManager.GetProcessorForImporter(iManager.GetInstance(ImporterManager.GuessImporterByFileExtension(file)))
|
||||
ProcessorName = _pManager.GetProcessorForImporter(_iManager.GetInstance(ImporterManager.GuessImporterByFileExtension(file)))
|
||||
};
|
||||
_contentProject.BuildItems.Add(item);
|
||||
}
|
||||
@ -687,6 +694,11 @@ namespace ANX.ContentCompiler.GUI
|
||||
buildItem => buildItem.AssetName.Equals(treeView.SelectedNode.Name)))
|
||||
{
|
||||
propertyGrid.SelectedObject = buildItem;
|
||||
|
||||
if (_previewScreen != null)
|
||||
{
|
||||
_previewScreen.SetFile(buildItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -882,11 +894,11 @@ namespace ANX.ContentCompiler.GUI
|
||||
buildItem = item;
|
||||
}
|
||||
|
||||
using (var preview = new PreviewScreen(buildItem))
|
||||
{
|
||||
if ((string)treeView.SelectedNode.Tag == "File")
|
||||
preview.ShowDialog();
|
||||
}
|
||||
if (_previewScreen == null)
|
||||
_previewScreen = new PreviewScreen();
|
||||
if ((string) treeView.SelectedNode.Tag != "File") return;
|
||||
_previewScreen.Show();
|
||||
_previewScreen.SetFile(buildItem);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
@ -1,6 +1,13 @@
|
||||
using System;
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
#endregion
|
||||
|
||||
// This file is part of the EES Content Compiler 4,
|
||||
// © 2008 - 2012 by Eagle Eye Studios.
|
||||
// The EES Content Compiler 4 is released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.ContentCompiler.GUI
|
||||
{
|
||||
|
@ -1,9 +1,16 @@
|
||||
using System;
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
#endregion
|
||||
|
||||
// This file is part of the EES Content Compiler 4,
|
||||
// © 2008 - 2012 by Eagle Eye Studios.
|
||||
// The EES Content Compiler 4 is released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.ContentCompiler.GUI
|
||||
{
|
||||
|
@ -1,10 +1,17 @@
|
||||
using System;
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
#endregion
|
||||
|
||||
// This file is part of the EES Content Compiler 4,
|
||||
// © 2008 - 2012 by Eagle Eye Studios.
|
||||
// The EES Content Compiler 4 is released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.ContentCompiler.GUI
|
||||
{
|
||||
|
@ -1,7 +1,14 @@
|
||||
using System;
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using ANX.ContentCompiler.GUI.Dialogues;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
#endregion
|
||||
|
||||
// This file is part of the EES Content Compiler 4,
|
||||
// © 2008 - 2012 by Eagle Eye Studios.
|
||||
// The EES Content Compiler 4 is released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.ContentCompiler.GUI.States
|
||||
{
|
||||
|
@ -1,8 +1,15 @@
|
||||
using System;
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Windows.Forms;
|
||||
using ANX.ContentCompiler.GUI.Dialogues;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
#endregion
|
||||
|
||||
// This file is part of the EES Content Compiler 4,
|
||||
// © 2008 - 2012 by Eagle Eye Studios.
|
||||
// The EES Content Compiler 4 is released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.ContentCompiler.GUI.States
|
||||
{
|
||||
|
@ -1,6 +1,13 @@
|
||||
using System;
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
#endregion
|
||||
|
||||
// This file is part of the EES Content Compiler 4,
|
||||
// © 2008 - 2012 by Eagle Eye Studios.
|
||||
// The EES Content Compiler 4 is released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.ContentCompiler.GUI.States
|
||||
{
|
||||
|
@ -1,6 +1,13 @@
|
||||
using System;
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
#endregion
|
||||
|
||||
// This file is part of the EES Content Compiler 4,
|
||||
// © 2008 - 2012 by Eagle Eye Studios.
|
||||
// The EES Content Compiler 4 is released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.ContentCompiler.GUI
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user