Added option to reselect changed map elements after undo/redo

This commit is contained in:
biwa 2021-10-24 19:22:00 +02:00 committed by spherallic
parent 8d4bb17ccf
commit 24c2b9896d
7 changed files with 75 additions and 1 deletions

View file

@ -976,6 +976,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Recreate the blockmap to not include the potentially un-done lines anymore
CreateBlockmap();
// Select changed map elements
if (BuilderPlug.Me.SelectChangedafterUndoRedo)
{
General.Map.Map.SelectMarkedGeometry(true, true);
General.Map.Map.ConvertSelection(SelectionType.Linedefs);
}
// Update selection info and labels
UpdateSelectionInfo();
SetupSectorLabels();
@ -989,6 +996,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Recreate the blockmap to include the potentially re-done linedefs again
CreateBlockmap();
// Select changed map elements
if (BuilderPlug.Me.SelectChangedafterUndoRedo)
{
General.Map.Map.SelectMarkedGeometry(true, true);
General.Map.Map.ConvertSelection(SelectionType.Linedefs);
}
// Update selection info and labels
UpdateSelectionInfo();
SetupSectorLabels();

View file

@ -1505,6 +1505,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Recreate the blockmap to not include the potentially un-done sectors and things anymore
CreateBlockmap();
// Select changed map elements
if (BuilderPlug.Me.SelectChangedafterUndoRedo)
{
General.Map.Map.SelectMarkedGeometry(true, true);
General.Map.Map.ConvertSelection(SelectionType.Sectors);
}
// Clear labels
SetupLabels();
UpdateEffectLabels(); //mxd
@ -1527,6 +1534,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Recreate the blockmap to include the potentially re-done sectors and things again
CreateBlockmap();
// Select changed map elements
if (BuilderPlug.Me.SelectChangedafterUndoRedo)
{
General.Map.Map.SelectMarkedGeometry(true, true);
General.Map.Map.ConvertSelection(SelectionType.Sectors);
}
// Clear labels
SetupLabels();
UpdateEffectLabels(); //mxd

View file

@ -592,6 +592,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
base.OnUndoEnd();
// Select changed map elements
if (BuilderPlug.Me.SelectChangedafterUndoRedo)
{
General.Map.Map.SelectMarkedGeometry(true, true);
General.Map.Map.ConvertSelection(SelectionType.Things);
}
UpdateSelectionInfo(); // Update selection info and labels
UpdateHelperObjects(); // Update helper lines
SetupSectorLabels(); // And sector labels
@ -602,6 +609,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
base.OnRedoEnd();
// Select changed map elements
if (BuilderPlug.Me.SelectChangedafterUndoRedo)
{
General.Map.Map.SelectMarkedGeometry(true, true);
General.Map.Map.ConvertSelection(SelectionType.Things);
}
UpdateSelectionInfo(); // Update selection info and labels
UpdateHelperObjects(); // Update helper lines
SetupSectorLabels(); // And sector labels

View file

@ -578,6 +578,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Recreate the blockmap
CreateBlockmap();
// Select changed map elements
if (BuilderPlug.Me.SelectChangedafterUndoRedo)
{
General.Map.Map.SelectMarkedGeometry(true, true);
General.Map.Map.ConvertSelection(SelectionType.Vertices);
}
}
public override void OnRedoEnd()
@ -586,6 +593,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Recreate the blockmap
CreateBlockmap();
// Select changed map elements
if (BuilderPlug.Me.SelectChangedafterUndoRedo)
{
General.Map.Map.SelectMarkedGeometry(true, true);
General.Map.Map.ConvertSelection(SelectionType.Vertices);
}
}
//mxd

View file

@ -135,7 +135,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
private bool lockSectorTextureOffsetsWhileDragging; //mxd
private bool syncthingedit; //mxd
private bool alphabasedtexturehighlighting; //mxd
private bool selectchangedafterundoredo;
#endregion
#region ================== Properties
@ -191,6 +192,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
public bool LockSectorTextureOffsetsWhileDragging { get { return lockSectorTextureOffsetsWhileDragging; } internal set { lockSectorTextureOffsetsWhileDragging = value; } } //mxd
public bool SyncronizeThingEdit { get { return syncthingedit; } internal set { syncthingedit = value; } } //mxd
public bool AlphaBasedTextureHighlighting { get { return alphabasedtexturehighlighting; } internal set { alphabasedtexturehighlighting = value; } } //mxd
public bool SelectChangedafterUndoRedo { get { return selectchangedafterundoredo; } internal set { selectchangedafterundoredo = value; } }
//mxd. "Make Door" action persistent settings
internal MakeDoorSettings MakeDoor;
@ -315,6 +317,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
autoAlignTextureOffsetsOnCreate = General.Settings.ReadPluginSetting("autoaligntextureoffsetsoncreate", false); //mxd
dontMoveGeometryOutsideMapBoundary = General.Settings.ReadPluginSetting("dontmovegeometryoutsidemapboundary", false); //mxd
syncSelection = General.Settings.ReadPluginSetting("syncselection", false); //mxd
selectchangedafterundoredo = General.Settings.ReadPluginSetting("selectchangedafterundoredo", false);
}
//mxd. Load settings, which can be changed via UI

View file

@ -40,6 +40,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
this.defaultbrightness = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
this.label11 = new System.Windows.Forms.Label();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.selectafterundoredo = new System.Windows.Forms.CheckBox();
this.additivepaintselect = new System.Windows.Forms.CheckBox();
this.autodrawonedit = new System.Windows.Forms.CheckBox();
this.syncSelection = new System.Windows.Forms.CheckBox();
@ -242,6 +243,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
this.groupBox3.Controls.Add(this.additiveselect);
this.groupBox3.Controls.Add(this.dontusenodes);
this.groupBox3.Controls.Add(this.switchviewmodes);
this.groupBox3.Controls.Add(this.selectafterundoredo);
this.groupBox3.Location = new System.Drawing.Point(284, 104);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(379, 379);
@ -249,6 +251,16 @@ namespace CodeImp.DoomBuilder.BuilderModes
this.groupBox3.TabStop = false;
this.groupBox3.Text = " Options ";
//
// selectafterundoredo
//
this.selectafterundoredo.AutoSize = true;
this.selectafterundoredo.Location = new System.Drawing.Point(13, 336);
this.selectafterundoredo.Name = "selectafterundoredo";
this.selectafterundoredo.Size = new System.Drawing.Size(200, 17);
this.selectafterundoredo.TabIndex = 12;
this.selectafterundoredo.Text = "Select changed map elements after undo/redo";
this.selectafterundoredo.UseVisualStyleBackColor = true;
//
// autodrawonedit
//
this.autodrawonedit.AutoSize = true;
@ -716,5 +728,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
private System.Windows.Forms.Label label16;
private System.Windows.Forms.Label label17;
private System.Windows.Forms.CheckBox additivepaintselect;
private System.Windows.Forms.CheckBox selectafterundoredo;
}
}

View file

@ -64,6 +64,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
defaultbrightness.Text = General.Settings.DefaultBrightness.ToString(); //mxd
defaultceilheight.Text = General.Settings.DefaultCeilingHeight.ToString();//mxd
defaultfloorheight.Text = General.Settings.DefaultFloorHeight.ToString(); //mxd
selectafterundoredo.Checked = General.Settings.ReadPluginSetting("selectchangedafterundoredo", false);
}
#endregion
@ -91,6 +92,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
General.Settings.WritePluginSetting("autoaligntextureoffsetsoncreate", autoaligntexturesoncreate.Checked);//mxd
General.Settings.WritePluginSetting("dontmovegeometryoutsidemapboundary", dontMoveGeometryOutsideBounds.Checked);//mxd
General.Settings.WritePluginSetting("syncselection", syncSelection.Checked);//mxd
General.Settings.WritePluginSetting("selectchangedafterundoredo", selectafterundoredo.Checked);
General.Settings.SwitchViewModes = switchviewmodes.Checked; //mxd
General.Settings.SplitLineBehavior = (SplitLineBehavior)splitbehavior.SelectedIndex;//mxd