// Fix a single side public override bool Button1Click(bool batchMode) { // On which side can we fix? if(copysidedeffront != null) { // Front if(!batchMode) General.Map.UndoRedo.CreateUndo("Create front sidedef"); Sidedef newside = General.Map.Map.CreateSidedef(line, true, copysidedeffront.Sector); if(newside == null) return false; copysidedeffront.CopyPropertiesTo(newside); } else if(copysidedefback != null) { // Back // Because the line is single-sided, we make the sidedef on the front. // We will then flip it to make sure to ends up in the right position. if(!batchMode) General.Map.UndoRedo.CreateUndo("Create front sidedef"); Sidedef newside = General.Map.Map.CreateSidedef(line, true, copysidedefback.Sector); if(newside == null) return false; copysidedefback.CopyPropertiesTo(newside); line.FlipVertices(); } line.ApplySidedFlags(); General.Map.Map.Update(); return true; }
// Fix by flipping linedefs public override bool Button1Click() { General.Map.UndoRedo.CreateUndo("Linedef flags change"); line.ApplySidedFlags(); General.Map.Map.Update(); return(true); }
// Fix by creating a sidedef public override bool Button2Click() { General.Map.UndoRedo.CreateUndo("Create front sidedef"); Sidedef newside = General.Map.Map.CreateSidedef(line, true, copysidedef.Sector); if (newside == null) { return(false); } copysidedef.CopyPropertiesTo(newside); line.ApplySidedFlags(); General.Map.Map.Update(); return(true); }