From d9300fda26702fbfe3a39a78ef04b40c3c7b92ff Mon Sep 17 00:00:00 2001 From: codeimp Date: Sat, 29 Dec 2007 15:50:16 +0000 Subject: [PATCH] added actions browser and generalized actions support (and small fix in Boom config) --- Build/Configurations/Boom.cfg | 2 - Source/Builder.csproj | 13 + Source/Config/GameConfiguration.cs | 72 ++- Source/Config/GeneralActionBit.cs | 63 +++ Source/Config/GeneralActionCategory.cs | 96 ++++ Source/Config/GeneralActionOption.cs | 101 ++++ Source/Config/LinedefActionInfo.cs | 21 +- Source/General/MapManager.cs | 7 + Source/IO/HexenMapSetIO.cs | 2 +- Source/Interface/AboutForm.Designer.cs | 1 - .../Interface/ActionBrowserForm.Designer.cs | 501 ++++++++++++++++++ Source/Interface/ActionBrowserForm.cs | 259 +++++++++ Source/Interface/ActionBrowserForm.resx | 249 +++++++++ Source/Interface/ActionSelectorControl.cs | 14 +- .../ImageSelectorControl.Designer.cs | 1 + Source/Interface/ImageSelectorControl.cs | 12 +- Source/Interface/LinedefEditForm.Designer.cs | 311 ++++++++--- Source/Interface/LinedefEditForm.cs | 92 +++- Source/Interface/LinedefEditForm.resx | 53 +- Source/Interface/PreferencesForm.Designer.cs | 1 + .../Interface/ResourceOptionsForm.Designer.cs | 1 - Source/Map/Linedef.cs | 3 +- Source/Map/Thing.cs | 3 +- 23 files changed, 1783 insertions(+), 95 deletions(-) create mode 100644 Source/Config/GeneralActionBit.cs create mode 100644 Source/Config/GeneralActionCategory.cs create mode 100644 Source/Config/GeneralActionOption.cs create mode 100644 Source/Interface/ActionBrowserForm.Designer.cs create mode 100644 Source/Interface/ActionBrowserForm.cs create mode 100644 Source/Interface/ActionBrowserForm.resx diff --git a/Build/Configurations/Boom.cfg b/Build/Configurations/Boom.cfg index 3864787a..1619c1ea 100644 --- a/Build/Configurations/Boom.cfg +++ b/Build/Configurations/Boom.cfg @@ -2012,8 +2012,6 @@ thingtypes blocking = 1; } } - - } boom { diff --git a/Source/Builder.csproj b/Source/Builder.csproj index 51915b6f..269c3c19 100644 --- a/Source/Builder.csproj +++ b/Source/Builder.csproj @@ -44,7 +44,10 @@ --> + + + @@ -102,6 +105,12 @@ AboutForm.cs + + Form + + + ActionBrowserForm.cs + UserControl @@ -357,6 +366,10 @@ + + Designer + ActionBrowserForm.cs + Designer ActionSelectorControl.cs diff --git a/Source/Config/GameConfiguration.cs b/Source/Config/GameConfiguration.cs index 9c2eb619..efa67624 100644 --- a/Source/Config/GameConfiguration.cs +++ b/Source/Config/GameConfiguration.cs @@ -69,6 +69,7 @@ namespace CodeImp.DoomBuilder.Config private List sortedlinedefactions; private List actioncategories; private List linedefactivates; + private List genactioncategories; #endregion @@ -101,6 +102,7 @@ namespace CodeImp.DoomBuilder.Config public List SortedLinedefActions { get { return sortedlinedefactions; } } public List ActionCategories { get { return actioncategories; } } public List LinedefActivates { get { return linedefactivates; } } + public List GenActionCategories { get { return genactioncategories; } } #endregion @@ -118,6 +120,7 @@ namespace CodeImp.DoomBuilder.Config this.actioncategories = new List(); this.sortedlinedefactions = new List(); this.linedefactivates = new List(); + this.genactioncategories = new List(); // Read general settings defaulttexturescale = cfg.ReadSetting("defaulttexturescale", 1f); @@ -143,11 +146,16 @@ namespace CodeImp.DoomBuilder.Config LoadLinedefFlags(); LoadLinedefActions(); LoadLinedefActivations(); - - // We have no destructor - GC.SuppressFinalize(this); + LoadLinedefGeneralizedAction(); } + // Destructor + ~GameConfiguration() + { + foreach(ThingCategory tc in thingcategories) tc.Dispose(); + foreach(LinedefActionCategory ac in actioncategories) ac.Dispose(); + } + #endregion #region ================== Loading @@ -290,6 +298,28 @@ namespace CodeImp.DoomBuilder.Config // Sort the list linedefactivates.Sort(); } + + // Linedef generalized actions + private void LoadLinedefGeneralizedAction() + { + IDictionary dic; + + // Get linedef activations + dic = cfg.ReadSetting("gen_linedeftypes", new Hashtable()); + foreach(DictionaryEntry de in dic) + { + // Check for valid structure + if(de.Value is IDictionary) + { + // Add category + genactioncategories.Add(new GeneralActionCategory(de.Key.ToString(), cfg)); + } + else + { + General.WriteLogLine("WARNING: Structure 'gen_linedeftypes' contains invalid entries!"); + } + } + } #endregion @@ -321,6 +351,42 @@ namespace CodeImp.DoomBuilder.Config } } + // This checks if an action is generalized or predefined + public bool IsGeneralizedAction(int action) + { + // Only actions above 0 + if(action > 0) + { + // Go for all categories + foreach(GeneralActionCategory ac in genactioncategories) + { + // Check if the action is within range of this category + if((action >= ac.Offset) && (action < (ac.Offset + ac.Length))) return true; + } + } + + // Not generalized + return false; + } + + // This gets the generalized action category from action number + public GeneralActionCategory GetGeneralizedActionCategory(int action) + { + // Only actions above 0 + if(action > 0) + { + // Go for all categories + foreach(GeneralActionCategory ac in genactioncategories) + { + // Check if the action is within range of this category + if((action >= ac.Offset) && (action < (ac.Offset + ac.Length))) return ac; + } + } + + // Not generalized + return null; + } + #endregion } } diff --git a/Source/Config/GeneralActionBit.cs b/Source/Config/GeneralActionBit.cs new file mode 100644 index 00000000..42f37bd4 --- /dev/null +++ b/Source/Config/GeneralActionBit.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Text; + +namespace CodeImp.DoomBuilder.Config +{ + public class GeneralActionBit : INumberedTitle, IComparable + { + #region ================== Constants + + #endregion + + #region ================== Variables + + // Properties + private int index; + private string title; + + #endregion + + #region ================== Properties + + public int Index { get { return index; } } + public string Title { get { return title; } } + + #endregion + + #region ================== Constructor / Disposer + + // Constructor + public GeneralActionBit(int index, string title) + { + // Initialize + this.index = index; + this.title = title; + + // We have no destructor + GC.SuppressFinalize(this); + } + + #endregion + + #region ================== Methods + + // This presents the item as string + public override string ToString() + { + return title; + } + + // This compares against another + public int CompareTo(GeneralActionBit other) + { + if(this.index < other.index) return -1; + else if(this.index > other.index) return 1; + else return 0; + } + + #endregion + } +} diff --git a/Source/Config/GeneralActionCategory.cs b/Source/Config/GeneralActionCategory.cs new file mode 100644 index 00000000..d3b7f92e --- /dev/null +++ b/Source/Config/GeneralActionCategory.cs @@ -0,0 +1,96 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Text; +using CodeImp.DoomBuilder.IO; + +namespace CodeImp.DoomBuilder.Config +{ + public class GeneralActionCategory : IDisposable + { + #region ================== Constants + + #endregion + + #region ================== Variables + + // Category properties + private string title; + private int offset; + private int length; + private List options; + + // Disposing + private bool isdisposed = false; + + #endregion + + #region ================== Properties + + public string Title { get { return title; } } + public int Offset { get { return offset; } } + public int Length { get { return length; } } + public List Options { get { return options; } } + public bool IsDisposed { get { return isdisposed; } } + + #endregion + + #region ================== Constructor / Disposer + + // Constructor + public GeneralActionCategory(string name, Configuration cfg) + { + IDictionary opts; + + // Initialize + this.options = new List(); + + // Read properties + this.title = cfg.ReadSetting("gen_linedeftypes." + name + ".title", ""); + this.offset = cfg.ReadSetting("gen_linedeftypes." + name + ".offset", 0); + this.length = cfg.ReadSetting("gen_linedeftypes." + name + ".length", 0); + + // Read the options + opts = cfg.ReadSetting("gen_linedeftypes." + name, new Hashtable()); + foreach(DictionaryEntry de in opts) + { + // Is this an option and not just some value? + if(de.Value is IDictionary) + { + // Add the option + this.options.Add(new GeneralActionOption(name, de.Key.ToString(), (IDictionary)de.Value)); + } + } + + // We have no destructor + GC.SuppressFinalize(this); + } + + // Diposer + public void Dispose() + { + // Not already disposed? + if(!isdisposed) + { + // Clean up + options = null; + + // Done + isdisposed = true; + } + } + + #endregion + + #region ================== Methods + + // String representation + public override string ToString() + { + return title; + } + + #endregion + } +} diff --git a/Source/Config/GeneralActionOption.cs b/Source/Config/GeneralActionOption.cs new file mode 100644 index 00000000..d12f134c --- /dev/null +++ b/Source/Config/GeneralActionOption.cs @@ -0,0 +1,101 @@ + +#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 System.Windows.Forms; +using CodeImp.DoomBuilder.Map; + +#endregion + +namespace CodeImp.DoomBuilder.Config +{ + public class GeneralActionOption + { + #region ================== Constants + + #endregion + + #region ================== Variables + + // Properties + private string name; + private List bits; + + #endregion + + #region ================== Properties + + public string Name { get { return name; } } + public List Bits { get { return bits; } } + + #endregion + + #region ================== Constructor / Disposer + + // Constructor + public GeneralActionOption(string cat, string name, IDictionary bitslist) + { + int index; + + // Initialize + this.name = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(name); + this.bits = new List(); + + // Go for all bits + foreach(DictionaryEntry de in bitslist) + { + // Check if the item key is numeric + if(int.TryParse(de.Key.ToString(), NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite, CultureInfo.InvariantCulture, out index)) + { + // Add to list + this.bits.Add(new GeneralActionBit(index, de.Value.ToString())); + } + else + { + General.WriteLogLine("WARNING: Structure 'gen_linedefflags." + cat + "." + name + "' contains invalid entries!"); + } + } + + // Sort the list + bits.Sort(); + + // We have no destructor + GC.SuppressFinalize(this); + } + + #endregion + + #region ================== Methods + + // This presents the item as string + public override string ToString() + { + return name; + } + + #endregion + } +} diff --git a/Source/Config/LinedefActionInfo.cs b/Source/Config/LinedefActionInfo.cs index d944f6de..c014f3d3 100644 --- a/Source/Config/LinedefActionInfo.cs +++ b/Source/Config/LinedefActionInfo.cs @@ -48,7 +48,8 @@ namespace CodeImp.DoomBuilder.Config private string title; private string[] argtitle; private TagType[] argtagtype; - + private bool[] argused; + #endregion #region ================== Properties @@ -60,6 +61,7 @@ namespace CodeImp.DoomBuilder.Config public string Title { get { return title; } } public string[] ArgTitle { get { return argtitle; } } public TagType[] ArgTagType { get { return argtagtype; } } + public bool[] ArgUsed { get { return argused; } } #endregion @@ -70,11 +72,13 @@ namespace CodeImp.DoomBuilder.Config { string[] parts; int p = 0; + int argindex; // Initialize this.index = index; this.argtitle = new string[Linedef.NUM_ARGS]; this.argtagtype = new TagType[Linedef.NUM_ARGS]; + this.argused = new bool[Linedef.NUM_ARGS]; // Find the parts by splitting on spaces parts = desc.Split(new char[] {' '}, 3); @@ -88,7 +92,9 @@ namespace CodeImp.DoomBuilder.Config // No args/marks for(int i = 0; i < Linedef.NUM_ARGS; i++) { - this.argtitle[i] = ""; + argindex = i + 1; + this.argused[i] = false; + this.argtitle[i] = "Argument " + argindex; this.argtagtype[i] = TagType.None; } @@ -99,6 +105,7 @@ namespace CodeImp.DoomBuilder.Config // Constructor public LinedefActionInfo(int index, Configuration cfg) { + string actionsetting = "linedeftypes." + index.ToString(CultureInfo.InvariantCulture); string desc; string[] parts; int p = 0; @@ -108,9 +115,10 @@ namespace CodeImp.DoomBuilder.Config this.index = index; this.argtitle = new string[Linedef.NUM_ARGS]; this.argtagtype = new TagType[Linedef.NUM_ARGS]; + this.argused = new bool[Linedef.NUM_ARGS]; // Read description - desc = cfg.ReadSetting("linedeftypes." + index.ToString(CultureInfo.InvariantCulture) + ".title", " Unknown"); + desc = cfg.ReadSetting(actionsetting + ".title", " Unknown"); // Find the parts by splitting on spaces parts = desc.Split(new char[] { ' ' }, 3); @@ -125,10 +133,9 @@ namespace CodeImp.DoomBuilder.Config for(int i = 0; i < Linedef.NUM_ARGS; i++) { argindex = i + 1; - this.argtitle[i] = cfg.ReadSetting("linedeftypes." + index.ToString(CultureInfo.InvariantCulture) + - ".arg" + argindex.ToString(CultureInfo.InvariantCulture), ""); - this.argtagtype[i] = (TagType)cfg.ReadSetting("linedeftypes." + index.ToString(CultureInfo.InvariantCulture) + - ".mark" + argindex.ToString(CultureInfo.InvariantCulture), (int)TagType.None); + this.argused[i] = cfg.SettingExists(actionsetting + ".arg" + argindex.ToString(CultureInfo.InvariantCulture)); + this.argtitle[i] = cfg.ReadSetting(actionsetting + ".arg" + argindex.ToString(CultureInfo.InvariantCulture), "Argument " + argindex); + this.argtagtype[i] = (TagType)cfg.ReadSetting(actionsetting + ".mark" + argindex.ToString(CultureInfo.InvariantCulture), (int)TagType.None); } // We have no destructor diff --git a/Source/General/MapManager.cs b/Source/General/MapManager.cs index e626e05c..3da823ec 100644 --- a/Source/General/MapManager.cs +++ b/Source/General/MapManager.cs @@ -102,6 +102,7 @@ namespace CodeImp.DoomBuilder public GameConfiguration Config { get { return config; } } public GridSetup Grid { get { return grid; } } public UndoManager UndoRedo { get { return undoredo; } } + public Type Type { get { return io.GetType(); } } #endregion @@ -981,6 +982,12 @@ namespace CodeImp.DoomBuilder optionsform.Dispose(); } + // This returns true is the given type matches + public bool IsType(Type t) + { + return io.GetType().Equals(t); + } + #endregion } } diff --git a/Source/IO/HexenMapSetIO.cs b/Source/IO/HexenMapSetIO.cs index 5c399767..1d6a39f9 100644 --- a/Source/IO/HexenMapSetIO.cs +++ b/Source/IO/HexenMapSetIO.cs @@ -230,7 +230,7 @@ namespace CodeImp.DoomBuilder.IO BinaryReader readline, readside; Lump linedefslump, sidedefslump; int num, i, offsetx, offsety, v1, v2; - int s1, s2, flags, action, tag, sc; + int s1, s2, flags, action, sc; byte[] args = new byte[Linedef.NUM_ARGS]; string thigh, tmid, tlow; Linedef l; diff --git a/Source/Interface/AboutForm.Designer.cs b/Source/Interface/AboutForm.Designer.cs index 915543c9..11b32afa 100644 --- a/Source/Interface/AboutForm.Designer.cs +++ b/Source/Interface/AboutForm.Designer.cs @@ -86,7 +86,6 @@ namespace CodeImp.DoomBuilder.Interface this.Controls.Add(this.close); this.Controls.Add(this.label1); this.Controls.Add(pictureBox1); - this.DoubleBuffered = true; 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; diff --git a/Source/Interface/ActionBrowserForm.Designer.cs b/Source/Interface/ActionBrowserForm.Designer.cs new file mode 100644 index 00000000..55ac9884 --- /dev/null +++ b/Source/Interface/ActionBrowserForm.Designer.cs @@ -0,0 +1,501 @@ +namespace CodeImp.DoomBuilder.Interface +{ + partial class ActionBrowserForm + { + /// + /// 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() + { + System.Windows.Forms.Label label1; + System.Windows.Forms.Label label2; + System.Windows.Forms.Label label3; + System.Windows.Forms.Label label4; + System.Windows.Forms.Label label5; + System.Windows.Forms.Label label6; + System.Windows.Forms.GroupBox groupBox1; + System.Windows.Forms.Label label7; + System.Windows.Forms.GroupBox groupBox2; + this.category = new System.Windows.Forms.ComboBox(); + this.option7 = new System.Windows.Forms.ComboBox(); + this.option7label = new System.Windows.Forms.Label(); + this.option6 = new System.Windows.Forms.ComboBox(); + this.option6label = new System.Windows.Forms.Label(); + this.option5 = new System.Windows.Forms.ComboBox(); + this.option5label = new System.Windows.Forms.Label(); + this.option4 = new System.Windows.Forms.ComboBox(); + this.option4label = new System.Windows.Forms.Label(); + this.option3 = new System.Windows.Forms.ComboBox(); + this.option3label = new System.Windows.Forms.Label(); + this.option2 = new System.Windows.Forms.ComboBox(); + this.option2label = new System.Windows.Forms.Label(); + this.option1 = new System.Windows.Forms.ComboBox(); + this.option1label = new System.Windows.Forms.Label(); + this.option0 = new System.Windows.Forms.ComboBox(); + this.option0label = new System.Windows.Forms.Label(); + this.cancel = new System.Windows.Forms.Button(); + this.apply = new System.Windows.Forms.Button(); + this.actions = new System.Windows.Forms.TreeView(); + this.tabs = new System.Windows.Forms.TabControl(); + this.tabactions = new System.Windows.Forms.TabPage(); + this.prefixespanel = new System.Windows.Forms.Panel(); + this.tabgeneralized = new System.Windows.Forms.TabPage(); + label1 = new System.Windows.Forms.Label(); + label2 = new System.Windows.Forms.Label(); + label3 = new System.Windows.Forms.Label(); + label4 = new System.Windows.Forms.Label(); + label5 = new System.Windows.Forms.Label(); + label6 = new System.Windows.Forms.Label(); + groupBox1 = new System.Windows.Forms.GroupBox(); + label7 = new System.Windows.Forms.Label(); + groupBox2 = new System.Windows.Forms.GroupBox(); + groupBox1.SuspendLayout(); + groupBox2.SuspendLayout(); + this.tabs.SuspendLayout(); + this.tabactions.SuspendLayout(); + this.prefixespanel.SuspendLayout(); + this.tabgeneralized.SuspendLayout(); + this.SuspendLayout(); + // + // label1 + // + label1.AutoSize = true; + label1.Location = new System.Drawing.Point(27, 0); + label1.Name = "label1"; + label1.Size = new System.Drawing.Size(60, 14); + label1.TabIndex = 21; + label1.Text = "S = Switch"; + // + // label2 + // + label2.AutoSize = true; + label2.Location = new System.Drawing.Point(140, 0); + label2.Name = "label2"; + label2.Size = new System.Drawing.Size(77, 14); + label2.TabIndex = 22; + label2.Text = "W = Walk over"; + // + // label3 + // + label3.AutoSize = true; + label3.Location = new System.Drawing.Point(269, 0); + label3.Name = "label3"; + label3.Size = new System.Drawing.Size(63, 14); + label3.TabIndex = 23; + label3.Text = "G = Gunfire"; + // + // label4 + // + label4.AutoSize = true; + label4.Location = new System.Drawing.Point(27, 16); + label4.Name = "label4"; + label4.Size = new System.Drawing.Size(49, 14); + label4.TabIndex = 24; + label4.Text = "D = Door"; + // + // label5 + // + label5.AutoSize = true; + label5.Location = new System.Drawing.Point(140, 16); + label5.Name = "label5"; + label5.Size = new System.Drawing.Size(80, 14); + label5.TabIndex = 25; + label5.Text = "R = Repeatable"; + // + // label6 + // + label6.AutoSize = true; + label6.Location = new System.Drawing.Point(269, 16); + label6.Name = "label6"; + label6.Size = new System.Drawing.Size(74, 14); + label6.TabIndex = 26; + label6.Text = "1 = Once only"; + // + // groupBox1 + // + groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + groupBox1.Controls.Add(this.category); + groupBox1.Controls.Add(label7); + groupBox1.Location = new System.Drawing.Point(6, 6); + groupBox1.Name = "groupBox1"; + groupBox1.Size = new System.Drawing.Size(379, 65); + groupBox1.TabIndex = 0; + groupBox1.TabStop = false; + groupBox1.Text = " Category "; + // + // category + // + this.category.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.category.FormattingEnabled = true; + this.category.Location = new System.Drawing.Point(118, 25); + this.category.Name = "category"; + this.category.Size = new System.Drawing.Size(199, 22); + this.category.TabIndex = 1; + this.category.SelectedIndexChanged += new System.EventHandler(this.category_SelectedIndexChanged); + // + // label7 + // + label7.AutoSize = true; + label7.Location = new System.Drawing.Point(58, 28); + label7.Name = "label7"; + label7.Size = new System.Drawing.Size(54, 14); + label7.TabIndex = 0; + label7.Text = "Category:"; + // + // groupBox2 + // + groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + groupBox2.Controls.Add(this.option7); + groupBox2.Controls.Add(this.option7label); + groupBox2.Controls.Add(this.option6); + groupBox2.Controls.Add(this.option6label); + groupBox2.Controls.Add(this.option5); + groupBox2.Controls.Add(this.option5label); + groupBox2.Controls.Add(this.option4); + groupBox2.Controls.Add(this.option4label); + groupBox2.Controls.Add(this.option3); + groupBox2.Controls.Add(this.option3label); + groupBox2.Controls.Add(this.option2); + groupBox2.Controls.Add(this.option2label); + groupBox2.Controls.Add(this.option1); + groupBox2.Controls.Add(this.option1label); + groupBox2.Controls.Add(this.option0); + groupBox2.Controls.Add(this.option0label); + groupBox2.Location = new System.Drawing.Point(6, 77); + groupBox2.Name = "groupBox2"; + groupBox2.Size = new System.Drawing.Size(379, 326); + groupBox2.TabIndex = 1; + groupBox2.TabStop = false; + groupBox2.Text = " Options "; + // + // option7 + // + this.option7.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.option7.FormattingEnabled = true; + this.option7.Location = new System.Drawing.Point(118, 280); + this.option7.Name = "option7"; + this.option7.Size = new System.Drawing.Size(199, 22); + this.option7.TabIndex = 17; + this.option7.Visible = false; + // + // option7label + // + this.option7label.Location = new System.Drawing.Point(3, 283); + this.option7label.Name = "option7label"; + this.option7label.Size = new System.Drawing.Size(109, 19); + this.option7label.TabIndex = 16; + this.option7label.Text = "Option:"; + this.option7label.TextAlign = System.Drawing.ContentAlignment.TopRight; + this.option7label.Visible = false; + // + // option6 + // + this.option6.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.option6.FormattingEnabled = true; + this.option6.Location = new System.Drawing.Point(118, 244); + this.option6.Name = "option6"; + this.option6.Size = new System.Drawing.Size(199, 22); + this.option6.TabIndex = 15; + this.option6.Visible = false; + // + // option6label + // + this.option6label.Location = new System.Drawing.Point(3, 247); + this.option6label.Name = "option6label"; + this.option6label.Size = new System.Drawing.Size(109, 19); + this.option6label.TabIndex = 14; + this.option6label.Text = "Option:"; + this.option6label.TextAlign = System.Drawing.ContentAlignment.TopRight; + this.option6label.Visible = false; + // + // option5 + // + this.option5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.option5.FormattingEnabled = true; + this.option5.Location = new System.Drawing.Point(118, 208); + this.option5.Name = "option5"; + this.option5.Size = new System.Drawing.Size(199, 22); + this.option5.TabIndex = 13; + this.option5.Visible = false; + // + // option5label + // + this.option5label.Location = new System.Drawing.Point(3, 211); + this.option5label.Name = "option5label"; + this.option5label.Size = new System.Drawing.Size(109, 19); + this.option5label.TabIndex = 12; + this.option5label.Text = "Option:"; + this.option5label.TextAlign = System.Drawing.ContentAlignment.TopRight; + this.option5label.Visible = false; + // + // option4 + // + this.option4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.option4.FormattingEnabled = true; + this.option4.Location = new System.Drawing.Point(118, 172); + this.option4.Name = "option4"; + this.option4.Size = new System.Drawing.Size(199, 22); + this.option4.TabIndex = 11; + this.option4.Visible = false; + // + // option4label + // + this.option4label.Location = new System.Drawing.Point(3, 175); + this.option4label.Name = "option4label"; + this.option4label.Size = new System.Drawing.Size(109, 19); + this.option4label.TabIndex = 10; + this.option4label.Text = "Option:"; + this.option4label.TextAlign = System.Drawing.ContentAlignment.TopRight; + this.option4label.Visible = false; + // + // option3 + // + this.option3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.option3.FormattingEnabled = true; + this.option3.Location = new System.Drawing.Point(118, 136); + this.option3.Name = "option3"; + this.option3.Size = new System.Drawing.Size(199, 22); + this.option3.TabIndex = 9; + this.option3.Visible = false; + // + // option3label + // + this.option3label.Location = new System.Drawing.Point(3, 139); + this.option3label.Name = "option3label"; + this.option3label.Size = new System.Drawing.Size(109, 19); + this.option3label.TabIndex = 8; + this.option3label.Text = "Option:"; + this.option3label.TextAlign = System.Drawing.ContentAlignment.TopRight; + this.option3label.Visible = false; + // + // option2 + // + this.option2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.option2.FormattingEnabled = true; + this.option2.Location = new System.Drawing.Point(118, 100); + this.option2.Name = "option2"; + this.option2.Size = new System.Drawing.Size(199, 22); + this.option2.TabIndex = 7; + this.option2.Visible = false; + // + // option2label + // + this.option2label.Location = new System.Drawing.Point(3, 103); + this.option2label.Name = "option2label"; + this.option2label.Size = new System.Drawing.Size(109, 19); + this.option2label.TabIndex = 6; + this.option2label.Text = "Option:"; + this.option2label.TextAlign = System.Drawing.ContentAlignment.TopRight; + this.option2label.Visible = false; + // + // option1 + // + this.option1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.option1.FormattingEnabled = true; + this.option1.Location = new System.Drawing.Point(118, 64); + this.option1.Name = "option1"; + this.option1.Size = new System.Drawing.Size(199, 22); + this.option1.TabIndex = 5; + this.option1.Visible = false; + // + // option1label + // + this.option1label.Location = new System.Drawing.Point(3, 67); + this.option1label.Name = "option1label"; + this.option1label.Size = new System.Drawing.Size(109, 19); + this.option1label.TabIndex = 4; + this.option1label.Text = "Option:"; + this.option1label.TextAlign = System.Drawing.ContentAlignment.TopRight; + this.option1label.Visible = false; + // + // option0 + // + this.option0.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.option0.FormattingEnabled = true; + this.option0.Location = new System.Drawing.Point(118, 28); + this.option0.Name = "option0"; + this.option0.Size = new System.Drawing.Size(199, 22); + this.option0.TabIndex = 3; + this.option0.Visible = false; + // + // option0label + // + this.option0label.Location = new System.Drawing.Point(3, 31); + this.option0label.Name = "option0label"; + this.option0label.Size = new System.Drawing.Size(109, 19); + this.option0label.TabIndex = 2; + this.option0label.Text = "Option:"; + this.option0label.TextAlign = System.Drawing.ContentAlignment.TopRight; + this.option0label.Visible = false; + // + // cancel + // + this.cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancel.Location = new System.Drawing.Point(297, 459); + this.cancel.Name = "cancel"; + this.cancel.Size = new System.Drawing.Size(112, 27); + this.cancel.TabIndex = 19; + 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.Right))); + this.apply.Location = new System.Drawing.Point(177, 459); + this.apply.Name = "apply"; + this.apply.Size = new System.Drawing.Size(112, 27); + this.apply.TabIndex = 18; + this.apply.Text = "OK"; + this.apply.UseVisualStyleBackColor = true; + this.apply.Click += new System.EventHandler(this.apply_Click); + // + // actions + // + this.actions.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.actions.Location = new System.Drawing.Point(6, 52); + this.actions.Name = "actions"; + this.actions.Size = new System.Drawing.Size(379, 351); + this.actions.TabIndex = 20; + // + // tabs + // + this.tabs.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tabs.Controls.Add(this.tabactions); + this.tabs.Controls.Add(this.tabgeneralized); + this.tabs.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tabs.ItemSize = new System.Drawing.Size(150, 19); + this.tabs.Location = new System.Drawing.Point(10, 10); + this.tabs.Margin = new System.Windows.Forms.Padding(1); + this.tabs.Name = "tabs"; + this.tabs.SelectedIndex = 0; + this.tabs.Size = new System.Drawing.Size(399, 436); + this.tabs.SizeMode = System.Windows.Forms.TabSizeMode.Fixed; + this.tabs.TabIndex = 21; + // + // tabactions + // + this.tabactions.Controls.Add(this.actions); + this.tabactions.Controls.Add(this.prefixespanel); + this.tabactions.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tabactions.Location = new System.Drawing.Point(4, 23); + this.tabactions.Name = "tabactions"; + this.tabactions.Padding = new System.Windows.Forms.Padding(3); + this.tabactions.Size = new System.Drawing.Size(391, 409); + this.tabactions.TabIndex = 0; + this.tabactions.Text = "Predefined Actions"; + this.tabactions.UseVisualStyleBackColor = true; + // + // prefixespanel + // + this.prefixespanel.Controls.Add(label6); + this.prefixespanel.Controls.Add(label5); + this.prefixespanel.Controls.Add(label4); + this.prefixespanel.Controls.Add(label3); + this.prefixespanel.Controls.Add(label2); + this.prefixespanel.Controls.Add(label1); + this.prefixespanel.Location = new System.Drawing.Point(7, 12); + this.prefixespanel.Name = "prefixespanel"; + this.prefixespanel.Size = new System.Drawing.Size(378, 34); + this.prefixespanel.TabIndex = 27; + // + // tabgeneralized + // + this.tabgeneralized.Controls.Add(groupBox2); + this.tabgeneralized.Controls.Add(groupBox1); + this.tabgeneralized.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tabgeneralized.Location = new System.Drawing.Point(4, 23); + this.tabgeneralized.Name = "tabgeneralized"; + this.tabgeneralized.Padding = new System.Windows.Forms.Padding(3); + this.tabgeneralized.Size = new System.Drawing.Size(391, 409); + this.tabgeneralized.TabIndex = 1; + this.tabgeneralized.Text = "Generalized Actions"; + this.tabgeneralized.UseVisualStyleBackColor = true; + // + // ActionBrowserForm + // + this.AcceptButton = this.apply; + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.CancelButton = this.cancel; + this.ClientSize = new System.Drawing.Size(419, 496); + this.Controls.Add(this.tabs); + this.Controls.Add(this.cancel); + this.Controls.Add(this.apply); + 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 = "ActionBrowserForm"; + this.Opacity = 0; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "ActionBrowserForm"; + groupBox1.ResumeLayout(false); + groupBox1.PerformLayout(); + groupBox2.ResumeLayout(false); + this.tabs.ResumeLayout(false); + this.tabactions.ResumeLayout(false); + this.prefixespanel.ResumeLayout(false); + this.prefixespanel.PerformLayout(); + this.tabgeneralized.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button cancel; + private System.Windows.Forms.Button apply; + private System.Windows.Forms.TreeView actions; + private System.Windows.Forms.TabControl tabs; + private System.Windows.Forms.TabPage tabactions; + private System.Windows.Forms.TabPage tabgeneralized; + private System.Windows.Forms.ComboBox category; + private System.Windows.Forms.ComboBox option7; + private System.Windows.Forms.Label option7label; + private System.Windows.Forms.ComboBox option6; + private System.Windows.Forms.Label option6label; + private System.Windows.Forms.ComboBox option5; + private System.Windows.Forms.Label option5label; + private System.Windows.Forms.ComboBox option4; + private System.Windows.Forms.Label option4label; + private System.Windows.Forms.ComboBox option3; + private System.Windows.Forms.Label option3label; + private System.Windows.Forms.ComboBox option2; + private System.Windows.Forms.Label option2label; + private System.Windows.Forms.ComboBox option1; + private System.Windows.Forms.Label option1label; + private System.Windows.Forms.ComboBox option0; + private System.Windows.Forms.Label option0label; + private System.Windows.Forms.Panel prefixespanel; + } +} \ No newline at end of file diff --git a/Source/Interface/ActionBrowserForm.cs b/Source/Interface/ActionBrowserForm.cs new file mode 100644 index 00000000..db86ca55 --- /dev/null +++ b/Source/Interface/ActionBrowserForm.cs @@ -0,0 +1,259 @@ + +#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 Microsoft.Win32; +using System.Diagnostics; +using CodeImp.DoomBuilder.Controls; +using CodeImp.DoomBuilder.Data; +using CodeImp.DoomBuilder.Config; +using CodeImp.DoomBuilder.Map; +using CodeImp.DoomBuilder.IO; + +#endregion + +namespace CodeImp.DoomBuilder.Interface +{ + public partial class ActionBrowserForm : DelayedForm + { + // Constants + private const int MAX_OPTIONS = 8; + + // Variables + private int selectedaction; + private ComboBox[] options; + private Label[] optionlbls; + + // Properties + public int SelectedAction { get { return selectedaction; } } + + // Constructor + public ActionBrowserForm(int action) + { + TreeNode cn, n; + GeneralActionCategory sc; + int actionbits; + + // Initialize + InitializeComponent(); + + // Make array references for controls + options = new ComboBox[] { option0, option1, option2, option3, option4, option5, option6, option7 }; + optionlbls = new Label[] { option0label, option1label, option2label, option3label, option4label, + option5label, option6label, option7label }; + + // Show prefixes panel only for doom type maps + if(!General.Map.IsType(typeof(DoomMapSetIO))) + { + prefixespanel.Visible = false; + actions.Height += actions.Top - prefixespanel.Top; + actions.Top = prefixespanel.Top; + } + + // Go for all predefined categories + foreach(LinedefActionCategory ac in General.Map.Config.ActionCategories) + { + // Empty category names will not be created + // (those actions will go in the root of the tree) + if(ac.Name.Length > 0) + { + // Create category + cn = actions.Nodes.Add(ac.Name); + foreach(LinedefActionInfo ai in ac.Actions) + { + // Create action + n = cn.Nodes.Add(ai.Title); + n.Tag = ai; + + // This is the given action? + if(ai.Index == action) + { + // Select this and expand the category + cn.Expand(); + actions.SelectedNode = n; + n.EnsureVisible(); + } + } + } + else + { + // Put actions in the tree root + foreach(LinedefActionInfo ai in ac.Actions) + { + // Create action + n = actions.Nodes.Add(ai.Title); + n.Tag = ai; + } + } + } + + // Add for all generalized categories to the combobox + category.Items.AddRange(General.Map.Config.GenActionCategories.ToArray()); + + // Given action is generalized? + if(General.Map.Config.IsGeneralizedAction(action)) + { + // Open the generalized tab + tabs.SelectedTab = tabgeneralized; + + // Select category + foreach(GeneralActionCategory ac in category.Items) + if((action >= ac.Offset) && (action < (ac.Offset + ac.Length))) category.SelectedItem = ac; + + // Anything selected? + if(category.SelectedIndex > -1) + { + // Go for all options in selected category + sc = category.SelectedItem as GeneralActionCategory; + actionbits = action - sc.Offset; + for(int i = 0; i < MAX_OPTIONS; i++) + { + // Option used? + if(i < sc.Options.Count) + { + // Go for all bits + foreach(GeneralActionBit ab in sc.Options[i].Bits) + { + // Select this setting if matches + if((actionbits & ab.Index) == ab.Index) options[i].SelectedItem = ab; + } + } + } + } + } + else + { + // Open the predefined tab + tabs.SelectedTab = tabactions; + } + } + + // This browses for an action + // Returns the new action or the same action when cancelled + public static int BrowseAction(IWin32Window owner, int action) + { + ActionBrowserForm f = new ActionBrowserForm(action); + if(f.ShowDialog(owner) == DialogResult.OK) action = f.SelectedAction; + f.Dispose(); + return action; + } + + // OK clicked + private void apply_Click(object sender, EventArgs e) + { + GeneralActionCategory sc; + + // Presume no result + selectedaction = 0; + + // Predefined action? + if(tabs.SelectedTab == tabactions) + { + // Action node selected? + if(actions.SelectedNode.Tag is LinedefActionInfo) + { + // Our result + selectedaction = (actions.SelectedNode.Tag as LinedefActionInfo).Index; + } + } + // Generalized action + else + { + // Category selected? + if(category.SelectedIndex > -1) + { + // Add category bits and go for all options + sc = category.SelectedItem as GeneralActionCategory; + selectedaction = sc.Offset; + for(int i = 0; i < MAX_OPTIONS; i++) + { + // Option used? + if(i < sc.Options.Count) + { + // Add selected bits + if(options[i].SelectedIndex > -1) + selectedaction += (options[i].SelectedItem as GeneralActionBit).Index; + } + } + } + } + + // Done + this.DialogResult = DialogResult.OK; + this.Close(); + } + + // Cancel clicked + private void cancel_Click(object sender, EventArgs e) + { + // Leave + this.DialogResult = DialogResult.Cancel; + this.Close(); + } + + // Generalized category selected + private void category_SelectedIndexChanged(object sender, EventArgs e) + { + GeneralActionCategory ac; + + // Category selected? + if(category.SelectedIndex > -1) + { + // Get the category + ac = category.SelectedItem as GeneralActionCategory; + + // Go for all options + for(int i = 0; i < MAX_OPTIONS; i++) + { + // Option used in selected category? + if(i < ac.Options.Count) + { + // Setup controls + optionlbls[i].Text = ac.Options[i].Name + ":"; + options[i].Items.Clear(); + options[i].Items.AddRange(ac.Options[i].Bits.ToArray()); + + // Show option + options[i].Visible = true; + optionlbls[i].Visible = true; + } + else + { + // Hide option + options[i].Visible = false; + optionlbls[i].Visible = false; + } + } + } + else + { + // Hide all options + for(int i = 0; i < MAX_OPTIONS; i++) + { + options[i].Visible = false; + optionlbls[i].Visible = false; + } + } + } + } +} \ No newline at end of file diff --git a/Source/Interface/ActionBrowserForm.resx b/Source/Interface/ActionBrowserForm.resx new file mode 100644 index 00000000..62fbc093 --- /dev/null +++ b/Source/Interface/ActionBrowserForm.resx @@ -0,0 +1,249 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + False + + + True + + + False + + + True + + + False + + + True + + + False + + + True + + + False + + + True + + + False + + + False + + + True + + + True + + + True + + + False + + + False + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + \ No newline at end of file diff --git a/Source/Interface/ActionSelectorControl.cs b/Source/Interface/ActionSelectorControl.cs index 254c8fdc..2e9c08d1 100644 --- a/Source/Interface/ActionSelectorControl.cs +++ b/Source/Interface/ActionSelectorControl.cs @@ -32,6 +32,9 @@ namespace CodeImp.DoomBuilder.Interface { public partial class ActionSelectorControl : UserControl { + // Events + public event EventHandler ValueChanges; + // Constants private const string NUMBER_SEPERATOR = "\t"; @@ -73,6 +76,7 @@ namespace CodeImp.DoomBuilder.Interface Brush displaybrush; Brush backbrush; string displayname; + int intnumber = 0; // Unknow item? if(e.Index < 0) @@ -81,11 +85,16 @@ namespace CodeImp.DoomBuilder.Interface displaybrush = new SolidBrush(SystemColors.GrayText); backbrush = new SolidBrush(SystemColors.Window); + // Try getting integral number + int.TryParse(number.Text, out intnumber); + // Check what to display if(number.Text.Length == 0) displayname = ""; - else if(number.Text == "0") + else if(intnumber == 0) displayname = "None"; + else if(General.Map.Config.IsGeneralizedAction(intnumber)) + displayname = "Generalized (" + General.Map.Config.GetGeneralizedActionCategory(intnumber) + ")"; else displayname = "Unknown"; } @@ -168,6 +177,9 @@ namespace CodeImp.DoomBuilder.Interface // Select item if(list.SelectedIndex != itemindex) list.SelectedIndex = itemindex; list.Refresh(); + + // Raise change event + if(ValueChanges != null) ValueChanges(this, EventArgs.Empty); } // Keys pressed in number box diff --git a/Source/Interface/ImageSelectorControl.Designer.cs b/Source/Interface/ImageSelectorControl.Designer.cs index ac4b1069..c0ce9b71 100644 --- a/Source/Interface/ImageSelectorControl.Designer.cs +++ b/Source/Interface/ImageSelectorControl.Designer.cs @@ -61,6 +61,7 @@ namespace CodeImp.DoomBuilder.Interface this.Controls.Add(this.preview); this.Name = "ImageSelectorControl"; this.Size = new System.Drawing.Size(115, 136); + this.Layout += new System.Windows.Forms.LayoutEventHandler(this.ImageSelectorControl_Layout); this.Resize += new System.EventHandler(this.ImageSelectorControl_Resize); this.ResumeLayout(false); this.PerformLayout(); diff --git a/Source/Interface/ImageSelectorControl.cs b/Source/Interface/ImageSelectorControl.cs index 125c9862..06c38da0 100644 --- a/Source/Interface/ImageSelectorControl.cs +++ b/Source/Interface/ImageSelectorControl.cs @@ -52,7 +52,17 @@ namespace CodeImp.DoomBuilder.Interface private void ImageSelectorControl_Resize(object sender, EventArgs e) { // Fixed size - this.ClientSize = new Size(preview.Left + preview.Width, name.Top + name.Height); + //this.ClientSize = new Size(preview.Left + preview.Width, name.Top + name.Height); + preview.Width = this.ClientSize.Width; + preview.Height = this.ClientSize.Height - name.Height - 4; + name.Width = this.ClientSize.Width; + name.Top = this.ClientSize.Height - name.Height; + } + + // Layout change + private void ImageSelectorControl_Layout(object sender, LayoutEventArgs e) + { + ImageSelectorControl_Resize(sender, EventArgs.Empty); } // Image clicked diff --git a/Source/Interface/LinedefEditForm.Designer.cs b/Source/Interface/LinedefEditForm.Designer.cs index 818cdd4c..b7085395 100644 --- a/Source/Interface/LinedefEditForm.Designer.cs +++ b/Source/Interface/LinedefEditForm.Designer.cs @@ -29,7 +29,7 @@ namespace CodeImp.DoomBuilder.Interface private void InitializeComponent() { System.Windows.Forms.Label label2; - System.Windows.Forms.Label label1; + System.Windows.Forms.Label taglabel; System.Windows.Forms.Label label3; System.Windows.Forms.Label label4; System.Windows.Forms.Label label5; @@ -40,13 +40,27 @@ namespace CodeImp.DoomBuilder.Interface System.Windows.Forms.Label label10; System.Windows.Forms.Label label11; System.Windows.Forms.Label label12; + System.Windows.Forms.Label activationlabel; + this.arg0label = new System.Windows.Forms.Label(); + this.arg1label = new System.Windows.Forms.Label(); + this.arg4label = new System.Windows.Forms.Label(); + this.arg2label = new System.Windows.Forms.Label(); + this.arg3label = new System.Windows.Forms.Label(); this.cancel = new System.Windows.Forms.Button(); this.apply = new System.Windows.Forms.Button(); this.actiongroup = new System.Windows.Forms.GroupBox(); - this.newtag = new System.Windows.Forms.Button(); - this.tag = new CodeImp.DoomBuilder.Interface.NumericTextbox(); + this.hexenpanel = new System.Windows.Forms.Panel(); + this.arg3 = new CodeImp.DoomBuilder.Interface.NumericTextbox(); + this.arg2 = new CodeImp.DoomBuilder.Interface.NumericTextbox(); + this.arg4 = new CodeImp.DoomBuilder.Interface.NumericTextbox(); + this.arg1 = new CodeImp.DoomBuilder.Interface.NumericTextbox(); + this.arg0 = new CodeImp.DoomBuilder.Interface.NumericTextbox(); + this.activation = new System.Windows.Forms.ComboBox(); this.action = new CodeImp.DoomBuilder.Interface.ActionSelectorControl(); this.browseaction = new System.Windows.Forms.Button(); + this.doompanel = new System.Windows.Forms.Panel(); + this.tag = new CodeImp.DoomBuilder.Interface.NumericTextbox(); + this.newtag = new System.Windows.Forms.Button(); this.settingsgroup = new System.Windows.Forms.GroupBox(); this.flags = new CodeImp.DoomBuilder.Interface.CheckboxArrayControl(); this.checkBox1 = new System.Windows.Forms.CheckBox(); @@ -70,7 +84,7 @@ namespace CodeImp.DoomBuilder.Interface this.frontoffsety = new CodeImp.DoomBuilder.Interface.NumericTextbox(); this.frontoffsetx = new CodeImp.DoomBuilder.Interface.NumericTextbox(); label2 = new System.Windows.Forms.Label(); - label1 = new System.Windows.Forms.Label(); + taglabel = new System.Windows.Forms.Label(); label3 = new System.Windows.Forms.Label(); label4 = new System.Windows.Forms.Label(); label5 = new System.Windows.Forms.Label(); @@ -81,7 +95,10 @@ namespace CodeImp.DoomBuilder.Interface label10 = new System.Windows.Forms.Label(); label11 = new System.Windows.Forms.Label(); label12 = new System.Windows.Forms.Label(); + activationlabel = new System.Windows.Forms.Label(); this.actiongroup.SuspendLayout(); + this.hexenpanel.SuspendLayout(); + this.doompanel.SuspendLayout(); this.settingsgroup.SuspendLayout(); this.tabs.SuspendLayout(); this.tabPage1.SuspendLayout(); @@ -99,29 +116,29 @@ namespace CodeImp.DoomBuilder.Interface label2.TabIndex = 9; label2.Text = "Action:"; // - // label1 + // taglabel // - label1.AutoSize = true; - label1.Location = new System.Drawing.Point(28, 78); - label1.Name = "label1"; - label1.Size = new System.Drawing.Size(28, 14); - label1.TabIndex = 6; - label1.Text = "Tag:"; + taglabel.AutoSize = true; + taglabel.Location = new System.Drawing.Point(22, 22); + taglabel.Name = "taglabel"; + taglabel.Size = new System.Drawing.Size(28, 14); + taglabel.TabIndex = 6; + taglabel.Text = "Tag:"; // // label3 // - label3.Location = new System.Drawing.Point(252, 18); + label3.Location = new System.Drawing.Point(234, 18); label3.Name = "label3"; - label3.Size = new System.Drawing.Size(68, 16); + label3.Size = new System.Drawing.Size(83, 16); label3.TabIndex = 3; label3.Text = "Upper"; label3.TextAlign = System.Drawing.ContentAlignment.TopCenter; // // label4 // - label4.Location = new System.Drawing.Point(334, 18); + label4.Location = new System.Drawing.Point(325, 18); label4.Name = "label4"; - label4.Size = new System.Drawing.Size(68, 16); + label4.Size = new System.Drawing.Size(83, 16); label4.TabIndex = 4; label4.Text = "Middle"; label4.TextAlign = System.Drawing.ContentAlignment.TopCenter; @@ -130,7 +147,7 @@ namespace CodeImp.DoomBuilder.Interface // label5.Location = new System.Drawing.Point(416, 18); label5.Name = "label5"; - label5.Size = new System.Drawing.Size(68, 16); + label5.Size = new System.Drawing.Size(83, 16); label5.TabIndex = 5; label5.Text = "Lower"; label5.TextAlign = System.Drawing.ContentAlignment.TopCenter; @@ -157,25 +174,25 @@ namespace CodeImp.DoomBuilder.Interface // label8.Location = new System.Drawing.Point(416, 18); label8.Name = "label8"; - label8.Size = new System.Drawing.Size(68, 16); + label8.Size = new System.Drawing.Size(83, 16); label8.TabIndex = 5; label8.Text = "Lower"; label8.TextAlign = System.Drawing.ContentAlignment.TopCenter; // // label9 // - label9.Location = new System.Drawing.Point(334, 18); + label9.Location = new System.Drawing.Point(325, 18); label9.Name = "label9"; - label9.Size = new System.Drawing.Size(68, 16); + label9.Size = new System.Drawing.Size(83, 16); label9.TabIndex = 4; label9.Text = "Middle"; label9.TextAlign = System.Drawing.ContentAlignment.TopCenter; // // label10 // - label10.Location = new System.Drawing.Point(252, 18); + label10.Location = new System.Drawing.Point(234, 18); label10.Name = "label10"; - label10.Size = new System.Drawing.Size(68, 16); + label10.Size = new System.Drawing.Size(83, 16); label10.TabIndex = 3; label10.Text = "Upper"; label10.TextAlign = System.Drawing.ContentAlignment.TopCenter; @@ -198,11 +215,70 @@ namespace CodeImp.DoomBuilder.Interface label12.TabIndex = 16; label12.Text = "Sector Index:"; // + // activationlabel + // + activationlabel.AutoSize = true; + activationlabel.Location = new System.Drawing.Point(6, 18); + activationlabel.Name = "activationlabel"; + activationlabel.Size = new System.Drawing.Size(44, 14); + activationlabel.TabIndex = 10; + activationlabel.Text = "Trigger:"; + // + // arg0label + // + this.arg0label.Location = new System.Drawing.Point(-36, 58); + this.arg0label.Name = "arg0label"; + this.arg0label.Size = new System.Drawing.Size(143, 14); + this.arg0label.TabIndex = 12; + this.arg0label.Text = "Argument 1:"; + this.arg0label.TextAlign = System.Drawing.ContentAlignment.TopRight; + this.arg0label.UseMnemonic = false; + // + // arg1label + // + this.arg1label.Location = new System.Drawing.Point(-36, 84); + this.arg1label.Name = "arg1label"; + this.arg1label.Size = new System.Drawing.Size(143, 14); + this.arg1label.TabIndex = 14; + this.arg1label.Text = "Argument 2:"; + this.arg1label.TextAlign = System.Drawing.ContentAlignment.TopRight; + this.arg1label.UseMnemonic = false; + // + // arg4label + // + this.arg4label.Location = new System.Drawing.Point(294, 58); + this.arg4label.Name = "arg4label"; + this.arg4label.Size = new System.Drawing.Size(143, 14); + this.arg4label.TabIndex = 16; + this.arg4label.Text = "Argument 5:"; + this.arg4label.TextAlign = System.Drawing.ContentAlignment.TopRight; + this.arg4label.UseMnemonic = false; + // + // arg2label + // + this.arg2label.Location = new System.Drawing.Point(130, 58); + this.arg2label.Name = "arg2label"; + this.arg2label.Size = new System.Drawing.Size(143, 14); + this.arg2label.TabIndex = 18; + this.arg2label.Text = "Argument 3:"; + this.arg2label.TextAlign = System.Drawing.ContentAlignment.TopRight; + this.arg2label.UseMnemonic = false; + // + // arg3label + // + this.arg3label.Location = new System.Drawing.Point(130, 84); + this.arg3label.Name = "arg3label"; + this.arg3label.Size = new System.Drawing.Size(143, 14); + this.arg3label.TabIndex = 20; + this.arg3label.Text = "Argument 4:"; + this.arg3label.TextAlign = System.Drawing.ContentAlignment.TopRight; + this.arg3label.UseMnemonic = false; + // // cancel // this.cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.cancel.Location = new System.Drawing.Point(421, 359); + this.cancel.Location = new System.Drawing.Point(439, 402); this.cancel.Name = "cancel"; this.cancel.Size = new System.Drawing.Size(112, 25); this.cancel.TabIndex = 17; @@ -213,7 +289,7 @@ namespace CodeImp.DoomBuilder.Interface // apply // this.apply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.apply.Location = new System.Drawing.Point(302, 359); + this.apply.Location = new System.Drawing.Point(320, 402); this.apply.Name = "apply"; this.apply.Size = new System.Drawing.Size(112, 25); this.apply.TabIndex = 16; @@ -225,37 +301,93 @@ namespace CodeImp.DoomBuilder.Interface // this.actiongroup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.actiongroup.Controls.Add(this.hexenpanel); this.actiongroup.Controls.Add(label2); - this.actiongroup.Controls.Add(this.newtag); - this.actiongroup.Controls.Add(this.tag); - this.actiongroup.Controls.Add(label1); this.actiongroup.Controls.Add(this.action); this.actiongroup.Controls.Add(this.browseaction); + this.actiongroup.Controls.Add(this.doompanel); this.actiongroup.Location = new System.Drawing.Point(8, 169); this.actiongroup.Name = "actiongroup"; - this.actiongroup.Size = new System.Drawing.Size(499, 128); + this.actiongroup.Size = new System.Drawing.Size(517, 171); this.actiongroup.TabIndex = 18; this.actiongroup.TabStop = false; this.actiongroup.Text = " Action "; // - // newtag + // hexenpanel // - this.newtag.Location = new System.Drawing.Point(136, 74); - this.newtag.Name = "newtag"; - this.newtag.Size = new System.Drawing.Size(76, 23); - this.newtag.TabIndex = 8; - this.newtag.Text = "New Tag"; - this.newtag.UseVisualStyleBackColor = true; - this.newtag.Click += new System.EventHandler(this.newtag_Click); + this.hexenpanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.hexenpanel.Controls.Add(this.arg3); + this.hexenpanel.Controls.Add(this.arg2); + this.hexenpanel.Controls.Add(this.arg4); + this.hexenpanel.Controls.Add(this.arg1); + this.hexenpanel.Controls.Add(this.arg0); + this.hexenpanel.Controls.Add(this.activation); + this.hexenpanel.Controls.Add(activationlabel); + this.hexenpanel.Controls.Add(this.arg1label); + this.hexenpanel.Controls.Add(this.arg0label); + this.hexenpanel.Controls.Add(this.arg3label); + this.hexenpanel.Controls.Add(this.arg2label); + this.hexenpanel.Controls.Add(this.arg4label); + this.hexenpanel.Location = new System.Drawing.Point(6, 54); + this.hexenpanel.Name = "hexenpanel"; + this.hexenpanel.Size = new System.Drawing.Size(505, 111); + this.hexenpanel.TabIndex = 13; // - // tag + // arg3 // - this.tag.AllowNegative = false; - this.tag.AllowRelative = true; - this.tag.Location = new System.Drawing.Point(62, 75); - this.tag.Name = "tag"; - this.tag.Size = new System.Drawing.Size(68, 20); - this.tag.TabIndex = 7; + this.arg3.AllowNegative = false; + this.arg3.AllowRelative = true; + this.arg3.Location = new System.Drawing.Point(279, 81); + this.arg3.Name = "arg3"; + this.arg3.Size = new System.Drawing.Size(50, 20); + this.arg3.TabIndex = 21; + // + // arg2 + // + this.arg2.AllowNegative = false; + this.arg2.AllowRelative = true; + this.arg2.Location = new System.Drawing.Point(279, 55); + this.arg2.Name = "arg2"; + this.arg2.Size = new System.Drawing.Size(50, 20); + this.arg2.TabIndex = 19; + // + // arg4 + // + this.arg4.AllowNegative = false; + this.arg4.AllowRelative = true; + this.arg4.Location = new System.Drawing.Point(443, 55); + this.arg4.Name = "arg4"; + this.arg4.Size = new System.Drawing.Size(50, 20); + this.arg4.TabIndex = 17; + // + // arg1 + // + this.arg1.AllowNegative = false; + this.arg1.AllowRelative = true; + this.arg1.Location = new System.Drawing.Point(113, 81); + this.arg1.Name = "arg1"; + this.arg1.Size = new System.Drawing.Size(50, 20); + this.arg1.TabIndex = 15; + // + // arg0 + // + this.arg0.AllowNegative = false; + this.arg0.AllowRelative = true; + this.arg0.Location = new System.Drawing.Point(113, 55); + this.arg0.Name = "arg0"; + this.arg0.Size = new System.Drawing.Size(50, 20); + this.arg0.TabIndex = 13; + // + // activation + // + this.activation.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.activation.FormattingEnabled = true; + this.activation.Location = new System.Drawing.Point(56, 14); + this.activation.Name = "activation"; + this.activation.Size = new System.Drawing.Size(437, 22); + this.activation.TabIndex = 11; // // action // @@ -264,21 +396,55 @@ namespace CodeImp.DoomBuilder.Interface this.action.Empty = false; this.action.Location = new System.Drawing.Point(62, 27); this.action.Name = "action"; - this.action.Size = new System.Drawing.Size(386, 21); + this.action.Size = new System.Drawing.Size(401, 21); this.action.TabIndex = 5; this.action.Value = 402; + this.action.ValueChanges += new System.EventHandler(this.action_ValueChanges); // // browseaction // this.browseaction.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.browseaction.Image = global::CodeImp.DoomBuilder.Properties.Resources.treeview; - this.browseaction.Location = new System.Drawing.Point(454, 26); + this.browseaction.Location = new System.Drawing.Point(469, 26); this.browseaction.Name = "browseaction"; this.browseaction.Padding = new System.Windows.Forms.Padding(0, 0, 1, 3); this.browseaction.Size = new System.Drawing.Size(30, 23); this.browseaction.TabIndex = 3; this.browseaction.Text = " "; this.browseaction.UseVisualStyleBackColor = true; + this.browseaction.Click += new System.EventHandler(this.browseaction_Click); + // + // doompanel + // + this.doompanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.doompanel.Controls.Add(this.tag); + this.doompanel.Controls.Add(taglabel); + this.doompanel.Controls.Add(this.newtag); + this.doompanel.Location = new System.Drawing.Point(6, 54); + this.doompanel.Name = "doompanel"; + this.doompanel.Size = new System.Drawing.Size(505, 111); + this.doompanel.TabIndex = 12; + // + // tag + // + this.tag.AllowNegative = false; + this.tag.AllowRelative = true; + this.tag.Location = new System.Drawing.Point(56, 19); + this.tag.Name = "tag"; + this.tag.Size = new System.Drawing.Size(68, 20); + this.tag.TabIndex = 7; + // + // newtag + // + this.newtag.Location = new System.Drawing.Point(130, 18); + this.newtag.Name = "newtag"; + this.newtag.Size = new System.Drawing.Size(76, 23); + this.newtag.TabIndex = 8; + this.newtag.Text = "New Tag"; + this.newtag.UseVisualStyleBackColor = true; + this.newtag.Click += new System.EventHandler(this.newtag_Click); // // settingsgroup // @@ -287,7 +453,7 @@ namespace CodeImp.DoomBuilder.Interface this.settingsgroup.Controls.Add(this.flags); this.settingsgroup.Location = new System.Drawing.Point(8, 8); this.settingsgroup.Name = "settingsgroup"; - this.settingsgroup.Size = new System.Drawing.Size(499, 152); + this.settingsgroup.Size = new System.Drawing.Size(517, 152); this.settingsgroup.TabIndex = 19; this.settingsgroup.TabStop = false; this.settingsgroup.Text = " Settings "; @@ -298,7 +464,7 @@ namespace CodeImp.DoomBuilder.Interface this.flags.Columns = 3; this.flags.Location = new System.Drawing.Point(18, 26); this.flags.Name = "flags"; - this.flags.Size = new System.Drawing.Size(475, 119); + this.flags.Size = new System.Drawing.Size(493, 119); this.flags.TabIndex = 0; // // checkBox1 @@ -322,7 +488,7 @@ namespace CodeImp.DoomBuilder.Interface this.tabs.Margin = new System.Windows.Forms.Padding(1); this.tabs.Name = "tabs"; this.tabs.SelectedIndex = 0; - this.tabs.Size = new System.Drawing.Size(523, 332); + this.tabs.Size = new System.Drawing.Size(541, 375); this.tabs.SizeMode = System.Windows.Forms.TabSizeMode.Fixed; this.tabs.TabIndex = 20; // @@ -334,7 +500,7 @@ namespace CodeImp.DoomBuilder.Interface this.tabPage1.Location = new System.Drawing.Point(4, 23); this.tabPage1.Name = "tabPage1"; this.tabPage1.Padding = new System.Windows.Forms.Padding(5); - this.tabPage1.Size = new System.Drawing.Size(515, 305); + this.tabPage1.Size = new System.Drawing.Size(533, 348); this.tabPage1.TabIndex = 0; this.tabPage1.Text = "Properties"; this.tabPage1.UseVisualStyleBackColor = true; @@ -349,7 +515,7 @@ namespace CodeImp.DoomBuilder.Interface this.tabPage2.Location = new System.Drawing.Point(4, 23); this.tabPage2.Name = "tabPage2"; this.tabPage2.Padding = new System.Windows.Forms.Padding(5); - this.tabPage2.Size = new System.Drawing.Size(515, 305); + this.tabPage2.Size = new System.Drawing.Size(533, 348); this.tabPage2.TabIndex = 1; this.tabPage2.Text = "Sidedefs"; this.tabPage2.UseVisualStyleBackColor = true; @@ -357,7 +523,7 @@ namespace CodeImp.DoomBuilder.Interface // backside // this.backside.AutoSize = true; - this.backside.Location = new System.Drawing.Point(20, 155); + this.backside.Location = new System.Drawing.Point(20, 176); this.backside.Name = "backside"; this.backside.Size = new System.Drawing.Size(74, 18); this.backside.TabIndex = 2; @@ -379,9 +545,9 @@ namespace CodeImp.DoomBuilder.Interface this.backgroup.Controls.Add(label9); this.backgroup.Controls.Add(label10); this.backgroup.Enabled = false; - this.backgroup.Location = new System.Drawing.Point(8, 157); + this.backgroup.Location = new System.Drawing.Point(8, 179); this.backgroup.Name = "backgroup"; - this.backgroup.Size = new System.Drawing.Size(499, 140); + this.backgroup.Size = new System.Drawing.Size(517, 161); this.backgroup.TabIndex = 1; this.backgroup.TabStop = false; this.backgroup.Text = " "; @@ -401,25 +567,25 @@ namespace CodeImp.DoomBuilder.Interface this.backlow.Location = new System.Drawing.Point(416, 37); this.backlow.Name = "backlow"; this.backlow.Required = false; - this.backlow.Size = new System.Drawing.Size(68, 84); + this.backlow.Size = new System.Drawing.Size(83, 107); this.backlow.TabIndex = 15; this.backlow.TextureName = ""; // // backmid // - this.backmid.Location = new System.Drawing.Point(334, 37); + this.backmid.Location = new System.Drawing.Point(325, 37); this.backmid.Name = "backmid"; this.backmid.Required = false; - this.backmid.Size = new System.Drawing.Size(68, 84); + this.backmid.Size = new System.Drawing.Size(83, 107); this.backmid.TabIndex = 14; this.backmid.TextureName = ""; // // backhigh // - this.backhigh.Location = new System.Drawing.Point(252, 37); + this.backhigh.Location = new System.Drawing.Point(234, 37); this.backhigh.Name = "backhigh"; this.backhigh.Required = false; - this.backhigh.Size = new System.Drawing.Size(68, 84); + this.backhigh.Size = new System.Drawing.Size(83, 107); this.backhigh.TabIndex = 13; this.backhigh.TextureName = ""; // @@ -470,7 +636,7 @@ namespace CodeImp.DoomBuilder.Interface this.frontgroup.Enabled = false; this.frontgroup.Location = new System.Drawing.Point(8, 8); this.frontgroup.Name = "frontgroup"; - this.frontgroup.Size = new System.Drawing.Size(499, 140); + this.frontgroup.Size = new System.Drawing.Size(517, 161); this.frontgroup.TabIndex = 0; this.frontgroup.TabStop = false; this.frontgroup.Text = " "; @@ -490,25 +656,25 @@ namespace CodeImp.DoomBuilder.Interface this.frontlow.Location = new System.Drawing.Point(416, 37); this.frontlow.Name = "frontlow"; this.frontlow.Required = false; - this.frontlow.Size = new System.Drawing.Size(68, 84); + this.frontlow.Size = new System.Drawing.Size(83, 107); this.frontlow.TabIndex = 12; this.frontlow.TextureName = ""; // // frontmid // - this.frontmid.Location = new System.Drawing.Point(334, 37); + this.frontmid.Location = new System.Drawing.Point(325, 37); this.frontmid.Name = "frontmid"; this.frontmid.Required = false; - this.frontmid.Size = new System.Drawing.Size(68, 84); + this.frontmid.Size = new System.Drawing.Size(83, 107); this.frontmid.TabIndex = 11; this.frontmid.TextureName = ""; // // fronthigh // - this.fronthigh.Location = new System.Drawing.Point(252, 37); + this.fronthigh.Location = new System.Drawing.Point(234, 37); this.fronthigh.Name = "fronthigh"; this.fronthigh.Required = false; - this.fronthigh.Size = new System.Drawing.Size(68, 84); + this.fronthigh.Size = new System.Drawing.Size(83, 107); this.fronthigh.TabIndex = 10; this.fronthigh.TextureName = ""; // @@ -537,7 +703,7 @@ namespace CodeImp.DoomBuilder.Interface this.AcceptButton = this.apply; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.CancelButton = this.cancel; - this.ClientSize = new System.Drawing.Size(543, 394); + this.ClientSize = new System.Drawing.Size(561, 437); this.Controls.Add(this.tabs); this.Controls.Add(this.cancel); this.Controls.Add(this.apply); @@ -552,6 +718,10 @@ namespace CodeImp.DoomBuilder.Interface this.Text = "Edit Linedefs"; this.actiongroup.ResumeLayout(false); this.actiongroup.PerformLayout(); + this.hexenpanel.ResumeLayout(false); + this.hexenpanel.PerformLayout(); + this.doompanel.ResumeLayout(false); + this.doompanel.PerformLayout(); this.settingsgroup.ResumeLayout(false); this.tabs.ResumeLayout(false); this.tabPage1.ResumeLayout(false); @@ -596,5 +766,18 @@ namespace CodeImp.DoomBuilder.Interface private TextureSelectorControl backhigh; private NumericTextbox backsector; private NumericTextbox frontsector; + private System.Windows.Forms.ComboBox activation; + private System.Windows.Forms.Panel doompanel; + private System.Windows.Forms.Panel hexenpanel; + private NumericTextbox arg3; + private NumericTextbox arg2; + private NumericTextbox arg4; + private NumericTextbox arg1; + private NumericTextbox arg0; + private System.Windows.Forms.Label arg0label; + private System.Windows.Forms.Label arg1label; + private System.Windows.Forms.Label arg4label; + private System.Windows.Forms.Label arg2label; + private System.Windows.Forms.Label arg3label; } } \ No newline at end of file diff --git a/Source/Interface/LinedefEditForm.cs b/Source/Interface/LinedefEditForm.cs index 129bba9d..7d2d30fa 100644 --- a/Source/Interface/LinedefEditForm.cs +++ b/Source/Interface/LinedefEditForm.cs @@ -44,12 +44,15 @@ namespace CodeImp.DoomBuilder.Interface // Initialize InitializeComponent(); - // Fill linedef flags list + // Fill flags list foreach(KeyValuePair lf in General.Map.Config.LinedefFlags) flags.Add(lf.Value, lf.Key); - // Fill linedef actions list + // Fill actions list action.AddInfo(General.Map.Config.SortedLinedefActions.ToArray()); + // Fill activations list + activation.Items.AddRange(General.Map.Config.LinedefActivates.ToArray()); + // Initialize image selectors fronthigh.Initialize(); frontmid.Initialize(); @@ -57,11 +60,16 @@ namespace CodeImp.DoomBuilder.Interface backhigh.Initialize(); backmid.Initialize(); backlow.Initialize(); + + // Show appropriate panel + doompanel.Visible = General.Map.IsType(typeof(DoomMapSetIO)); + hexenpanel.Visible = General.Map.IsType(typeof(HexenMapSetIO)); } // This sets up the form to edit the given lines public void Setup(ICollection lines) { + LinedefActivateInfo sai; Linedef fl; // Keep this list @@ -78,10 +86,19 @@ namespace CodeImp.DoomBuilder.Interface foreach(CheckBox c in flags.Checkboxes) c.Checked = (fl.Flags & (int)c.Tag) != 0; - // Action/activation/tags + // Activations + foreach(LinedefActivateInfo ai in activation.Items) + if((fl.Flags & ai.Index) == ai.Index) activation.SelectedItem = ai; + + // Action/tags action.Value = fl.Action; tag.Text = fl.Tag.ToString(); - + arg0.Text = fl.Args[0].ToString(); + arg1.Text = fl.Args[1].ToString(); + arg2.Text = fl.Args[2].ToString(); + arg3.Text = fl.Args[3].ToString(); + arg4.Text = fl.Args[4].ToString(); + // Front side and back side checkboxes frontside.Checked = (fl.Front != null); backside.Checked = (fl.Back != null); @@ -125,9 +142,23 @@ namespace CodeImp.DoomBuilder.Interface } } - // Action/activation/tags + // Activations + if(activation.Items.Count > 0) + { + sai = (activation.Items[0] as LinedefActivateInfo); + foreach(LinedefActivateInfo ai in activation.Items) + if((l.Flags & ai.Index) == ai.Index) sai = ai; + if(sai != activation.SelectedItem) activation.SelectedIndex = -1; + } + + // Action/tags if(l.Action != action.Value) action.Empty = true; if(l.Tag.ToString() != tag.Text) tag.Text = ""; + if(l.Args[0].ToString() != arg0.Text) arg0.Text = ""; + if(l.Args[1].ToString() != arg1.Text) arg1.Text = ""; + if(l.Args[2].ToString() != arg2.Text) arg2.Text = ""; + if(l.Args[3].ToString() != arg3.Text) arg3.Text = ""; + if(l.Args[4].ToString() != arg4.Text) arg4.Text = ""; // Front side checkbox if((l.Front != null) != frontside.Checked) @@ -205,6 +236,10 @@ namespace CodeImp.DoomBuilder.Interface // Go for all the lines foreach(Linedef l in lines) { + // Remove activation flags + if(activation.SelectedIndex > -1) + foreach(LinedefActivateInfo ai in activation.Items) l.Flags &= ~ai.Index; + // Apply all flags foreach(CheckBox c in flags.Checkboxes) { @@ -212,9 +247,18 @@ namespace CodeImp.DoomBuilder.Interface else if(c.CheckState == CheckState.Unchecked) l.Flags &= ~(int)c.Tag; } - // Action/activation/tags + // Apply chosen activation flag + if(activation.SelectedIndex > -1) + l.Flags |= (activation.SelectedItem as LinedefActivateInfo).Index; + + // Action/tags if(!action.Empty) l.Action = action.Value; l.Tag = tag.GetResult(l.Tag); + l.Args[0] = (byte)arg0.GetResult(l.Args[0]); + l.Args[1] = (byte)arg1.GetResult(l.Args[1]); + l.Args[2] = (byte)arg2.GetResult(l.Args[2]); + l.Args[3] = (byte)arg3.GetResult(l.Args[3]); + l.Args[4] = (byte)arg4.GetResult(l.Args[4]); // Remove front side? if((l.Front != null) && (frontside.CheckState == CheckState.Unchecked)) @@ -222,7 +266,7 @@ namespace CodeImp.DoomBuilder.Interface l.Front.Dispose(); } // Create or modify front side? - if(frontside.CheckState == CheckState.Checked) + else if(frontside.CheckState == CheckState.Checked) { // Make sure we have a valid sector (make a new one if needed) if(l.Front != null) index = l.Front.Sector.Index; else index = -1; @@ -249,7 +293,7 @@ namespace CodeImp.DoomBuilder.Interface l.Back.Dispose(); } // Create or modify back side? - if(backside.CheckState == CheckState.Checked) + else if(backside.CheckState == CheckState.Checked) { // Make sure we have a valid sector (make a new one if needed) if(l.Back != null) index = l.Back.Sector.Index; else index = -1; @@ -289,5 +333,37 @@ namespace CodeImp.DoomBuilder.Interface { tag.Text = General.Map.Map.GetNewTag().ToString(); } + + // Action changes + private void action_ValueChanges(object sender, EventArgs e) + { + int showaction = 0; + + // Only when line type is known + if(General.Map.Config.LinedefActions.ContainsKey(action.Value)) showaction = action.Value; + + // Change the argument descriptions + arg0label.Text = General.Map.Config.LinedefActions[showaction].ArgTitle[0] + ":"; + arg1label.Text = General.Map.Config.LinedefActions[showaction].ArgTitle[1] + ":"; + arg2label.Text = General.Map.Config.LinedefActions[showaction].ArgTitle[2] + ":"; + arg3label.Text = General.Map.Config.LinedefActions[showaction].ArgTitle[3] + ":"; + arg4label.Text = General.Map.Config.LinedefActions[showaction].ArgTitle[4] + ":"; + arg0label.Enabled = General.Map.Config.LinedefActions[showaction].ArgUsed[0]; + arg1label.Enabled = General.Map.Config.LinedefActions[showaction].ArgUsed[1]; + arg2label.Enabled = General.Map.Config.LinedefActions[showaction].ArgUsed[2]; + arg3label.Enabled = General.Map.Config.LinedefActions[showaction].ArgUsed[3]; + arg4label.Enabled = General.Map.Config.LinedefActions[showaction].ArgUsed[4]; + if(arg0label.Enabled) arg0.ForeColor = SystemColors.WindowText; else arg0.ForeColor = SystemColors.GrayText; + if(arg1label.Enabled) arg1.ForeColor = SystemColors.WindowText; else arg1.ForeColor = SystemColors.GrayText; + if(arg2label.Enabled) arg2.ForeColor = SystemColors.WindowText; else arg2.ForeColor = SystemColors.GrayText; + if(arg3label.Enabled) arg3.ForeColor = SystemColors.WindowText; else arg3.ForeColor = SystemColors.GrayText; + if(arg4label.Enabled) arg4.ForeColor = SystemColors.WindowText; else arg4.ForeColor = SystemColors.GrayText; + } + + // Browse Action clicked + private void browseaction_Click(object sender, EventArgs e) + { + action.Value = ActionBrowserForm.BrowseAction(this, action.Value); + } } } diff --git a/Source/Interface/LinedefEditForm.resx b/Source/Interface/LinedefEditForm.resx index c3d5c63e..431d6624 100644 --- a/Source/Interface/LinedefEditForm.resx +++ b/Source/Interface/LinedefEditForm.resx @@ -123,10 +123,10 @@ False - + True - + False @@ -189,6 +189,27 @@ False + + True + + + False + + + True + + + True + + + True + + + True + + + True + True @@ -198,10 +219,25 @@ True - + True - + + True + + + True + + + True + + + True + + + True + + True @@ -210,6 +246,15 @@ True + + True + + + True + + + True + True diff --git a/Source/Interface/PreferencesForm.Designer.cs b/Source/Interface/PreferencesForm.Designer.cs index 0b038f91..f6ea04de 100644 --- a/Source/Interface/PreferencesForm.Designer.cs +++ b/Source/Interface/PreferencesForm.Designer.cs @@ -598,6 +598,7 @@ namespace CodeImp.DoomBuilder.Interface this.Controls.Add(this.cancel); this.Controls.Add(this.apply); this.Controls.Add(this.tabs); + this.DoubleBuffered = true; 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; diff --git a/Source/Interface/ResourceOptionsForm.Designer.cs b/Source/Interface/ResourceOptionsForm.Designer.cs index 766ece24..7b138aaa 100644 --- a/Source/Interface/ResourceOptionsForm.Designer.cs +++ b/Source/Interface/ResourceOptionsForm.Designer.cs @@ -271,7 +271,6 @@ namespace CodeImp.DoomBuilder.Interface this.Controls.Add(this.cancel); this.Controls.Add(this.apply); this.Controls.Add(this.tabs); - this.DoubleBuffered = true; 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; diff --git a/Source/Map/Linedef.cs b/Source/Map/Linedef.cs index f1974b71..a26b3f60 100644 --- a/Source/Map/Linedef.cs +++ b/Source/Map/Linedef.cs @@ -554,7 +554,8 @@ namespace CodeImp.DoomBuilder.Map this.flags = flags; this.tag = tag; this.action = action; - this.args = args; + this.args = new byte[NUM_ARGS]; + args.CopyTo(this.args, 0); this.updateneeded = true; } diff --git a/Source/Map/Thing.cs b/Source/Map/Thing.cs index b51f02b3..7053f29d 100644 --- a/Source/Map/Thing.cs +++ b/Source/Map/Thing.cs @@ -231,7 +231,8 @@ namespace CodeImp.DoomBuilder.Map this.flags = flags; this.tag = tag; this.action = action; - this.args = args; + this.args = new byte[NUM_ARGS]; + args.CopyTo(this.args, 0); this.Move(x, y, zoffset); }