diff --git a/Source/Plugins/BuilderModes/VisualModes/VisualCeiling.cs b/Source/Plugins/BuilderModes/VisualModes/VisualCeiling.cs index 7dfb7ee674c3fedf71ff7aa0d938845190688cc5..b4f229fbeda944320189c3c87b7a75329bc35339 100644 --- a/Source/Plugins/BuilderModes/VisualModes/VisualCeiling.cs +++ b/Source/Plugins/BuilderModes/VisualModes/VisualCeiling.cs @@ -422,6 +422,7 @@ namespace CodeImp.DoomBuilder.BuilderModes } List<Sector> neighbours = new List<Sector>(); + bool regularorvavoom = extrafloor == null || (extrafloor != null && extrafloor.VavoomType); //collect neighbour sectors foreach(Sidedef side in Sector.Sector.Sidedefs) @@ -433,7 +434,7 @@ namespace CodeImp.DoomBuilder.BuilderModes bool add; // When current ceiling is part of a 3d floor, it looks like a floor, so we need to select adjacent floors - if(level.sector != Sector.Sector) + if(level.sector != Sector.Sector && !regularorvavoom) { add = (withSameTexture && side.Other.Sector.FloorTexture == level.sector.CeilTexture); @@ -452,26 +453,8 @@ namespace CodeImp.DoomBuilder.BuilderModes vs.Floor.SelectNeighbours(select, withSameTexture, withSameHeight); } } - - // (De)select adjacent extra floors - foreach(VisualCeiling ec in vs.ExtraCeilings) - { - if(select == ec.Selected) continue; - - add = (withSameTexture && level.sector.CeilTexture == ec.level.sector.CeilTexture); - - if(withSameHeight) - { - add = ((withSameTexture && add) || !withSameTexture) && level.sector.CeilHeight == ec.level.sector.CeilHeight; - } - - if(add) - { - ec.SelectNeighbours(select, withSameTexture, withSameHeight); - } - } } - else // Regular ceiling + else // Regular ceiling or vavoom-type extra ceiling { // (De)select adjacent ceilings add = (withSameTexture && side.Other.Sector.CeilTexture == level.sector.CeilTexture); @@ -491,23 +474,41 @@ namespace CodeImp.DoomBuilder.BuilderModes vs.Ceiling.SelectNeighbours(select, withSameTexture, withSameHeight); } } + } + + // (De)select adjacent extra ceilings + foreach(VisualCeiling ec in vs.ExtraCeilings) + { + if(select == ec.Selected || ec.extrafloor.VavoomType != regularorvavoom) continue; + + add = (withSameTexture && level.sector.CeilTexture == ec.level.sector.CeilTexture); + + if(withSameHeight) + { + add = ((withSameTexture && add) || !withSameTexture) && level.sector.CeilHeight == ec.level.sector.CeilHeight; + } - // (De)select adjacent extra floors - foreach(VisualFloor ef in vs.ExtraFloors) + if(add) { - if(select == ef.Selected) continue; + ec.SelectNeighbours(select, withSameTexture, withSameHeight); + } + } - add = (withSameTexture && level.sector.CeilTexture == ef.Level.sector.FloorTexture); + // (De)select adjacent extra floors + foreach(VisualFloor ef in vs.ExtraFloors) + { + if(select == ef.Selected || ef.ExtraFloor.VavoomType == regularorvavoom) continue; - if(withSameHeight) - { - add = ((withSameTexture && add) || !withSameTexture) && level.sector.CeilHeight == ef.Level.sector.FloorHeight; - } + add = (withSameTexture && level.sector.CeilTexture == ef.Level.sector.FloorTexture); - if(add) - { - ef.SelectNeighbours(select, withSameTexture, withSameHeight); - } + if(withSameHeight) + { + add = ((withSameTexture && add) || !withSameTexture) && level.sector.CeilHeight == ef.Level.sector.FloorHeight; + } + + if(add) + { + ef.SelectNeighbours(select, withSameTexture, withSameHeight); } } } diff --git a/Source/Plugins/BuilderModes/VisualModes/VisualFloor.cs b/Source/Plugins/BuilderModes/VisualModes/VisualFloor.cs index 9027e5f028d54a3523ee75629cf44f57d2b7462e..a351beac0eb5732876d3fb1d073fcf1ded9d5950 100644 --- a/Source/Plugins/BuilderModes/VisualModes/VisualFloor.cs +++ b/Source/Plugins/BuilderModes/VisualModes/VisualFloor.cs @@ -378,7 +378,8 @@ namespace CodeImp.DoomBuilder.BuilderModes { if (!withSameTexture && !withSameHeight) return; - if (select && !selected) { + if (select && !selected) + { selected = true; mode.AddSelectedObject(this); } @@ -389,6 +390,7 @@ namespace CodeImp.DoomBuilder.BuilderModes } List<Sector> neighbours = new List<Sector>(); + bool regularorvavoom = extrafloor == null || (extrafloor != null && extrafloor.VavoomType); //collect neighbour sectors foreach(Sidedef side in Sector.Sector.Sidedefs) @@ -400,7 +402,7 @@ namespace CodeImp.DoomBuilder.BuilderModes bool add; // When current floor is part of a 3d floor, it looks like a ceiling, so we need to select adjacent ceilings - if (level.sector != Sector.Sector) + if (level.sector != Sector.Sector && !regularorvavoom) { add = (withSameTexture && side.Other.Sector.CeilTexture == level.sector.FloorTexture); @@ -419,26 +421,8 @@ namespace CodeImp.DoomBuilder.BuilderModes vs.Ceiling.SelectNeighbours(select, withSameTexture, withSameHeight); } } - - // (De)select adjacent extra floors - foreach(VisualFloor ef in vs.ExtraFloors) - { - if(select == ef.Selected) continue; - - add = (withSameTexture && level.sector.FloorTexture == ef.level.sector.FloorTexture); - - if(withSameHeight) - { - add = ((withSameTexture && add) || !withSameTexture) && level.sector.FloorHeight == ef.level.sector.FloorHeight; - } - - if(add) - { - ef.SelectNeighbours(select, withSameTexture, withSameHeight); - } - } } - else // Regular floor + else // Regular floor or vavoom-type extrafloor { // (De)select adjacent floor add = (withSameTexture && side.Other.Sector.FloorTexture == level.sector.FloorTexture); @@ -458,23 +442,40 @@ namespace CodeImp.DoomBuilder.BuilderModes vs.Floor.SelectNeighbours(select, withSameTexture, withSameHeight); } } + } + + // (De)select adjacent extra floors + foreach(VisualFloor ef in vs.ExtraFloors) { + if (select == ef.Selected || ef.extrafloor.VavoomType != regularorvavoom) continue; + + add = (withSameTexture && level.sector.FloorTexture == ef.level.sector.FloorTexture); + + if (withSameHeight) + { + add = ((withSameTexture && add) || !withSameTexture) && level.sector.FloorHeight == ef.level.sector.FloorHeight; + } - // (De)select adjacent extra ceilings - foreach(VisualCeiling ec in vs.ExtraCeilings) + if (add) { - if(select == ec.Selected) continue; + ef.SelectNeighbours(select, withSameTexture, withSameHeight); + } + } - add = (withSameTexture && level.sector.FloorTexture == ec.Level.sector.CeilTexture); + // (De)select adjacent vavoom type extra ceilings + foreach(VisualCeiling ec in vs.ExtraCeilings) + { + if(select == ec.Selected || ec.ExtraFloor.VavoomType == regularorvavoom) continue; - if(withSameHeight) - { - add = ((withSameTexture && add) || !withSameTexture) && level.sector.FloorHeight == ec.Level.sector.CeilHeight; - } + add = (withSameTexture && level.sector.FloorTexture == ec.Level.sector.CeilTexture); - if(add) - { - ec.SelectNeighbours(select, withSameTexture, withSameHeight); - } + if (withSameHeight) + { + add = ((withSameTexture && add) || !withSameTexture) && level.sector.FloorHeight == ec.Level.sector.CeilHeight; + } + + if (add) + { + ec.SelectNeighbours(select, withSameTexture, withSameHeight); } } }