mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2025-02-05 07:11:12 +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
|
||||
if(General.Editing.Mode.OnUndoBegin())
|
||||
{
|
||||
// Cancel volatile mode, if any
|
||||
// This returns false when mode was not volatile
|
||||
if(!General.Editing.CancelVolatileMode())
|
||||
{
|
||||
// biwa. Previously being in a volatile mode simply switch back the the previous
|
||||
// stable mode without actually performing the undo. This causes problems when the
|
||||
// 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;
|
||||
populationchanged = false;
|
||||
General.Map.Map.ClearAllMarks(false);
|
||||
|
@ -736,7 +739,6 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Cursor.Current = oldcursor;
|
||||
}
|
||||
|
|
|
@ -1401,6 +1401,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// Cancel mode
|
||||
public override void OnCancel()
|
||||
{
|
||||
// Only allow the following code to be run once
|
||||
if (cancelled)
|
||||
return;
|
||||
|
||||
base.OnCancel();
|
||||
|
||||
// Paste operation?
|
||||
|
|
Loading…
Reference in a new issue