mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-23 04:12:12 +00:00
Snap selection to grid: fixed a problem that could cause a crash if geometry got removed by snapping it to the grid
This commit is contained in:
parent
b369b944f9
commit
484b0817bd
5 changed files with 38 additions and 1 deletions
|
@ -261,6 +261,10 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
public virtual bool OnScriptRunBegin() { return true; }
|
||||
public virtual void OnScriptRunEnd() { }
|
||||
|
||||
// This should be called by global actions (i.e. that are not part of an editing mode) when they changed map elements,
|
||||
// so that the mode can react to it (for example by rebuilding a blockmap)
|
||||
public virtual void OnMapElementsChanged() { }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2643,6 +2643,9 @@ namespace CodeImp.DoomBuilder
|
|||
undoredo.WithdrawUndo();
|
||||
}
|
||||
|
||||
// Let the current editing mode know that we changed something
|
||||
General.Editing.Mode.OnMapElementsChanged();
|
||||
|
||||
// Done
|
||||
General.Interface.RedrawDisplay();
|
||||
Cursor.Current = Cursors.Default;
|
||||
|
|
|
@ -1217,6 +1217,16 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
return base.OnCopyBegin();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If map elements have changed the blockmap needs to be recreated.
|
||||
/// </summary>
|
||||
public override void OnMapElementsChanged()
|
||||
{
|
||||
base.OnMapElementsChanged();
|
||||
|
||||
CreateBlockmap();
|
||||
}
|
||||
|
||||
//mxd
|
||||
private void RenderComment(Linedef l)
|
||||
{
|
||||
|
|
|
@ -1596,6 +1596,16 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
General.Interface.RedrawDisplay();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If map elements have changed the blockmap needs to be recreated.
|
||||
/// </summary>
|
||||
public override void OnMapElementsChanged()
|
||||
{
|
||||
base.OnMapElementsChanged();
|
||||
|
||||
CreateBlockmap();
|
||||
}
|
||||
|
||||
//mxd
|
||||
public override void OnViewSelectionNumbersChanged(bool enabled)
|
||||
{
|
||||
|
|
|
@ -760,6 +760,16 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
return base.OnCopyBegin();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If map elements have changed the blockmap needs to be recreated.
|
||||
/// </summary>
|
||||
public override void OnMapElementsChanged()
|
||||
{
|
||||
base.OnMapElementsChanged();
|
||||
|
||||
CreateBlockmap();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Actions
|
||||
|
|
Loading…
Reference in a new issue