mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2025-02-21 19:31:43 +00:00
Keep track of removed map elements
This commit is contained in:
parent
9d8d43c176
commit
f7bcffd255
6 changed files with 22 additions and 0 deletions
|
@ -153,6 +153,9 @@ namespace CodeImp.DoomBuilder.Map
|
|||
// Already set isdisposed so that changes can be prohibited
|
||||
isdisposed = true;
|
||||
|
||||
if (map == General.Map.Map && General.Network != null && General.Network.ActionRunning)
|
||||
General.Map.Map.RemovedElements.Add(this);
|
||||
|
||||
// Dispose sidedefs
|
||||
if((front != null) && map.AutoRemove) front.Dispose(); else AttachFrontP(null);
|
||||
if((back != null) && map.AutoRemove) back.Dispose(); else AttachBackP(null);
|
||||
|
|
|
@ -163,6 +163,13 @@ namespace CodeImp.DoomBuilder.Map
|
|||
|
||||
internal bool AutoRemove { get { return autoremove; } set { autoremove = value; } }
|
||||
|
||||
public bool GeometryChanged { set; get; }
|
||||
|
||||
public bool PopulationChanged { set; get; }
|
||||
|
||||
/// <summary>List of all elements that were removed while the previous network action was running</summary>
|
||||
public List<MapElement> RemovedElements { set; get; } = new List<MapElement>();
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Constructor / Disposer
|
||||
|
|
|
@ -175,6 +175,9 @@ namespace CodeImp.DoomBuilder.Map
|
|||
// Already set isdisposed so that changes can be prohibited
|
||||
isdisposed = true;
|
||||
|
||||
if (map == General.Map.Map && General.Network != null && General.Network.ActionRunning)
|
||||
General.Map.Map.RemovedElements.Add(this);
|
||||
|
||||
// Dispose the sidedefs that are attached to this sector
|
||||
// because a sidedef cannot exist without reference to its sector.
|
||||
if(map.AutoRemove)
|
||||
|
|
|
@ -127,6 +127,9 @@ namespace CodeImp.DoomBuilder.Map
|
|||
// Already set isdisposed so that changes can be prohibited
|
||||
isdisposed = true;
|
||||
|
||||
if (map == General.Map.Map && General.Network != null && General.Network.ActionRunning)
|
||||
General.Map.Map.RemovedElements.Add(this);
|
||||
|
||||
if(map == General.Map.Map)
|
||||
General.Map.UndoRedo.RecRemSidedef(this);
|
||||
|
||||
|
|
|
@ -162,6 +162,9 @@ namespace CodeImp.DoomBuilder.Map
|
|||
// Not already disposed?
|
||||
if(!isdisposed)
|
||||
{
|
||||
if (map == General.Map.Map && General.Network != null && General.Network.ActionRunning)
|
||||
General.Map.Map.RemovedElements.Add(this);
|
||||
|
||||
if(map == General.Map.Map)
|
||||
General.Map.UndoRedo.RecRemThing(this);
|
||||
|
||||
|
|
|
@ -118,6 +118,9 @@ namespace CodeImp.DoomBuilder.Map
|
|||
// Already set isdisposed so that changes can be prohibited
|
||||
isdisposed = true;
|
||||
|
||||
if (map == General.Map.Map && General.Network != null && General.Network.ActionRunning)
|
||||
General.Map.Map.RemovedElements.Add(this);
|
||||
|
||||
if(map.AutoRemove)
|
||||
{
|
||||
// Dispose the lines that are attached to this vertex
|
||||
|
|
Loading…
Reference in a new issue