mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-31 04:40:55 +00:00
Fixed, Script Editor: in some cases the editor was unable to restore saved script file settings.
Fixed, Drag Linedefs, Drag Vertices, Edit Selection modes: in some cases sidedefs were incorrectly removed when modifying a closed section of a multi-part sector. Fixed, Drag Linedefs, Drag Vertices, Drag Sectors, Edit Selection modes: in some cases sidedef textures were not adjusted after applying the modes, leaving middle textures on double-sided lines.
This commit is contained in:
parent
8ff50ac1e5
commit
082a718bce
6 changed files with 58 additions and 14 deletions
|
@ -2474,6 +2474,9 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
{
|
||||
if(side.Sector != nearest) sidesectorref[side] = nearest; // This side will be reattached in phase 2
|
||||
else sidesectorref.Remove(side); // This side is already attached where it needs to be
|
||||
|
||||
// Store
|
||||
adjustedsides.Add(side);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2559,9 +2562,41 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
{
|
||||
List<LinedefSide> sectorsides = FindPotentialSectorAt(line, front);
|
||||
if(sectorsides == null) return null;
|
||||
Sector result = null;
|
||||
|
||||
// Special case: if sectorsides match sidestoexclude and all sidestoexclude reference the same sector, return that sector
|
||||
if(sidestoexclude.Count > 2 && sectorsides.Count == sidestoexclude.Count)
|
||||
{
|
||||
bool allsidesmatch = true;
|
||||
|
||||
// Check if all sidestoexclude reference the same sector...
|
||||
foreach(Sidedef s in sidestoexclude)
|
||||
{
|
||||
if(result == null) result = s.Sector;
|
||||
else if(result != s.Sector)
|
||||
{
|
||||
allsidesmatch = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if sidestoexclude match sectorsides...
|
||||
if(allsidesmatch)
|
||||
{
|
||||
HashSet<Sidedef> sectorsidesset = new HashSet<Sidedef>();
|
||||
foreach(LinedefSide ls in sectorsides)
|
||||
{
|
||||
sectorsidesset.Add(ls.Front ? ls.Line.Front : ls.Line.Back);
|
||||
}
|
||||
|
||||
allsidesmatch = sectorsidesset.SetEquals(sidestoexclude);
|
||||
}
|
||||
|
||||
// Sides are already where they need to be
|
||||
if(allsidesmatch) return result;
|
||||
}
|
||||
|
||||
// Filter outersides from the list, proceed only if all sectorsides reference the same sector
|
||||
Sector result = null;
|
||||
foreach(LinedefSide sectorside in sectorsides)
|
||||
{
|
||||
Sidedef target = (sectorside.Front ? sectorside.Line.Front : sectorside.Line.Back);
|
||||
|
|
|
@ -440,7 +440,12 @@ namespace CodeImp.DoomBuilder.Map
|
|||
|
||||
// Copy information from Configuration to ScriptDocumentSaveSettings
|
||||
if(scfinfo.Contains("filename") && (scfinfo["filename"] is string)) settings.Filename = (string)scfinfo["filename"];
|
||||
if(scfinfo.Contains("hash") && (scfinfo["hash"] is long)) settings.Hash = (long)scfinfo["hash"];
|
||||
if(scfinfo.Contains("hash"))
|
||||
{
|
||||
// Configuration will parse the value as int if it's inside int type bounds.
|
||||
if(scfinfo["hash"] is int) settings.Hash = (int)scfinfo["hash"];
|
||||
else if(scfinfo["hash"] is long) settings.Hash = (long)scfinfo["hash"];
|
||||
}
|
||||
if(scfinfo.Contains("caretposition") && (scfinfo["caretposition"] is int)) settings.CaretPosition = (int)scfinfo["caretposition"];
|
||||
if(scfinfo.Contains("firstvisibleline") && (scfinfo["firstvisibleline"] is int)) settings.FirstVisibleLine = (int)scfinfo["firstvisibleline"];
|
||||
if(scfinfo.Contains("activetab") && (scfinfo["activetab"] is bool)) settings.IsActiveTab = (bool)scfinfo["activetab"];
|
||||
|
|
|
@ -129,16 +129,17 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
//mxd. Reattach/add/remove outer sidedefs
|
||||
HashSet<Sidedef> adjustedsides = Tools.AdjustOuterSidedefs(toadjust, changedlines);
|
||||
|
||||
//mxd. Split outer sectors
|
||||
Tools.SplitOuterSectors(changedlines);
|
||||
|
||||
//mxd. Remove unneeded textures
|
||||
foreach(Sidedef side in adjustedsides)
|
||||
{
|
||||
if(side.IsDisposed) continue;
|
||||
side.RemoveUnneededTextures(true, true, true);
|
||||
if(side.Other != null) side.Other.RemoveUnneededTextures(true, true, true);
|
||||
}
|
||||
|
||||
//mxd. Split outer sectors
|
||||
Tools.SplitOuterSectors(changedlines);
|
||||
|
||||
// If only a single linedef was selected, deselect it now
|
||||
if(selectedlines.Count == 1) General.Map.Map.ClearSelectedLinedefs();
|
||||
}
|
||||
|
|
|
@ -132,16 +132,17 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
//mxd. Process outer sidedefs
|
||||
HashSet<Sidedef> adjustedsides = Tools.AdjustOuterSidedefs(toadjust, changedlines);
|
||||
|
||||
//mxd. Split outer sectors
|
||||
Tools.SplitOuterSectors(changedlines);
|
||||
|
||||
//mxd. Remove unneeded textures
|
||||
foreach(Sidedef side in adjustedsides)
|
||||
{
|
||||
if(side.IsDisposed) continue;
|
||||
side.RemoveUnneededTextures(true, true, true);
|
||||
if(side.Other != null) side.Other.RemoveUnneededTextures(true, true, true);
|
||||
}
|
||||
|
||||
//mxd. Split outer sectors
|
||||
Tools.SplitOuterSectors(changedlines);
|
||||
|
||||
// If only a single sector was selected, deselect it now
|
||||
if(selectedsectors.Count == 1)
|
||||
{
|
||||
|
|
|
@ -123,16 +123,17 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// Reattach/add/remove outer sidedefs
|
||||
HashSet<Sidedef> adjustedsides = Tools.AdjustOuterSidedefs(toadjust, changedlines);
|
||||
|
||||
// Split outer sectors
|
||||
Tools.SplitOuterSectors(changedlines);
|
||||
|
||||
// Remove unneeded textures
|
||||
foreach(Sidedef side in adjustedsides)
|
||||
{
|
||||
if(side.IsDisposed) continue;
|
||||
side.RemoveUnneededTextures(true, true, true);
|
||||
if(side.Other != null) side.Other.RemoveUnneededTextures(true, true, true);
|
||||
}
|
||||
|
||||
// Split outer sectors
|
||||
Tools.SplitOuterSectors(changedlines);
|
||||
|
||||
// Additional verts may've been created
|
||||
if(selectedverts.Count > 1)
|
||||
{
|
||||
|
|
|
@ -1655,15 +1655,16 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// Change floor/ceiling height?
|
||||
if(!pasting) AdjustSectorsHeight(affectedsectors, heightadjustmode, oldoutsidefloorheight, oldoutsideceilingheight);
|
||||
|
||||
// Split outer sectors
|
||||
Tools.SplitOuterSectors(changedlines);
|
||||
|
||||
// Remove unneeded textures (needs to be done AFTER adjusting floor/ceiling height)
|
||||
foreach(Sidedef side in adjustedsides)
|
||||
{
|
||||
if(side.IsDisposed) continue;
|
||||
side.RemoveUnneededTextures(true, true, true);
|
||||
if(side.Other != null) side.Other.RemoveUnneededTextures(true, true, true);
|
||||
}
|
||||
|
||||
// Split outer sectors
|
||||
Tools.SplitOuterSectors(changedlines);
|
||||
}
|
||||
|
||||
// Update cached values
|
||||
|
|
Loading…
Reference in a new issue