mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-18 22:41:46 +00:00
Added undo for some Map Analysis corrections
This commit is contained in:
parent
d45b61f041
commit
052e0a1d63
6 changed files with 13 additions and 2 deletions
|
@ -132,6 +132,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// 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);
|
||||
copysidedef.CopyPropertiesTo(newside);
|
||||
line.ApplySidedFlags();
|
||||
|
|
|
@ -161,6 +161,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
if(copysidedeffront != null)
|
||||
{
|
||||
// Front
|
||||
General.Map.UndoRedo.CreateUndo("Create front sidedef");
|
||||
Sidedef newside = General.Map.Map.CreateSidedef(line, true, copysidedeffront.Sector);
|
||||
copysidedeffront.CopyPropertiesTo(newside);
|
||||
}
|
||||
|
@ -169,6 +170,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// 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.
|
||||
General.Map.UndoRedo.CreateUndo("Create front sidedef");
|
||||
Sidedef newside = General.Map.Map.CreateSidedef(line, true, copysidedefback.Sector);
|
||||
copysidedefback.CopyPropertiesTo(newside);
|
||||
line.FlipVertices();
|
||||
|
@ -183,6 +185,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
public override bool Button2Click()
|
||||
{
|
||||
Sidedef newside;
|
||||
General.Map.UndoRedo.CreateUndo("Create sidedefs");
|
||||
|
||||
// Front
|
||||
newside = General.Map.Map.CreateSidedef(line, true, copysidedeffront.Sector);
|
||||
|
|
|
@ -122,6 +122,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// Fix by flipping linedefs
|
||||
public override bool Button1Click()
|
||||
{
|
||||
General.Map.UndoRedo.CreateUndo("Linedef flags change");
|
||||
line.ApplySidedFlags();
|
||||
General.Map.Map.Update();
|
||||
return true;
|
||||
|
@ -130,6 +131,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// Fix by creating a sidedef
|
||||
public override bool Button2Click()
|
||||
{
|
||||
General.Map.UndoRedo.CreateUndo("Create back sidedef");
|
||||
Sidedef newside = General.Map.Map.CreateSidedef(line, false, copysidedef.Sector);
|
||||
copysidedef.CopyPropertiesTo(newside);
|
||||
line.ApplySidedFlags();
|
||||
|
|
|
@ -87,6 +87,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// Fix by flipping linedefs
|
||||
public override bool Button1Click()
|
||||
{
|
||||
General.Map.UndoRedo.CreateUndo("Linedef flags change");
|
||||
line.ApplySidedFlags();
|
||||
General.Map.Map.Update();
|
||||
return true;
|
||||
|
@ -95,6 +96,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// Fix by creating a sidedef
|
||||
public override bool Button2Click()
|
||||
{
|
||||
General.Map.UndoRedo.CreateUndo("Remove back sidedef");
|
||||
line.Back.Dispose();
|
||||
line.ApplySidedFlags();
|
||||
General.Map.Map.Update();
|
||||
|
|
|
@ -102,6 +102,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// Fix by setting default texture
|
||||
public override bool Button1Click()
|
||||
{
|
||||
General.Map.UndoRedo.CreateUndo("Missing texture correction");
|
||||
General.Settings.FindDefaultDrawSettings();
|
||||
switch (part)
|
||||
{
|
||||
|
|
|
@ -101,6 +101,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// Fix by removing texture
|
||||
public override bool Button1Click()
|
||||
{
|
||||
General.Map.UndoRedo.CreateUndo("Remove unknown texture");
|
||||
switch(part)
|
||||
{
|
||||
case SidedefPart.Upper: side.SetTextureHigh("-"); break;
|
||||
|
@ -115,6 +116,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// Fix by setting default texture
|
||||
public override bool Button2Click()
|
||||
{
|
||||
General.Map.UndoRedo.CreateUndo("Unknown texture correction");
|
||||
General.Settings.FindDefaultDrawSettings();
|
||||
switch(part)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue