mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2025-02-11 02:00:55 +00:00
Changed how performing undo interacts with volatile modes (it will now actually perform the undo instead of just canceling the volatile mode)
This commit is contained in:
parent
7d180e5cae
commit
4b0dce43ed
2 changed files with 121 additions and 115 deletions
|
@ -608,10 +608,13 @@ namespace CodeImp.DoomBuilder.Editing
|
||||||
// Call UndoBegin event
|
// Call UndoBegin event
|
||||||
if(General.Editing.Mode.OnUndoBegin())
|
if(General.Editing.Mode.OnUndoBegin())
|
||||||
{
|
{
|
||||||
// Cancel volatile mode, if any
|
// biwa. Previously being in a volatile mode simply switch back the the previous
|
||||||
// This returns false when mode was not volatile
|
// stable mode without actually performing the undo. This causes problems when the
|
||||||
if(!General.Editing.CancelVolatileMode())
|
// volatile mode create undo snapshots. EditSelectionMode does this, and removing
|
||||||
{
|
// it's undo snapshot only works because the mode's OnCancel is called twice.
|
||||||
|
// Maybe the logic of CancelVolatileMode is just wrong.
|
||||||
|
General.Editing.CancelVolatileMode();
|
||||||
|
|
||||||
geometrychanged = false;
|
geometrychanged = false;
|
||||||
populationchanged = false;
|
populationchanged = false;
|
||||||
General.Map.Map.ClearAllMarks(false);
|
General.Map.Map.ClearAllMarks(false);
|
||||||
|
@ -736,7 +739,6 @@ namespace CodeImp.DoomBuilder.Editing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Cursor.Current = oldcursor;
|
Cursor.Current = oldcursor;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1401,6 +1401,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
// Cancel mode
|
// Cancel mode
|
||||||
public override void OnCancel()
|
public override void OnCancel()
|
||||||
{
|
{
|
||||||
|
// Only allow the following code to be run once
|
||||||
|
if (cancelled)
|
||||||
|
return;
|
||||||
|
|
||||||
base.OnCancel();
|
base.OnCancel();
|
||||||
|
|
||||||
// Paste operation?
|
// Paste operation?
|
||||||
|
|
Loading…
Reference in a new issue