diff --git a/Resources/Icons/Selection.png b/Resources/Icons/Selection.png new file mode 100644 index 00000000..486d40ce Binary files /dev/null and b/Resources/Icons/Selection.png differ diff --git a/Resources/Icons/SelectionApply.png b/Resources/Icons/SelectionApply.png new file mode 100644 index 00000000..8bb24ee0 Binary files /dev/null and b/Resources/Icons/SelectionApply.png differ diff --git a/Resources/Icons/mergegeometry.png b/Resources/Icons/mergegeometry.png new file mode 100644 index 00000000..c9c44274 Binary files /dev/null and b/Resources/Icons/mergegeometry.png differ diff --git a/Resources/Icons/mergegeometry2.png b/Resources/Icons/mergegeometry2.png new file mode 100644 index 00000000..f8af3f15 Binary files /dev/null and b/Resources/Icons/mergegeometry2.png differ diff --git a/Resources/mergegeometry.cpt b/Resources/mergegeometry.cpt new file mode 100644 index 00000000..0a7b1f1b Binary files /dev/null and b/Resources/mergegeometry.cpt differ diff --git a/Source/Builder.csproj b/Source/Builder.csproj index 5cf1fbb8..c3328978 100644 --- a/Source/Builder.csproj +++ b/Source/Builder.csproj @@ -284,6 +284,8 @@ + + diff --git a/Source/Config/ProgramConfiguration.cs b/Source/Config/ProgramConfiguration.cs index e0455098..eb9cff57 100644 --- a/Source/Config/ProgramConfiguration.cs +++ b/Source/Config/ProgramConfiguration.cs @@ -43,6 +43,7 @@ namespace CodeImp.DoomBuilder.Config private Configuration cfg; // Cached variables + private int undolevels; private bool blackbrowsers; private float stitchdistance; @@ -51,6 +52,7 @@ namespace CodeImp.DoomBuilder.Config #region ================== Properties public Configuration Config { get { return cfg; } } + public int UndoLevels { get { return undolevels; } set { undolevels = value; } } public bool BlackBrowsers { get { return blackbrowsers; } set { blackbrowsers = value; } } public float StitchDistance { get { return stitchdistance; } set { stitchdistance = value; } } @@ -78,6 +80,7 @@ namespace CodeImp.DoomBuilder.Config // Read the cache variables blackbrowsers = cfg.ReadSetting("blackbrowsers", false); stitchdistance = cfg.ReadSetting("stitchdistance", 2.0f); + undolevels = cfg.ReadSetting("undolevels", 20); // Success return true; @@ -95,6 +98,7 @@ namespace CodeImp.DoomBuilder.Config // Write the cache variables cfg.WriteSetting("blackbrowsers", blackbrowsers); cfg.WriteSetting("stitchdistance", stitchdistance); + cfg.WriteSetting("undolevels", undolevels); // Save settings configuration General.WriteLogLine("Saving program configuration..."); diff --git a/Source/Controls/ActionManager.cs b/Source/Controls/ActionManager.cs index be0887bd..ffe71447 100644 --- a/Source/Controls/ActionManager.cs +++ b/Source/Controls/ActionManager.cs @@ -48,7 +48,7 @@ namespace CodeImp.DoomBuilder.Controls #region ================== Properties - public Action this[string action] { get { return actions[action]; } } + public Action this[string action] { get { if(actions.ContainsKey(action)) return actions[action]; else throw new ArgumentException("There is no such action \"" + action + "\""); } } public bool IsDisposed { get { return isdisposed; } } #endregion diff --git a/Source/Editing/DragVerticesMode.cs b/Source/Editing/DragVerticesMode.cs index 305cb36e..74597405 100644 --- a/Source/Editing/DragVerticesMode.cs +++ b/Source/Editing/DragVerticesMode.cs @@ -225,7 +225,6 @@ namespace CodeImp.DoomBuilder.Editing { ICollection movinglines; ICollection fixedlines; - ICollection changedlines; Rectangle editarea; int stitches = 0; int stitchundo; @@ -246,44 +245,45 @@ namespace CodeImp.DoomBuilder.Editing MoveGeometryRelative(mousemappos - dragstartmappos, snaptogrid, snaptonearest); // ===== BEGIN GEOMETRY STITCHING - - // Make undo for the stitching - stitchundo = General.Map.UndoRedo.CreateUndo("stitch geometry", UndoGroup.None, 0, false); + if(General.MainWindow.AutoMerge) + { + // Make undo for the stitching + stitchundo = General.Map.UndoRedo.CreateUndo("stitch geometry", UndoGroup.None, 0, false); - // Find lines that moved during the drag - movinglines = General.Map.Map.LinedefsFromSelectedVertices(false, true, true); - - // Find all non-moving lines - fixedlines = General.Map.Map.LinedefsFromSelectedVertices(true, false, false); - - // Determine area in which we are editing - editarea = MapSet.AreaFromLines(movinglines); - editarea.Inflate((int)Math.Ceiling(General.Settings.StitchDistance), - (int)Math.Ceiling(General.Settings.StitchDistance)); + // Find lines that moved during the drag + movinglines = General.Map.Map.LinedefsFromSelectedVertices(false, true, true); - // Join nearby vertices - stitches += MapSet.JoinVertices(unselectedverts, selectedverts, true, General.Settings.StitchDistance); + // Find all non-moving lines + fixedlines = General.Map.Map.LinedefsFromSelectedVertices(true, false, false); - // Update cached values - General.Map.Map.Update(); - - // Split moving lines with unselected vertices - unselectedverts = MapSet.FilterArea(unselectedverts, ref editarea); - stitches += MapSet.SplitLinesByVertices(movinglines, unselectedverts, General.Settings.StitchDistance, movinglines); - - // Split non-moving lines with selected vertices - fixedlines = MapSet.FilterArea(fixedlines, ref editarea); - stitches += MapSet.SplitLinesByVertices(fixedlines, selectedverts, General.Settings.StitchDistance, movinglines); + // Determine area in which we are editing + editarea = MapSet.AreaFromLines(movinglines); + editarea.Inflate((int)Math.Ceiling(General.Settings.StitchDistance), + (int)Math.Ceiling(General.Settings.StitchDistance)); - // Remove looped linedefs - stitches += MapSet.RemoveLoopedLinedefs(movinglines); + // Join nearby vertices + stitches += MapSet.JoinVertices(unselectedverts, selectedverts, true, General.Settings.StitchDistance); - // Join overlapping lines - stitches += MapSet.JoinOverlappingLines(movinglines); + // Update cached values + General.Map.Map.Update(); - // No stitching done? then withdraw undo - if(stitches == 0) General.Map.UndoRedo.WithdrawUndo(stitchundo); + // Split moving lines with unselected vertices + unselectedverts = MapSet.FilterArea(unselectedverts, ref editarea); + stitches += MapSet.SplitLinesByVertices(movinglines, unselectedverts, General.Settings.StitchDistance, movinglines); + // Split non-moving lines with selected vertices + fixedlines = MapSet.FilterArea(fixedlines, ref editarea); + stitches += MapSet.SplitLinesByVertices(fixedlines, selectedverts, General.Settings.StitchDistance, movinglines); + + // Remove looped linedefs + stitches += MapSet.RemoveLoopedLinedefs(movinglines); + + // Join overlapping lines + stitches += MapSet.JoinOverlappingLines(movinglines); + + // No stitching done? then withdraw undo + if(stitches == 0) General.Map.UndoRedo.WithdrawUndo(stitchundo); + } // ===== END GEOMETRY STITCHING // If only a single vertex was selected, deselect it now diff --git a/Source/Editing/UndoManager.cs b/Source/Editing/UndoManager.cs index 33c66e8c..5972fed0 100644 --- a/Source/Editing/UndoManager.cs +++ b/Source/Editing/UndoManager.cs @@ -44,8 +44,8 @@ namespace CodeImp.DoomBuilder.Editing #region ================== Variables // Undo and redo stacks - private Stack undos; - private Stack redos; + private List undos; + private List redos; // Grouping private UndoGroup lastgroup; @@ -61,8 +61,8 @@ namespace CodeImp.DoomBuilder.Editing #region ================== Properties - public UndoSnapshot NextUndo { get { if(undos.Count > 0) return undos.Peek(); else return null; } } - public UndoSnapshot NextRedo { get { if(redos.Count > 0) return redos.Peek(); else return null; } } + public UndoSnapshot NextUndo { get { if(undos.Count > 0) return undos[0]; else return null; } } + public UndoSnapshot NextRedo { get { if(redos.Count > 0) return redos[0]; else return null; } } public bool IsDisposed { get { return isdisposed; } } #endregion @@ -74,8 +74,8 @@ namespace CodeImp.DoomBuilder.Editing { // Initialize ticketid = 1; - undos = new Stack(); - redos = new Stack(); + undos = new List(General.Settings.UndoLevels + 1); + redos = new List(General.Settings.UndoLevels + 1); // Bind any methods ActionAttribute.BindMethods(this); @@ -122,6 +122,21 @@ namespace CodeImp.DoomBuilder.Editing undos.Clear(); } + // This checks and removes a level when the limit is reached + private void LimitUndoRedoLevel(List list) + { + UndoSnapshot u; + + // Too many? + if(list.Count > General.Settings.UndoLevels) + { + // Remove one and dispose map + u = list[list.Count - 1]; + u.map.Dispose(); + list.RemoveAt(list.Count - 1); + } + } + #endregion #region ================== Public Methods @@ -143,8 +158,9 @@ namespace CodeImp.DoomBuilder.Editing u = new UndoSnapshot(description, allow3dchange, General.Map.Map.Clone(), ticketid); // Put it on the stack - undos.Push(u); - + undos.Insert(0, u); + LimitUndoRedoLevel(undos); + // Clear all redos redos.Clear(); @@ -171,10 +187,10 @@ namespace CodeImp.DoomBuilder.Editing if(undos.Count > 0) { // Check if the ticket id matches - if(ticket == undos.Peek().ticketid) + if(ticket == undos[0].ticketid) { // Remove the last made undo - undos.Pop(); + undos.RemoveAt(0); // Update General.MainWindow.UpdateInterface(); @@ -192,14 +208,16 @@ namespace CodeImp.DoomBuilder.Editing if(undos.Count > 0) { // Get undo snapshot - u = undos.Pop(); + u = undos[0]; + undos.RemoveAt(0); // Make a snapshot for redo r = new UndoSnapshot(u, General.Map.Map.Clone()); // Put it on the stack - redos.Push(r); - + redos.Insert(0, r); + LimitUndoRedoLevel(redos); + // Reset grouping lastgroup = UndoGroup.None; @@ -222,14 +240,16 @@ namespace CodeImp.DoomBuilder.Editing if(redos.Count > 0) { // Get redo snapshot - r = redos.Pop(); + r = redos[0]; + redos.RemoveAt(0); // Make a snapshot for undo u = new UndoSnapshot(r, General.Map.Map.Clone()); // Put it on the stack - undos.Push(u); - + undos.Insert(0, u); + LimitUndoRedoLevel(undos); + // Reset grouping lastgroup = UndoGroup.None; diff --git a/Source/Interface/MainForm.Designer.cs b/Source/Interface/MainForm.Designer.cs index fffe11f0..240ff9f1 100644 --- a/Source/Interface/MainForm.Designer.cs +++ b/Source/Interface/MainForm.Designer.cs @@ -86,6 +86,7 @@ namespace CodeImp.DoomBuilder.Interface this.thingfilters = new System.Windows.Forms.ToolStripComboBox(); this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); this.buttonsnaptogrid = new System.Windows.Forms.ToolStripButton(); + this.buttonautomerge = new System.Windows.Forms.ToolStripButton(); this.statusbar = new System.Windows.Forms.StatusStrip(); this.statuslabel = new System.Windows.Forms.ToolStripStatusLabel(); this.gridlabel = new System.Windows.Forms.ToolStripStatusLabel(); @@ -118,6 +119,7 @@ namespace CodeImp.DoomBuilder.Interface this.linedefinfo = new CodeImp.DoomBuilder.Interface.LinedefInfoPanel(); this.redrawtimer = new System.Windows.Forms.Timer(this.components); this.display = new CodeImp.DoomBuilder.Interface.RenderTargetControl(); + this.itemautomerge = new System.Windows.Forms.ToolStripMenuItem(); toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator(); toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator(); @@ -174,7 +176,7 @@ namespace CodeImp.DoomBuilder.Interface // toolStripSeparator6 // toolStripSeparator6.Name = "toolStripSeparator6"; - toolStripSeparator6.Size = new System.Drawing.Size(158, 6); + toolStripSeparator6.Size = new System.Drawing.Size(162, 6); // // toolStripSeparator3 // @@ -197,7 +199,7 @@ namespace CodeImp.DoomBuilder.Interface // toolStripMenuItem5 // toolStripMenuItem5.Name = "toolStripMenuItem5"; - toolStripMenuItem5.Size = new System.Drawing.Size(158, 6); + toolStripMenuItem5.Size = new System.Drawing.Size(162, 6); // // toolStripSeparator10 // @@ -218,7 +220,7 @@ namespace CodeImp.DoomBuilder.Interface // toolStripSeparator11 // toolStripSeparator11.Name = "toolStripSeparator11"; - toolStripSeparator11.Size = new System.Drawing.Size(158, 6); + toolStripSeparator11.Size = new System.Drawing.Size(162, 6); // // poscommalabel // @@ -334,6 +336,7 @@ namespace CodeImp.DoomBuilder.Interface this.itemthingsmode, toolStripSeparator6, this.itemsnaptogrid, + this.itemautomerge, toolStripSeparator11, this.itemmapoptions}); this.menuedit.Name = "menuedit"; @@ -344,7 +347,7 @@ namespace CodeImp.DoomBuilder.Interface // this.itemundo.Image = global::CodeImp.DoomBuilder.Properties.Resources.Undo; this.itemundo.Name = "itemundo"; - this.itemundo.Size = new System.Drawing.Size(161, 22); + this.itemundo.Size = new System.Drawing.Size(165, 22); this.itemundo.Tag = "undo"; this.itemundo.Text = "Undo"; this.itemundo.Click += new System.EventHandler(this.InvokeTaggedAction); @@ -353,7 +356,7 @@ namespace CodeImp.DoomBuilder.Interface // this.itemredo.Image = global::CodeImp.DoomBuilder.Properties.Resources.Redo; this.itemredo.Name = "itemredo"; - this.itemredo.Size = new System.Drawing.Size(161, 22); + this.itemredo.Size = new System.Drawing.Size(165, 22); this.itemredo.Tag = "redo"; this.itemredo.Text = "Redo"; this.itemredo.Click += new System.EventHandler(this.InvokeTaggedAction); @@ -362,7 +365,7 @@ namespace CodeImp.DoomBuilder.Interface // this.itemverticesmode.Image = global::CodeImp.DoomBuilder.Properties.Resources.VerticesMode; this.itemverticesmode.Name = "itemverticesmode"; - this.itemverticesmode.Size = new System.Drawing.Size(161, 22); + this.itemverticesmode.Size = new System.Drawing.Size(165, 22); this.itemverticesmode.Tag = "verticesmode"; this.itemverticesmode.Text = "Vertices Mode"; this.itemverticesmode.Click += new System.EventHandler(this.InvokeTaggedAction); @@ -371,7 +374,7 @@ namespace CodeImp.DoomBuilder.Interface // this.itemlinedefsmode.Image = global::CodeImp.DoomBuilder.Properties.Resources.LinesMode; this.itemlinedefsmode.Name = "itemlinedefsmode"; - this.itemlinedefsmode.Size = new System.Drawing.Size(161, 22); + this.itemlinedefsmode.Size = new System.Drawing.Size(165, 22); this.itemlinedefsmode.Tag = "linedefsmode"; this.itemlinedefsmode.Text = "Linedefs Mode"; this.itemlinedefsmode.Click += new System.EventHandler(this.InvokeTaggedAction); @@ -380,7 +383,7 @@ namespace CodeImp.DoomBuilder.Interface // this.itemsectorsmode.Image = global::CodeImp.DoomBuilder.Properties.Resources.SectorsMode; this.itemsectorsmode.Name = "itemsectorsmode"; - this.itemsectorsmode.Size = new System.Drawing.Size(161, 22); + this.itemsectorsmode.Size = new System.Drawing.Size(165, 22); this.itemsectorsmode.Tag = "sectorsmode"; this.itemsectorsmode.Text = "Sectors Mode"; this.itemsectorsmode.Click += new System.EventHandler(this.InvokeTaggedAction); @@ -389,7 +392,7 @@ namespace CodeImp.DoomBuilder.Interface // this.itemthingsmode.Image = global::CodeImp.DoomBuilder.Properties.Resources.ThingsMode; this.itemthingsmode.Name = "itemthingsmode"; - this.itemthingsmode.Size = new System.Drawing.Size(161, 22); + this.itemthingsmode.Size = new System.Drawing.Size(165, 22); this.itemthingsmode.Tag = "thingsmode"; this.itemthingsmode.Text = "Things Mode"; this.itemthingsmode.Click += new System.EventHandler(this.InvokeTaggedAction); @@ -400,7 +403,7 @@ namespace CodeImp.DoomBuilder.Interface this.itemsnaptogrid.CheckState = System.Windows.Forms.CheckState.Checked; this.itemsnaptogrid.Image = global::CodeImp.DoomBuilder.Properties.Resources.Grid4; this.itemsnaptogrid.Name = "itemsnaptogrid"; - this.itemsnaptogrid.Size = new System.Drawing.Size(161, 22); + this.itemsnaptogrid.Size = new System.Drawing.Size(165, 22); this.itemsnaptogrid.Tag = "togglesnap"; this.itemsnaptogrid.Text = "Snap to Grid"; this.itemsnaptogrid.Click += new System.EventHandler(this.InvokeTaggedAction); @@ -409,7 +412,7 @@ namespace CodeImp.DoomBuilder.Interface // this.itemmapoptions.Image = global::CodeImp.DoomBuilder.Properties.Resources.Properties; this.itemmapoptions.Name = "itemmapoptions"; - this.itemmapoptions.Size = new System.Drawing.Size(161, 22); + this.itemmapoptions.Size = new System.Drawing.Size(165, 22); this.itemmapoptions.Tag = "mapoptions"; this.itemmapoptions.Text = "Map Options...."; this.itemmapoptions.Click += new System.EventHandler(this.InvokeTaggedAction); @@ -485,7 +488,8 @@ namespace CodeImp.DoomBuilder.Interface this.buttonthingsfilter, this.thingfilters, this.toolStripSeparator8, - this.buttonsnaptogrid}); + this.buttonsnaptogrid, + this.buttonautomerge}); this.toolbar.Location = new System.Drawing.Point(0, 24); this.toolbar.Name = "toolbar"; this.toolbar.Size = new System.Drawing.Size(839, 25); @@ -644,6 +648,19 @@ namespace CodeImp.DoomBuilder.Interface this.buttonsnaptogrid.Text = "Snap to Grid"; this.buttonsnaptogrid.Click += new System.EventHandler(this.InvokeTaggedAction); // + // buttonautomerge + // + this.buttonautomerge.Checked = true; + this.buttonautomerge.CheckState = System.Windows.Forms.CheckState.Checked; + this.buttonautomerge.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.buttonautomerge.Image = global::CodeImp.DoomBuilder.Properties.Resources.mergegeometry2; + this.buttonautomerge.ImageTransparentColor = System.Drawing.Color.Magenta; + this.buttonautomerge.Name = "buttonautomerge"; + this.buttonautomerge.Size = new System.Drawing.Size(23, 22); + this.buttonautomerge.Tag = "toggleautomerge"; + this.buttonautomerge.Text = "Merge Geometry"; + this.buttonautomerge.Click += new System.EventHandler(this.InvokeTaggedAction); + // // statusbar // this.statusbar.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); @@ -970,6 +987,17 @@ namespace CodeImp.DoomBuilder.Interface this.display.Paint += new System.Windows.Forms.PaintEventHandler(this.display_Paint); this.display.MouseUp += new System.Windows.Forms.MouseEventHandler(this.display_MouseUp); // + // itemautomerge + // + this.itemautomerge.Checked = true; + this.itemautomerge.CheckState = System.Windows.Forms.CheckState.Checked; + this.itemautomerge.Image = global::CodeImp.DoomBuilder.Properties.Resources.mergegeometry2; + this.itemautomerge.Name = "itemautomerge"; + this.itemautomerge.Size = new System.Drawing.Size(165, 22); + this.itemautomerge.Tag = "toggleautomerge"; + this.itemautomerge.Text = "Merge Geometry"; + this.itemautomerge.Click += new System.EventHandler(this.InvokeTaggedAction); + // // MainForm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; @@ -1080,5 +1108,7 @@ namespace CodeImp.DoomBuilder.Interface private System.Windows.Forms.ToolStripButton buttonredo; private System.Windows.Forms.ToolStripButton buttonsnaptogrid; private System.Windows.Forms.ToolStripMenuItem itemsnaptogrid; + private System.Windows.Forms.ToolStripButton buttonautomerge; + private System.Windows.Forms.ToolStripMenuItem itemautomerge; } } \ No newline at end of file diff --git a/Source/Interface/MainForm.cs b/Source/Interface/MainForm.cs index 48e2654d..237f6b6c 100644 --- a/Source/Interface/MainForm.cs +++ b/Source/Interface/MainForm.cs @@ -77,6 +77,7 @@ namespace CodeImp.DoomBuilder.Interface public bool MouseInDisplay { get { return mouseinside; } } public RenderTargetControl Display { get { return display; } } public bool SnapToGrid { get { return buttonsnaptogrid.Checked; } } + public bool AutoMerge { get { return buttonautomerge.Checked; } } #endregion @@ -872,14 +873,15 @@ namespace CodeImp.DoomBuilder.Interface //menuedit.Visible = (General.Map != null); // Enable/disable items + itemundo.Enabled = (General.Map != null) && (General.Map.UndoRedo.NextUndo != null); + itemredo.Enabled = (General.Map != null) && (General.Map.UndoRedo.NextRedo != null); itemmapoptions.Enabled = (General.Map != null); itemverticesmode.Enabled = (General.Map != null); itemlinedefsmode.Enabled = (General.Map != null); itemsectorsmode.Enabled = (General.Map != null); itemthingsmode.Enabled = (General.Map != null); itemsnaptogrid.Enabled = (General.Map != null); - itemundo.Enabled = (General.Map != null) && (General.Map.UndoRedo.NextUndo != null); - itemredo.Enabled = (General.Map != null) && (General.Map.UndoRedo.NextRedo != null); + itemautomerge.Enabled = (General.Map != null); // Determine undo description if(itemundo.Enabled) @@ -904,6 +906,7 @@ namespace CodeImp.DoomBuilder.Interface buttonundo.ToolTipText = itemundo.Text; buttonredo.ToolTipText = itemredo.Text; buttonsnaptogrid.Enabled = (General.Map != null); + buttonautomerge.Enabled = (General.Map != null); } // Action to toggle snap to grid @@ -913,6 +916,14 @@ namespace CodeImp.DoomBuilder.Interface buttonsnaptogrid.Checked = !buttonsnaptogrid.Checked; itemsnaptogrid.Checked = buttonsnaptogrid.Checked; } + + // Action to toggle auto merge + [Action("toggleautomerge")] + public void ToggleAutoMerge() + { + buttonautomerge.Checked = !buttonautomerge.Checked; + itemautomerge.Checked = buttonautomerge.Checked; + } #endregion diff --git a/Source/Map/Linedef.cs b/Source/Map/Linedef.cs index 575ca310..9fe26974 100644 --- a/Source/Map/Linedef.cs +++ b/Source/Map/Linedef.cs @@ -75,9 +75,6 @@ namespace CodeImp.DoomBuilder.Map // Selections private bool selected; - - // Cloning - private Linedef clone; // Disposing private bool isdisposed = false; diff --git a/Source/Properties/Resources.Designer.cs b/Source/Properties/Resources.Designer.cs index 33126dd3..fdb932a7 100644 --- a/Source/Properties/Resources.Designer.cs +++ b/Source/Properties/Resources.Designer.cs @@ -109,6 +109,20 @@ namespace CodeImp.DoomBuilder.Properties { } } + internal static System.Drawing.Bitmap mergegeometry { + get { + object obj = ResourceManager.GetObject("mergegeometry", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap mergegeometry2 { + get { + object obj = ResourceManager.GetObject("mergegeometry2", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + internal static System.Drawing.Bitmap NewMap { get { object obj = ResourceManager.GetObject("NewMap", resourceCulture); diff --git a/Source/Properties/Resources.resx b/Source/Properties/Resources.resx index 5a9296ed..bc03f1bc 100644 --- a/Source/Properties/Resources.resx +++ b/Source/Properties/Resources.resx @@ -145,6 +145,9 @@ ..\Resources\NewMap2.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\mergegeometry.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\NewMap.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -163,8 +166,8 @@ ..\Resources\Grid2.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\ThingsMode.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Grid4.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\SaveMap.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -175,6 +178,9 @@ ..\Resources\VerticesMode.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\ThingsMode.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\Status1.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -184,7 +190,7 @@ ..\Resources\OpenMap.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\Grid4.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\mergegeometry2.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/Source/Resources/Actions.cfg b/Source/Resources/Actions.cfg index dcec5cc7..a446d997 100644 --- a/Source/Resources/Actions.cfg +++ b/Source/Resources/Actions.cfg @@ -208,8 +208,8 @@ gridsetup title = "View: Grid Setup"; description = "Shows the Custom Grid Setup dialog which allows you to set custom grid sizes and a background image."; allowkeys = true; - allowmouse = false; - allowscroll = false; + allowmouse = true; + allowscroll = true; } undo @@ -217,8 +217,8 @@ undo title = "Edit: Undo"; description = "Restores the current map as it was before last action(s) performed."; allowkeys = true; - allowmouse = false; - allowscroll = false; + allowmouse = true; + allowscroll = true; } redo @@ -226,8 +226,8 @@ redo title = "Edit: Redo"; description = "Repeates the action(s) performed before Undo was used."; allowkeys = true; - allowmouse = false; - allowscroll = false; + allowmouse = true; + allowscroll = true; } togglesnap @@ -235,6 +235,15 @@ togglesnap title = "Edit: Snap to Grid"; description = "Toggles snapping to the grid for things and vertices that are being dragged."; allowkeys = true; + allowmouse = false; + allowscroll = false; +} + +toggleautomerge +{ + title = "Edit: Merge Geometry"; + description = "Toggles automatic merging of geometry for vertices and structures that are being dragged."; + allowkeys = true; allowmouse = true; allowscroll = true; } diff --git a/Source/Resources/mergegeometry.png b/Source/Resources/mergegeometry.png new file mode 100644 index 00000000..c9c44274 Binary files /dev/null and b/Source/Resources/mergegeometry.png differ diff --git a/Source/Resources/mergegeometry2.png b/Source/Resources/mergegeometry2.png new file mode 100644 index 00000000..f8af3f15 Binary files /dev/null and b/Source/Resources/mergegeometry2.png differ