# HG changeset patch # User Tsudico # Date 1292645683 21600 # Node ID 6284c091b13250595773e7f00e84e02006af6bba # Parent b42ba80ec613850587280eb1d77cf03ab1acdafa# Parent 38f0ed348ca8c8e227f39a4e7e6ab7fce0b42c7e Merge local with IBBoard diff -r 38f0ed348ca8 -r 6284c091b132 FrmMain.cs --- a/FrmMain.cs Fri Dec 17 22:11:04 2010 -0600 +++ b/FrmMain.cs Fri Dec 17 22:14:43 2010 -0600 @@ -39,12 +39,9 @@ private static readonly string AppTitle = "WarFoundry Forge"; internal static readonly string VERSION = "0.0.2"; const string DefaultDataDir = "data"; - private Preferences preferences; private readonly ILog log = LogManager.GetLogger(typeof(FrmMain)); - private CommandStack commandStack; - private string loadedFilePath; // Form contents @@ -197,8 +194,8 @@ // menuStrip // this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.menuFile, - this.menuHelp}); + this.menuFile, + this.menuHelp}); this.menuStrip.Location = new System.Drawing.Point(0, 0); this.menuStrip.Name = "menuStrip"; this.menuStrip.Size = new System.Drawing.Size(790, 24); @@ -208,10 +205,10 @@ // menuFile // this.menuFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.menuNew, - this.menuOpen, - this.toolStripSeparator2, - this.miExit}); + this.menuNew, + this.menuOpen, + this.toolStripSeparator2, + this.miExit}); this.menuFile.Name = "menuFile"; this.menuFile.Size = new System.Drawing.Size(33, 20); this.menuFile.Text = "&file"; @@ -261,7 +258,7 @@ // menuHelp // this.menuHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.miAbout}); + this.miAbout}); this.menuHelp.Name = "menuHelp"; this.menuHelp.Size = new System.Drawing.Size(39, 20); this.menuHelp.Text = "&help"; @@ -288,6 +285,7 @@ this.ResumeLayout(false); this.PerformLayout(); } + #endregion private void FileLoadingFinished(List failures) @@ -297,22 +295,22 @@ log.Warn("Failed to load " + failure.FailedFile.FullName + ": " + failure.Message); } } - + private void miNewSystem_Click(object sender, System.EventArgs e) { - FrmSystem system = new FrmSystem(new GameSystem(" ", " ", null)); + FrmSystem system = new FrmSystem(new GameSystem(" ", " ", new DummyWarFoundryFactory())); system.ShowDialog(this); } private void miOpenSystem_Click(object sender, System.EventArgs e) { - if(OpenFile()) + if (OpenFile()) { FrmSystem system = new FrmSystem(CurrentGameSystem); system.ShowDialog(this); } } - + private bool OpenFile() { if (openFile.Filter == "") @@ -338,11 +336,11 @@ string newFilePath = openFile.FileName; ICollection fileContents = WarFoundryLoader.GetDefault().LoadFile(new FileInfo(newFilePath)); - if(fileContents.Count > 0) + if (fileContents.Count > 0) { - foreach(IWarFoundryObject fileObject in fileContents) + foreach (IWarFoundryObject fileObject in fileContents) { - if(fileObject is GameSystem) + if (fileObject is GameSystem) { CurrentGameSystem = (GameSystem)fileObject; }