diff --git a/Build/Configurations/ZDoom_DoomUDMF.cfg b/Build/Configurations/ZDoom_DoomUDMF.cfg index cb6bd9e2..ac65a364 100644 --- a/Build/Configurations/ZDoom_DoomUDMF.cfg +++ b/Build/Configurations/ZDoom_DoomUDMF.cfg @@ -252,6 +252,7 @@ Field data types: 14 = thing tag (integer) * 15 = linedef tag (integer) * 16 = enum option (string) +17 = angle in degrees (float) */ universalfields { @@ -411,13 +412,13 @@ universalfields rotationfloor { - type = 8; + type = 17; default = 0.0f; } rotationceiling { - type = 8; + type = 17; default = 0.0f; } diff --git a/Documents/fielddatatypes.txt b/Documents/fielddatatypes.txt index 3e95958a..07966d48 100644 --- a/Documents/fielddatatypes.txt +++ b/Documents/fielddatatypes.txt @@ -20,6 +20,7 @@ all supported data types: 14 = thing tag (integer) * 15 = linedef tag (integer) * 16 = enum option (string) +17 = angle in degrees (float) - Only types indicates with * are usable for standard hexen args - When no type is specified, the default type is 0 (integer) diff --git a/Source/Builder.csproj b/Source/Builder.csproj index 810972e2..b2a8d472 100644 --- a/Source/Builder.csproj +++ b/Source/Builder.csproj @@ -676,6 +676,12 @@ + + + + + + @@ -688,6 +694,12 @@ + + Form + + + AngleForm.cs + @@ -736,6 +748,10 @@ Designer ClickableNumericTextbox.cs + + Designer + AngleForm.cs + Designer BitFlagsForm.cs diff --git a/Source/Map/UniValue.cs b/Source/Map/UniValue.cs index 2fd73290..352da4a9 100644 --- a/Source/Map/UniValue.cs +++ b/Source/Map/UniValue.cs @@ -109,7 +109,8 @@ namespace CodeImp.DoomBuilder.Map s.rwInt(ref type); switch((UniversalType)type) { - case UniversalType.AngleDegrees: + case UniversalType.AngleRadians: + case UniversalType.AngleDegreesFloat: case UniversalType.Float: { float v = 0.0f; @@ -118,8 +119,8 @@ namespace CodeImp.DoomBuilder.Map value = v; break; } - - case UniversalType.AngleRadians: + + case UniversalType.AngleDegrees: case UniversalType.Color: case UniversalType.EnumBits: case UniversalType.EnumOption: diff --git a/Source/Types/AngleDegreesFloatHandler.cs b/Source/Types/AngleDegreesFloatHandler.cs new file mode 100644 index 00000000..82c8fa2d --- /dev/null +++ b/Source/Types/AngleDegreesFloatHandler.cs @@ -0,0 +1,114 @@ + +#region ================== Copyright (c) 2007 Pascal vd Heiden + +/* + * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com + * This program is released under GNU General Public License + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#endregion + +#region ================== Namespaces + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Text; +using CodeImp.DoomBuilder.IO; +using CodeImp.DoomBuilder.Data; +using System.IO; +using System.Diagnostics; +using CodeImp.DoomBuilder.Config; +using System.Windows.Forms; +using CodeImp.DoomBuilder.Windows; + +#endregion + +namespace CodeImp.DoomBuilder.Types +{ + [TypeHandler(UniversalType.AngleDegreesFloat, "Degrees (Decimal)", true)] + internal class AngleDegreesFloatHandler : TypeHandler + { + #region ================== Constants + + #endregion + + #region ================== Variables + + private float value; + + #endregion + + #region ================== Properties + + public override bool IsBrowseable { get { return true; } } + + #endregion + + #region ================== Constructor + + #endregion + + #region ================== Methods + + public override void Browse(IWin32Window parent) + { + int oldvalue = (int)Math.Round(value); + int newvalue = AngleForm.ShowDialog(parent, oldvalue); + if(newvalue != oldvalue) value = (float)newvalue; + } + + public override void SetValue(object value) + { + float result; + + // Null? + if(value == null) + { + this.value = 0.0f; + } + // Already an int or float? + else if((value is int) || (value is float)) + { + // Set directly + this.value = (float)value; + } + else + { + // Try parsing as string + if(float.TryParse(value.ToString(), NumberStyles.Float, CultureInfo.CurrentCulture, out result)) + { + this.value = result; + } + else + { + this.value = 0.0f; + } + } + } + + public override object GetValue() + { + return this.value; + } + + public override int GetIntValue() + { + return (int)this.value; + } + + public override string GetStringValue() + { + return this.value.ToString(); + } + + #endregion + } +} diff --git a/Source/Types/AngleDegreesHandler.cs b/Source/Types/AngleDegreesHandler.cs new file mode 100644 index 00000000..4bc99e36 --- /dev/null +++ b/Source/Types/AngleDegreesHandler.cs @@ -0,0 +1,112 @@ + +#region ================== Copyright (c) 2007 Pascal vd Heiden + +/* + * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com + * This program is released under GNU General Public License + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#endregion + +#region ================== Namespaces + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Text; +using CodeImp.DoomBuilder.IO; +using CodeImp.DoomBuilder.Data; +using System.IO; +using System.Diagnostics; +using CodeImp.DoomBuilder.Config; +using System.Windows.Forms; +using CodeImp.DoomBuilder.Windows; + +#endregion + +namespace CodeImp.DoomBuilder.Types +{ + [TypeHandler(UniversalType.AngleDegrees, "Degrees (Integer)", true)] + internal class AngleDegreesHandler : TypeHandler + { + #region ================== Constants + + #endregion + + #region ================== Variables + + private int value; + + #endregion + + #region ================== Properties + + public override bool IsBrowseable { get { return true; } } + + #endregion + + #region ================== Constructor + + #endregion + + #region ================== Methods + + public override void Browse(IWin32Window parent) + { + value = AngleForm.ShowDialog(parent, value); + } + + public override void SetValue(object value) + { + int result; + + // Null? + if(value == null) + { + this.value = 0; + } + // Already an int? + else if(value is int) + { + // Set directly + this.value = (int)value; + } + else + { + // Try parsing as string + if(int.TryParse(value.ToString(), NumberStyles.Integer, CultureInfo.CurrentCulture, out result)) + { + this.value = result; + } + else + { + this.value = 0; + } + } + } + + public override object GetValue() + { + return this.value; + } + + public override int GetIntValue() + { + return this.value; + } + + public override string GetStringValue() + { + return this.value.ToString(); + } + + #endregion + } +} diff --git a/Source/Types/AngleRadiansHandler.cs b/Source/Types/AngleRadiansHandler.cs new file mode 100644 index 00000000..b6257283 --- /dev/null +++ b/Source/Types/AngleRadiansHandler.cs @@ -0,0 +1,113 @@ + +#region ================== Copyright (c) 2007 Pascal vd Heiden + +/* + * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com + * This program is released under GNU General Public License + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#endregion + +#region ================== Namespaces + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Text; +using CodeImp.DoomBuilder.IO; +using CodeImp.DoomBuilder.Data; +using System.IO; +using System.Diagnostics; +using CodeImp.DoomBuilder.Config; +using System.Windows.Forms; +using CodeImp.DoomBuilder.Windows; +using CodeImp.DoomBuilder.Geometry; + +#endregion + +namespace CodeImp.DoomBuilder.Types +{ + [TypeHandler(UniversalType.AngleRadians, "Radians", true)] + internal class AngleRadiansHandler : TypeHandler + { + #region ================== Constants + + #endregion + + #region ================== Variables + + private float value; + + #endregion + + #region ================== Properties + + public override bool IsBrowseable { get { return true; } } + + #endregion + + #region ================== Constructor + + #endregion + + #region ================== Methods + + public override void Browse(IWin32Window parent) + { + value = Angle2D.DoomToReal(AngleForm.ShowDialog(parent, Angle2D.RealToDoom(value))); + } + + public override void SetValue(object value) + { + float result; + + // Null? + if(value == null) + { + this.value = 0.0f; + } + // Already an int or float? + else if((value is int) || (value is float)) + { + // Set directly + this.value = (float)value; + } + else + { + // Try parsing as string + if(float.TryParse(value.ToString(), NumberStyles.Float, CultureInfo.CurrentCulture, out result)) + { + this.value = result; + } + else + { + this.value = 0.0f; + } + } + } + + public override object GetValue() + { + return this.value; + } + + public override int GetIntValue() + { + return (int)this.value; + } + + public override string GetStringValue() + { + return this.value.ToString(); + } + + #endregion + } +} diff --git a/Source/Types/BoolHandler.cs b/Source/Types/BoolHandler.cs index 2842b71c..4b9e2b7c 100644 --- a/Source/Types/BoolHandler.cs +++ b/Source/Types/BoolHandler.cs @@ -31,7 +31,7 @@ using CodeImp.DoomBuilder.Config; namespace CodeImp.DoomBuilder.Types { - [TypeHandler(3, "Boolean", true)] + [TypeHandler(UniversalType.Boolean, "Boolean", true)] internal class BoolHandler : TypeHandler { #region ================== Constants diff --git a/Source/Types/ColorHandler.cs b/Source/Types/ColorHandler.cs index 6392a978..47ba6d12 100644 --- a/Source/Types/ColorHandler.cs +++ b/Source/Types/ColorHandler.cs @@ -34,7 +34,7 @@ using System.Drawing; namespace CodeImp.DoomBuilder.Types { - [TypeHandler(10, "Color", true)] + [TypeHandler(UniversalType.Color, "Color", true)] internal class ColorHandler : TypeHandler { #region ================== Constants diff --git a/Source/Types/EnumBitsHandler.cs b/Source/Types/EnumBitsHandler.cs index 93a25bb3..bc33757d 100644 --- a/Source/Types/EnumBitsHandler.cs +++ b/Source/Types/EnumBitsHandler.cs @@ -33,7 +33,7 @@ using CodeImp.DoomBuilder.Windows; namespace CodeImp.DoomBuilder.Types { - [TypeHandler(12, "Options", false)] + [TypeHandler(UniversalType.EnumBits, "Options", false)] internal class EnumBitsHandler : TypeHandler { #region ================== Constants diff --git a/Source/Types/EnumOptionHandler.cs b/Source/Types/EnumOptionHandler.cs index 2014f123..23037faf 100644 --- a/Source/Types/EnumOptionHandler.cs +++ b/Source/Types/EnumOptionHandler.cs @@ -31,7 +31,7 @@ using CodeImp.DoomBuilder.Config; namespace CodeImp.DoomBuilder.Types { - [TypeHandler(11, "Setting", false)] + [TypeHandler(UniversalType.EnumOption, "Setting", false)] internal class EnumOptionHandler : TypeHandler { #region ================== Constants diff --git a/Source/Types/EnumStringsHandler.cs b/Source/Types/EnumStringsHandler.cs index b4d5b556..42b65ed2 100644 --- a/Source/Types/EnumStringsHandler.cs +++ b/Source/Types/EnumStringsHandler.cs @@ -31,7 +31,7 @@ using CodeImp.DoomBuilder.Config; namespace CodeImp.DoomBuilder.Types { - [TypeHandler(16, "Setting", false)] + [TypeHandler(UniversalType.EnumStrings, "Setting", false)] internal class EnumStringsHandler : TypeHandler { #region ================== Constants diff --git a/Source/Types/FlatHandler.cs b/Source/Types/FlatHandler.cs index 7365c773..3b3f80ac 100644 --- a/Source/Types/FlatHandler.cs +++ b/Source/Types/FlatHandler.cs @@ -32,7 +32,7 @@ using CodeImp.DoomBuilder.Windows; namespace CodeImp.DoomBuilder.Types { - [TypeHandler(7, "Flat", true)] + [TypeHandler(UniversalType.Flat, "Flat", true)] internal class FlatHandler : TypeHandler { #region ================== Constants diff --git a/Source/Types/FloatHandler.cs b/Source/Types/FloatHandler.cs index 5013fd5b..6f646f4d 100644 --- a/Source/Types/FloatHandler.cs +++ b/Source/Types/FloatHandler.cs @@ -30,7 +30,7 @@ using System.Diagnostics; namespace CodeImp.DoomBuilder.Types { - [TypeHandler(1, "Decimal", true)] + [TypeHandler(UniversalType.Float, "Decimal", true)] internal class FloatHandler : TypeHandler { #region ================== Constants diff --git a/Source/Types/IntegerHandler.cs b/Source/Types/IntegerHandler.cs index 235ea0c3..f6505eb1 100644 --- a/Source/Types/IntegerHandler.cs +++ b/Source/Types/IntegerHandler.cs @@ -30,7 +30,7 @@ using System.Diagnostics; namespace CodeImp.DoomBuilder.Types { - [TypeHandler(0, "Integer", true)] + [TypeHandler(UniversalType.Integer, "Integer", true)] internal class IntegerHandler : TypeHandler { #region ================== Constants diff --git a/Source/Types/LinedefTagHandler.cs b/Source/Types/LinedefTagHandler.cs new file mode 100644 index 00000000..7182f173 --- /dev/null +++ b/Source/Types/LinedefTagHandler.cs @@ -0,0 +1,40 @@ + +#region ================== Copyright (c) 2007 Pascal vd Heiden + +/* + * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com + * This program is released under GNU General Public License + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#endregion + +#region ================== Namespaces + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Text; +using CodeImp.DoomBuilder.IO; +using CodeImp.DoomBuilder.Data; +using System.IO; +using System.Diagnostics; +using CodeImp.DoomBuilder.Config; +using CodeImp.DoomBuilder.Windows; +using System.Windows.Forms; + +#endregion + +namespace CodeImp.DoomBuilder.Types +{ + [TypeHandler(UniversalType.LinedefTag, "Linedef Tag", true)] + internal class LinedefTagHandler : IntegerHandler + { + } +} diff --git a/Source/Types/LinedefTypeHandler.cs b/Source/Types/LinedefTypeHandler.cs index f78bb729..2daec53b 100644 --- a/Source/Types/LinedefTypeHandler.cs +++ b/Source/Types/LinedefTypeHandler.cs @@ -33,7 +33,7 @@ using System.Windows.Forms; namespace CodeImp.DoomBuilder.Types { - [TypeHandler(4, "Linedef Action", true)] + [TypeHandler(UniversalType.LinedefType, "Linedef Action", true)] internal class LinedefTypeHandler : TypeHandler { #region ================== Constants diff --git a/Source/Types/SectorEffectHandler.cs b/Source/Types/SectorEffectHandler.cs index e1484f9d..e6c5edb6 100644 --- a/Source/Types/SectorEffectHandler.cs +++ b/Source/Types/SectorEffectHandler.cs @@ -33,7 +33,7 @@ using System.Windows.Forms; namespace CodeImp.DoomBuilder.Types { - [TypeHandler(5, "Sector Effect", true)] + [TypeHandler(UniversalType.SectorEffect, "Sector Effect", true)] internal class SectorEffectHandler : TypeHandler { #region ================== Constants diff --git a/Source/Types/SectorTagHandler.cs b/Source/Types/SectorTagHandler.cs new file mode 100644 index 00000000..6bc5bbd1 --- /dev/null +++ b/Source/Types/SectorTagHandler.cs @@ -0,0 +1,40 @@ + +#region ================== Copyright (c) 2007 Pascal vd Heiden + +/* + * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com + * This program is released under GNU General Public License + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#endregion + +#region ================== Namespaces + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Text; +using CodeImp.DoomBuilder.IO; +using CodeImp.DoomBuilder.Data; +using System.IO; +using System.Diagnostics; +using CodeImp.DoomBuilder.Config; +using CodeImp.DoomBuilder.Windows; +using System.Windows.Forms; + +#endregion + +namespace CodeImp.DoomBuilder.Types +{ + [TypeHandler(UniversalType.SectorTag, "Sector Tag", true)] + internal class SectorTagHandler : IntegerHandler + { + } +} diff --git a/Source/Types/StringHandler.cs b/Source/Types/StringHandler.cs index 10972c5c..a0c099ce 100644 --- a/Source/Types/StringHandler.cs +++ b/Source/Types/StringHandler.cs @@ -32,7 +32,7 @@ using System.Windows.Forms; namespace CodeImp.DoomBuilder.Types { - [TypeHandler(2, "Text", true)] + [TypeHandler(UniversalType.String, "Text", true)] internal class StringHandler : TypeHandler { #region ================== Constants diff --git a/Source/Types/TextureHandler.cs b/Source/Types/TextureHandler.cs index 74d5ed79..996b71b5 100644 --- a/Source/Types/TextureHandler.cs +++ b/Source/Types/TextureHandler.cs @@ -32,7 +32,7 @@ using CodeImp.DoomBuilder.Windows; namespace CodeImp.DoomBuilder.Types { - [TypeHandler(6, "Texture", true)] + [TypeHandler(UniversalType.Texture, "Texture", true)] internal class TextureHandler : TypeHandler { #region ================== Constants diff --git a/Source/Types/ThingTagHandler.cs b/Source/Types/ThingTagHandler.cs new file mode 100644 index 00000000..f147ebb5 --- /dev/null +++ b/Source/Types/ThingTagHandler.cs @@ -0,0 +1,40 @@ + +#region ================== Copyright (c) 2007 Pascal vd Heiden + +/* + * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com + * This program is released under GNU General Public License + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#endregion + +#region ================== Namespaces + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Text; +using CodeImp.DoomBuilder.IO; +using CodeImp.DoomBuilder.Data; +using System.IO; +using System.Diagnostics; +using CodeImp.DoomBuilder.Config; +using CodeImp.DoomBuilder.Windows; +using System.Windows.Forms; + +#endregion + +namespace CodeImp.DoomBuilder.Types +{ + [TypeHandler(UniversalType.ThingTag, "Thing Tag", true)] + internal class ThingTagHandler : IntegerHandler + { + } +} diff --git a/Source/Types/TypeHandlerAttribute.cs b/Source/Types/TypeHandlerAttribute.cs index 09ef54d2..e2edb424 100644 --- a/Source/Types/TypeHandlerAttribute.cs +++ b/Source/Types/TypeHandlerAttribute.cs @@ -57,10 +57,10 @@ namespace CodeImp.DoomBuilder.Types #region ================== Constructor / Destructor // Constructor - public TypeHandlerAttribute(int index, string name, bool customusable) + public TypeHandlerAttribute(UniversalType index, string name, bool customusable) { // Initialize - this.index = index; + this.index = (int)index; this.name = name; this.customusable = customusable; } diff --git a/Source/Types/UniversalType.cs b/Source/Types/UniversalType.cs index d184c1b2..4d394d91 100644 --- a/Source/Types/UniversalType.cs +++ b/Source/Types/UniversalType.cs @@ -45,6 +45,7 @@ namespace CodeImp.DoomBuilder.Types SectorTag = 13, ThingTag = 14, LinedefTag = 15, - EnumStrings = 16 + EnumStrings = 16, + AngleDegreesFloat = 17 } } diff --git a/Source/Windows/AngleForm.Designer.cs b/Source/Windows/AngleForm.Designer.cs new file mode 100644 index 00000000..53ddbdd9 --- /dev/null +++ b/Source/Windows/AngleForm.Designer.cs @@ -0,0 +1,98 @@ +namespace CodeImp.DoomBuilder.Windows +{ + partial class AngleForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if(disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.angle = new CodeImp.DoomBuilder.Controls.AngleControl(); + this.cancel = new System.Windows.Forms.Button(); + this.apply = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // angle + // + this.angle.BackColor = System.Drawing.SystemColors.Control; + this.angle.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.angle.Location = new System.Drawing.Point(62, 22); + this.angle.Name = "angle"; + this.angle.Size = new System.Drawing.Size(80, 80); + this.angle.TabIndex = 0; + this.angle.Value = 0; + // + // cancel + // + this.cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancel.Location = new System.Drawing.Point(105, 131); + this.cancel.Name = "cancel"; + this.cancel.Size = new System.Drawing.Size(91, 25); + this.cancel.TabIndex = 26; + this.cancel.Text = "Cancel"; + this.cancel.UseVisualStyleBackColor = true; + this.cancel.Click += new System.EventHandler(this.cancel_Click); + // + // apply + // + this.apply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.apply.Location = new System.Drawing.Point(8, 131); + this.apply.Name = "apply"; + this.apply.Size = new System.Drawing.Size(91, 25); + this.apply.TabIndex = 25; + this.apply.Text = "OK"; + this.apply.UseVisualStyleBackColor = true; + this.apply.Click += new System.EventHandler(this.apply_Click); + // + // AngleForm + // + this.AcceptButton = this.apply; + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.CancelButton = this.cancel; + this.ClientSize = new System.Drawing.Size(204, 165); + this.Controls.Add(this.cancel); + this.Controls.Add(this.apply); + this.Controls.Add(this.angle); + 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; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "AngleForm"; + this.Opacity = 0; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Angle"; + this.ResumeLayout(false); + + } + + #endregion + + private CodeImp.DoomBuilder.Controls.AngleControl angle; + private System.Windows.Forms.Button cancel; + private System.Windows.Forms.Button apply; + } +} \ No newline at end of file diff --git a/Source/Windows/AngleForm.cs b/Source/Windows/AngleForm.cs new file mode 100644 index 00000000..f2d323b5 --- /dev/null +++ b/Source/Windows/AngleForm.cs @@ -0,0 +1,109 @@ + +#region ================== Copyright (c) 2007 Pascal vd Heiden + +/* + * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com + * This program is released under GNU General Public License + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#endregion + +#region ================== Namespaces + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using CodeImp.DoomBuilder.Map; +using CodeImp.DoomBuilder.Data; +using CodeImp.DoomBuilder.IO; +using System.IO; +using CodeImp.DoomBuilder.Config; +using CodeImp.DoomBuilder.Editing; +using CodeImp.DoomBuilder.Controls; + +#endregion + +namespace CodeImp.DoomBuilder.Windows +{ + public partial class AngleForm : DelayedForm + { + #region ================== Variables + + private bool setup; + private int value; + + #endregion + + #region ================== Properties + + public int Value { get { return value; } } + + #endregion + + #region ================== Constructor + + // Constructor + public AngleForm() + { + InitializeComponent(); + } + + #endregion + + #region ================== Events + + // Cancel clicked + private void cancel_Click(object sender, EventArgs e) + { + // Close + DialogResult = DialogResult.Cancel; + this.Close(); + } + + // OK clicked + private void apply_Click(object sender, EventArgs e) + { + this.value = angle.Value; + + // Done + DialogResult = DialogResult.OK; + this.Close(); + } + + #endregion + + #region ================== Methods + + // Setup from EnumList + public void Setup(int value) + { + setup = true; + this.value = value; + angle.Value = value; + setup = false; + } + + // This shows the dialog + // Returns the flags or the same flags when cancelled + public static int ShowDialog(IWin32Window owner, int value) + { + int result = value; + AngleForm f = new AngleForm(); + f.Setup(value); + if(f.ShowDialog(owner) == DialogResult.OK) result = f.Value; + f.Dispose(); + return result; + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/Windows/AngleForm.resx b/Source/Windows/AngleForm.resx new file mode 100644 index 00000000..6b0110ab --- /dev/null +++ b/Source/Windows/AngleForm.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + True + + + True + + + True + + \ No newline at end of file diff --git a/Tests/UDMF/udmfexample.wad b/Tests/UDMF/udmfexample.wad index 66dba61a..2492e261 100644 Binary files a/Tests/UDMF/udmfexample.wad and b/Tests/UDMF/udmfexample.wad differ