diff --git a/Resources/SlimDX.png b/Resources/SlimDX.png new file mode 100644 index 00000000..f2a61d38 Binary files /dev/null and b/Resources/SlimDX.png differ diff --git a/Resources/SlimDX_small.png b/Resources/SlimDX_small.png new file mode 100644 index 00000000..c074552b Binary files /dev/null and b/Resources/SlimDX_small.png differ diff --git a/Source/Builder.csproj b/Source/Builder.csproj index 63f5599b..61f6ecc7 100644 --- a/Source/Builder.csproj +++ b/Source/Builder.csproj @@ -529,6 +529,7 @@ + diff --git a/Source/General/General.cs b/Source/General/General.cs index 455709ab..19291d44 100644 --- a/Source/General/General.cs +++ b/Source/General/General.cs @@ -639,7 +639,8 @@ namespace CodeImp.DoomBuilder // This closes the current map [BeginAction("closemap")] - internal static void CloseMap() + internal static void ActionCloseMap() { CloseMap(); } + internal static bool CloseMap() { // Cancel volatile mode, if any General.CancelVolatileMode(); @@ -651,7 +652,7 @@ namespace CodeImp.DoomBuilder mainwindow.DisplayStatus("Closing map..."); General.WriteLogLine("Unloading map..."); Cursor.Current = Cursors.WaitCursor; - + // Trash the current map if(map != null) map.Dispose(); map = null; @@ -665,6 +666,12 @@ namespace CodeImp.DoomBuilder mainwindow.UpdateInterface(); mainwindow.DisplayReady(); General.WriteLogLine("Map unload done"); + return true; + } + else + { + // User cancelled + return false; } } diff --git a/Source/Interface/AboutForm.Designer.cs b/Source/Interface/AboutForm.Designer.cs index 27936131..fa294810 100644 --- a/Source/Interface/AboutForm.Designer.cs +++ b/Source/Interface/AboutForm.Designer.cs @@ -29,17 +29,23 @@ namespace CodeImp.DoomBuilder.Interface private void InitializeComponent() { System.Windows.Forms.PictureBox pictureBox1; - this.label1 = new System.Windows.Forms.Label(); + System.Windows.Forms.Label label1; + System.Windows.Forms.Label label2; this.close = new System.Windows.Forms.Button(); this.builderlink = new System.Windows.Forms.LinkLabel(); + this.version = new System.Windows.Forms.Label(); + this.slimdxlogo = new System.Windows.Forms.PictureBox(); pictureBox1 = new System.Windows.Forms.PictureBox(); + label1 = new System.Windows.Forms.Label(); + label2 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(pictureBox1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.slimdxlogo)).BeginInit(); this.SuspendLayout(); // // pictureBox1 // pictureBox1.Image = global::CodeImp.DoomBuilder.Properties.Resources.Splash3_small; - pictureBox1.Location = new System.Drawing.Point(12, 12); + pictureBox1.Location = new System.Drawing.Point(10, 12); pictureBox1.Name = "pictureBox1"; pictureBox1.Size = new System.Drawing.Size(226, 80); pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; @@ -48,17 +54,28 @@ namespace CodeImp.DoomBuilder.Interface // // label1 // - this.label1.Location = new System.Drawing.Point(12, 93); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(318, 50); - this.label1.TabIndex = 2; - this.label1.Text = "Doom Builder is designed and programmed by Pascal vd Heiden.\r\nSeveral game config" + - "urations were written by various members of the Doom community."; + label1.FlatStyle = System.Windows.Forms.FlatStyle.System; + label1.Location = new System.Drawing.Point(15, 119); + label1.Name = "label1"; + label1.Size = new System.Drawing.Size(335, 50); + label1.TabIndex = 2; + label1.Text = "Doom Builder is designed and programmed by Pascal vd Heiden.\r\nSeveral game config" + + "urations were written by various members of the Doom community. See the website " + + "for a complete list of credits."; + // + // label2 + // + label2.FlatStyle = System.Windows.Forms.FlatStyle.System; + label2.Location = new System.Drawing.Point(15, 233); + label2.Name = "label2"; + label2.Size = new System.Drawing.Size(213, 29); + label2.TabIndex = 8; + label2.Text = "Doom Builder is powered by SlimDX,\r\na DirectX API for Microsoft .NET 2.0"; // // close // this.close.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.close.Location = new System.Drawing.Point(214, 139); + this.close.Location = new System.Drawing.Point(234, 237); this.close.Name = "close"; this.close.Size = new System.Drawing.Size(116, 25); this.close.TabIndex = 3; @@ -68,7 +85,7 @@ namespace CodeImp.DoomBuilder.Interface // builderlink // this.builderlink.AutoSize = true; - this.builderlink.Location = new System.Drawing.Point(12, 144); + this.builderlink.Location = new System.Drawing.Point(12, 169); this.builderlink.Name = "builderlink"; this.builderlink.Size = new System.Drawing.Size(121, 14); this.builderlink.TabIndex = 5; @@ -76,15 +93,40 @@ namespace CodeImp.DoomBuilder.Interface this.builderlink.Text = "www.doombuilder.com"; this.builderlink.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.builderlink_LinkClicked); // + // version + // + this.version.AutoSize = true; + this.version.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.version.Location = new System.Drawing.Point(15, 98); + this.version.Name = "version"; + this.version.Size = new System.Drawing.Size(138, 14); + this.version.TabIndex = 6; + this.version.Text = "Doom Builder some version"; + // + // slimdxlogo + // + this.slimdxlogo.Cursor = System.Windows.Forms.Cursors.Hand; + this.slimdxlogo.Image = global::CodeImp.DoomBuilder.Properties.Resources.SlimDX_small; + this.slimdxlogo.Location = new System.Drawing.Point(10, 210); + this.slimdxlogo.Name = "slimdxlogo"; + this.slimdxlogo.Size = new System.Drawing.Size(80, 20); + this.slimdxlogo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.slimdxlogo.TabIndex = 7; + this.slimdxlogo.TabStop = false; + this.slimdxlogo.Click += new System.EventHandler(this.slimdxlogo_Click); + // // AboutForm // this.AcceptButton = this.close; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.CancelButton = this.close; - this.ClientSize = new System.Drawing.Size(337, 172); + this.ClientSize = new System.Drawing.Size(358, 270); + this.Controls.Add(label2); + this.Controls.Add(this.slimdxlogo); + this.Controls.Add(this.version); this.Controls.Add(this.builderlink); this.Controls.Add(this.close); - this.Controls.Add(this.label1); + this.Controls.Add(label1); this.Controls.Add(pictureBox1); this.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; @@ -97,6 +139,7 @@ namespace CodeImp.DoomBuilder.Interface this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "About Doom Builder"; ((System.ComponentModel.ISupportInitialize)(pictureBox1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.slimdxlogo)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -104,8 +147,9 @@ namespace CodeImp.DoomBuilder.Interface #endregion - private System.Windows.Forms.Label label1; private System.Windows.Forms.Button close; private System.Windows.Forms.LinkLabel builderlink; + private System.Windows.Forms.Label version; + private System.Windows.Forms.PictureBox slimdxlogo; } } \ No newline at end of file diff --git a/Source/Interface/AboutForm.cs b/Source/Interface/AboutForm.cs index b41ac798..7488c24a 100644 --- a/Source/Interface/AboutForm.cs +++ b/Source/Interface/AboutForm.cs @@ -24,6 +24,7 @@ using System.Text; using System.Windows.Forms; using Microsoft.Win32; using System.Diagnostics; +using System.Reflection; #endregion @@ -36,6 +37,11 @@ namespace CodeImp.DoomBuilder.Interface { // Initialize InitializeComponent(); + + // Show version + string postfix = ""; + if(General.DebugBuild) postfix = "(debug)"; + version.Text = Application.ProductName + " version " + Application.ProductVersion + " " + postfix; } // Launch Doom Builder website @@ -44,6 +50,12 @@ namespace CodeImp.DoomBuilder.Interface OpenWebsite("http://" + builderlink.Text); } + // Clicking SlimDX logo + private void slimdxlogo_Click(object sender, EventArgs e) + { + OpenWebsite("http://slimdx.mdxinfo.com/"); + } + // This opens a URL in the default browser private void OpenWebsite(string url) { diff --git a/Source/Interface/AboutForm.resx b/Source/Interface/AboutForm.resx index e6f577e1..66b24b1d 100644 --- a/Source/Interface/AboutForm.resx +++ b/Source/Interface/AboutForm.resx @@ -126,12 +126,27 @@ True + + False + + + True + + + False + True True + + True + + + True + True diff --git a/Source/Interface/MainForm.cs b/Source/Interface/MainForm.cs index c0e28f41..13c0b387 100644 --- a/Source/Interface/MainForm.cs +++ b/Source/Interface/MainForm.cs @@ -247,33 +247,42 @@ namespace CodeImp.DoomBuilder.Interface if(e.CloseReason != CloseReason.ApplicationExitCall) { - General.WriteLogLine("Closing main interface window..."); + // Close the map + if(General.CloseMap()) + { + General.WriteLogLine("Closing main interface window..."); - // Stop exclusive mode, if any is active - StopExclusiveMouseInput(); - SetProcessorState(false); + // Stop exclusive mode, if any is active + StopExclusiveMouseInput(); + SetProcessorState(false); - // Unbind methods - General.Actions.UnbindMethods(this); + // Unbind methods + General.Actions.UnbindMethods(this); - // Determine window state to save - if(this.WindowState != FormWindowState.Minimized) - windowstate = (int)this.WindowState; + // Determine window state to save + if(this.WindowState != FormWindowState.Minimized) + windowstate = (int)this.WindowState; + else + windowstate = (int)FormWindowState.Normal; + + // Save window settings + General.Settings.WriteSetting("mainwindow.positionx", lastposition.X); + General.Settings.WriteSetting("mainwindow.positiony", lastposition.Y); + General.Settings.WriteSetting("mainwindow.sizewidth", lastsize.Width); + General.Settings.WriteSetting("mainwindow.sizeheight", lastsize.Height); + General.Settings.WriteSetting("mainwindow.windowstate", windowstate); + + // Save recent files + SaveRecentFiles(); + + // Terminate the program + General.Terminate(true); + } else - windowstate = (int)FormWindowState.Normal; - - // Save window settings - General.Settings.WriteSetting("mainwindow.positionx", lastposition.X); - General.Settings.WriteSetting("mainwindow.positiony", lastposition.Y); - General.Settings.WriteSetting("mainwindow.sizewidth", lastsize.Width); - General.Settings.WriteSetting("mainwindow.sizeheight", lastsize.Height); - General.Settings.WriteSetting("mainwindow.windowstate", windowstate); - - // Save recent files - SaveRecentFiles(); - - // Terminate the program - General.Terminate(true); + { + // Cancel the close + e.Cancel = true; + } } } diff --git a/Source/Properties/Resources.Designer.cs b/Source/Properties/Resources.Designer.cs index ecd59b1b..361d9da6 100644 --- a/Source/Properties/Resources.Designer.cs +++ b/Source/Properties/Resources.Designer.cs @@ -165,6 +165,13 @@ namespace CodeImp.DoomBuilder.Properties { } } + internal static System.Drawing.Bitmap SlimDX_small { + get { + object obj = ResourceManager.GetObject("SlimDX_small", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + internal static System.Drawing.Bitmap Splash3_small { get { object obj = ResourceManager.GetObject("Splash3_small", resourceCulture); diff --git a/Source/Properties/Resources.resx b/Source/Properties/Resources.resx index b262b291..15c39f16 100644 --- a/Source/Properties/Resources.resx +++ b/Source/Properties/Resources.resx @@ -190,4 +190,7 @@ ..\Resources\Splash3_trans.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\SlimDX_small.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/Source/Resources/SlimDX_small.png b/Source/Resources/SlimDX_small.png new file mode 100644 index 00000000..c074552b Binary files /dev/null and b/Source/Resources/SlimDX_small.png differ