mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-31 04:40:55 +00:00
optional merging and undo/redo levels limit
This commit is contained in:
parent
5a645c19f0
commit
bac031fa5d
18 changed files with 169 additions and 76 deletions
BIN
Resources/Icons/Selection.png
Normal file
BIN
Resources/Icons/Selection.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 163 B |
BIN
Resources/Icons/SelectionApply.png
Normal file
BIN
Resources/Icons/SelectionApply.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 408 B |
BIN
Resources/Icons/mergegeometry.png
Normal file
BIN
Resources/Icons/mergegeometry.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 530 B |
BIN
Resources/Icons/mergegeometry2.png
Normal file
BIN
Resources/Icons/mergegeometry2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 517 B |
BIN
Resources/mergegeometry.cpt
Normal file
BIN
Resources/mergegeometry.cpt
Normal file
Binary file not shown.
|
@ -284,6 +284,8 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Resources\Builder.ico" />
|
||||
<None Include="Resources\mergegeometry2.png" />
|
||||
<None Include="Resources\mergegeometry.png" />
|
||||
<None Include="Resources\Grid4.png" />
|
||||
<None Include="Resources\Redo.png" />
|
||||
<None Include="Resources\Undo.png" />
|
||||
|
|
|
@ -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...");
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -225,7 +225,6 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
{
|
||||
ICollection<Linedef> movinglines;
|
||||
ICollection<Linedef> fixedlines;
|
||||
ICollection<Linedef> changedlines;
|
||||
Rectangle editarea;
|
||||
int stitches = 0;
|
||||
int stitchundo;
|
||||
|
@ -246,7 +245,8 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
MoveGeometryRelative(mousemappos - dragstartmappos, snaptogrid, snaptonearest);
|
||||
|
||||
// ===== BEGIN GEOMETRY STITCHING
|
||||
|
||||
if(General.MainWindow.AutoMerge)
|
||||
{
|
||||
// Make undo for the stitching
|
||||
stitchundo = General.Map.UndoRedo.CreateUndo("stitch geometry", UndoGroup.None, 0, false);
|
||||
|
||||
|
@ -283,7 +283,7 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
|
||||
// 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
|
||||
|
|
|
@ -44,8 +44,8 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
#region ================== Variables
|
||||
|
||||
// Undo and redo stacks
|
||||
private Stack<UndoSnapshot> undos;
|
||||
private Stack<UndoSnapshot> redos;
|
||||
private List<UndoSnapshot> undos;
|
||||
private List<UndoSnapshot> 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<UndoSnapshot>();
|
||||
redos = new Stack<UndoSnapshot>();
|
||||
undos = new List<UndoSnapshot>(General.Settings.UndoLevels + 1);
|
||||
redos = new List<UndoSnapshot>(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<UndoSnapshot> 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,7 +158,8 @@ 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,13 +208,15 @@ 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,13 +240,15 @@ 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;
|
||||
|
|
54
Source/Interface/MainForm.Designer.cs
generated
54
Source/Interface/MainForm.Designer.cs
generated
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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
|
||||
|
@ -914,6 +917,14 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
itemsnaptogrid.Checked = buttonsnaptogrid.Checked;
|
||||
}
|
||||
|
||||
// Action to toggle auto merge
|
||||
[Action("toggleautomerge")]
|
||||
public void ToggleAutoMerge()
|
||||
{
|
||||
buttonautomerge.Checked = !buttonautomerge.Checked;
|
||||
itemautomerge.Checked = buttonautomerge.Checked;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Help Menu
|
||||
|
|
|
@ -76,9 +76,6 @@ namespace CodeImp.DoomBuilder.Map
|
|||
// Selections
|
||||
private bool selected;
|
||||
|
||||
// Cloning
|
||||
private Linedef clone;
|
||||
|
||||
// Disposing
|
||||
private bool isdisposed = false;
|
||||
|
||||
|
|
14
Source/Properties/Resources.Designer.cs
generated
14
Source/Properties/Resources.Designer.cs
generated
|
@ -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);
|
||||
|
|
|
@ -145,6 +145,9 @@
|
|||
<data name="NewMap" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\NewMap2.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="mergegeometry" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\mergegeometry.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="File" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\NewMap.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
|
@ -163,8 +166,8 @@
|
|||
<data name="Grid2" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Grid2.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="ThingsMode" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\ThingsMode.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
<data name="Grid4" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Grid4.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="SaveMap" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\SaveMap.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
|
@ -175,6 +178,9 @@
|
|||
<data name="VerticesMode" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\VerticesMode.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="ThingsMode" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\ThingsMode.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Status1" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Status1.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
|
@ -184,7 +190,7 @@
|
|||
<data name="OpenMap" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\OpenMap.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Grid4" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Grid4.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
<data name="mergegeometry2" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\mergegeometry2.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
|
@ -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;
|
||||
}
|
||||
|
|
BIN
Source/Resources/mergegeometry.png
Normal file
BIN
Source/Resources/mergegeometry.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 530 B |
BIN
Source/Resources/mergegeometry2.png
Normal file
BIN
Source/Resources/mergegeometry2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 517 B |
Loading…
Reference in a new issue