diff --git a/Source/BuilderModes/ClassicModes/LinedefsMode.cs b/Source/BuilderModes/ClassicModes/LinedefsMode.cs index 3053dc30..b9a20ccf 100644 --- a/Source/BuilderModes/ClassicModes/LinedefsMode.cs +++ b/Source/BuilderModes/ClassicModes/LinedefsMode.cs @@ -529,6 +529,42 @@ namespace CodeImp.DoomBuilder.BuilderModes #region ================== Actions + // This keeps only the single-sided lines selected + [BeginAction("selectsinglesided")] + public void SelectSingleSided() + { + int counter = 0; + ICollection selected = General.Map.Map.GetSelectedLinedefs(true); + foreach(Linedef ld in selected) + { + if((ld.Front != null) && (ld.Back != null)) + ld.Selected = false; + else + counter++; + } + + General.Interface.DisplayStatus(StatusType.Action, "Selected only single-sided linedefs (" + counter + ")"); + General.Interface.RedrawDisplay(); + } + + // This keeps only the double-sided lines selected + [BeginAction("selectdoublesided")] + public void SelectDoubleSided() + { + int counter = 0; + ICollection selected = General.Map.Map.GetSelectedLinedefs(true); + foreach(Linedef ld in selected) + { + if((ld.Front == null) || (ld.Back == null)) + ld.Selected = false; + else + counter++; + } + + General.Interface.DisplayStatus(StatusType.Action, "Selected only double-sided linedefs (" + counter + ")"); + General.Interface.RedrawDisplay(); + } + // This clears the selection [BeginAction("clearselection", BaseAction = true)] public void ClearSelection() diff --git a/Source/BuilderModes/Interface/MenusForm.Designer.cs b/Source/BuilderModes/Interface/MenusForm.Designer.cs index d68e0bad..1bda3a88 100644 --- a/Source/BuilderModes/Interface/MenusForm.Designer.cs +++ b/Source/BuilderModes/Interface/MenusForm.Designer.cs @@ -43,6 +43,9 @@ namespace CodeImp.DoomBuilder.BuilderModes this.globalstrip = new System.Windows.Forms.ToolStrip(); this.manualstrip = new System.Windows.Forms.ToolStrip(); this.buttonbrightnessgradient = new System.Windows.Forms.ToolStripButton(); + this.selectsinglesideditem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripSeparator(); + this.selectdoublesideditem = new System.Windows.Forms.ToolStripMenuItem(); this.menustrip.SuspendLayout(); this.manualstrip.SuspendLayout(); this.SuspendLayout(); @@ -61,6 +64,9 @@ namespace CodeImp.DoomBuilder.BuilderModes // linedefsmenu // this.linedefsmenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.selectsinglesideditem, + this.selectdoublesideditem, + this.toolStripMenuItem4, this.fliplinedefsitem, this.flipsidedefsitem, this.toolStripMenuItem1, @@ -75,7 +81,7 @@ namespace CodeImp.DoomBuilder.BuilderModes // fliplinedefsitem // this.fliplinedefsitem.Name = "fliplinedefsitem"; - this.fliplinedefsitem.Size = new System.Drawing.Size(169, 22); + this.fliplinedefsitem.Size = new System.Drawing.Size(202, 22); this.fliplinedefsitem.Tag = "fliplinedefs"; this.fliplinedefsitem.Text = "Flip Linedefs"; this.fliplinedefsitem.Click += new System.EventHandler(this.InvokeTaggedAction); @@ -83,7 +89,7 @@ namespace CodeImp.DoomBuilder.BuilderModes // flipsidedefsitem // this.flipsidedefsitem.Name = "flipsidedefsitem"; - this.flipsidedefsitem.Size = new System.Drawing.Size(169, 22); + this.flipsidedefsitem.Size = new System.Drawing.Size(202, 22); this.flipsidedefsitem.Tag = "flipsidedefs"; this.flipsidedefsitem.Text = "Flip Sidedefs"; this.flipsidedefsitem.Click += new System.EventHandler(this.InvokeTaggedAction); @@ -91,12 +97,12 @@ namespace CodeImp.DoomBuilder.BuilderModes // toolStripMenuItem1 // this.toolStripMenuItem1.Name = "toolStripMenuItem1"; - this.toolStripMenuItem1.Size = new System.Drawing.Size(166, 6); + this.toolStripMenuItem1.Size = new System.Drawing.Size(199, 6); // // curvelinedefsitem // this.curvelinedefsitem.Name = "curvelinedefsitem"; - this.curvelinedefsitem.Size = new System.Drawing.Size(169, 22); + this.curvelinedefsitem.Size = new System.Drawing.Size(202, 22); this.curvelinedefsitem.Tag = "curvelinesmode"; this.curvelinedefsitem.Text = "Curve Linedefs..."; this.curvelinedefsitem.Click += new System.EventHandler(this.InvokeTaggedAction); @@ -104,12 +110,12 @@ namespace CodeImp.DoomBuilder.BuilderModes // toolStripMenuItem3 // this.toolStripMenuItem3.Name = "toolStripMenuItem3"; - this.toolStripMenuItem3.Size = new System.Drawing.Size(166, 6); + this.toolStripMenuItem3.Size = new System.Drawing.Size(199, 6); // // splitlinedefsitem // this.splitlinedefsitem.Name = "splitlinedefsitem"; - this.splitlinedefsitem.Size = new System.Drawing.Size(169, 22); + this.splitlinedefsitem.Size = new System.Drawing.Size(202, 22); this.splitlinedefsitem.Tag = "splitlinedefs"; this.splitlinedefsitem.Text = "Split Linedefs"; this.splitlinedefsitem.Click += new System.EventHandler(this.InvokeTaggedAction); @@ -176,6 +182,27 @@ namespace CodeImp.DoomBuilder.BuilderModes this.buttonbrightnessgradient.Text = "Make Brightness Gradient"; this.buttonbrightnessgradient.Click += new System.EventHandler(this.InvokeTaggedAction); // + // selectsinglesideditem + // + this.selectsinglesideditem.Name = "selectsinglesideditem"; + this.selectsinglesideditem.Size = new System.Drawing.Size(202, 22); + this.selectsinglesideditem.Tag = "selectsinglesided"; + this.selectsinglesideditem.Text = "Select Single-sided only"; + this.selectsinglesideditem.Click += new System.EventHandler(this.InvokeTaggedAction); + // + // toolStripMenuItem4 + // + this.toolStripMenuItem4.Name = "toolStripMenuItem4"; + this.toolStripMenuItem4.Size = new System.Drawing.Size(199, 6); + // + // selectdoublesideditem + // + this.selectdoublesideditem.Name = "selectdoublesideditem"; + this.selectdoublesideditem.Size = new System.Drawing.Size(202, 22); + this.selectdoublesideditem.Tag = "selectdoublesided"; + this.selectdoublesideditem.Text = "Select Double-sided only"; + this.selectdoublesideditem.Click += new System.EventHandler(this.InvokeTaggedAction); + // // MenusForm // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); @@ -219,5 +246,8 @@ namespace CodeImp.DoomBuilder.BuilderModes private System.Windows.Forms.ToolStrip globalstrip; private System.Windows.Forms.ToolStrip manualstrip; private System.Windows.Forms.ToolStripButton buttonbrightnessgradient; + private System.Windows.Forms.ToolStripMenuItem selectsinglesideditem; + private System.Windows.Forms.ToolStripMenuItem selectdoublesideditem; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem4; } } \ No newline at end of file diff --git a/Source/BuilderModes/Interface/MenusForm.resx b/Source/BuilderModes/Interface/MenusForm.resx index d0d5fc52..0c3d973e 100644 --- a/Source/BuilderModes/Interface/MenusForm.resx +++ b/Source/BuilderModes/Interface/MenusForm.resx @@ -117,13 +117,25 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + True + 17, 17 + + True + 118, 17 + + True + 210, 17 + + True + \ No newline at end of file diff --git a/Source/BuilderModes/Resources/Actions.cfg b/Source/BuilderModes/Resources/Actions.cfg index 97e5b5a5..b85136c5 100644 --- a/Source/BuilderModes/Resources/Actions.cfg +++ b/Source/BuilderModes/Resources/Actions.cfg @@ -148,6 +148,28 @@ triangulatormode debugonly = true; } +selectsinglesided +{ + title = "Select Single-sided"; + category = "linedefs"; + description = "This keeps only the single-sided lines in your selection selected."; + allowkeys = true; + allowmouse = true; + allowscroll = true; + default = 65585; +} + +selectdoublesided +{ + title = "Select Double-sided"; + category = "linedefs"; + description = "This keeps only the double-sided lines in your selection selected."; + allowkeys = true; + allowmouse = true; + allowscroll = true; + default = 65586; +} + fliplinedefs { title = "Flip Linedefs"; diff --git a/Source/Resources/Actions.cfg b/Source/Resources/Actions.cfg index d9a4705d..285a78ad 100644 --- a/Source/Resources/Actions.cfg +++ b/Source/Resources/Actions.cfg @@ -800,4 +800,5 @@ showerrors allowkeys = true; allowmouse = true; allowscroll = false; + default = 122; }