Update 2D flat alignment whenever texture offsets are changed.

This commit is contained in:
sphere 2021-03-13 23:10:41 +01:00
parent cba0e2a5d4
commit 8202a7c3f0

View file

@ -482,27 +482,24 @@ namespace CodeImp.DoomBuilder.Windows
}
// (Re)set hacky flat alignment
if (l.IsFlatAlignment || l.Action == 0)
if (sectortags.ContainsKey(l.Tag))
{
if (sectortags.ContainsKey(l.Tag))
foreach (Sector s in sectortags[l.Tag])
{
foreach (Sector s in sectortags[l.Tag])
{
s.UpdateFloorSurface();
s.UpdateCeilingSurface();
}
s.UpdateFloorSurface();
s.UpdateCeilingSurface();
}
if (oldtag != 0 && sectortags.ContainsKey(oldtag))
{
foreach (Sector s in sectortags[oldtag])
{
s.UpdateFloorSurface();
s.UpdateCeilingSurface();
}
}
l.Front.Sector.UpdateFloorSurface();
l.Front.Sector.UpdateCeilingSurface();
}
if (sectortags.ContainsKey(oldtag) && oldtag != l.Tag)
{
foreach (Sector s in sectortags[oldtag])
{
s.UpdateFloorSurface();
s.UpdateCeilingSurface();
}
}
l.Front.Sector.UpdateFloorSurface();
l.Front.Sector.UpdateCeilingSurface();
}
// Update the used textures
@ -564,7 +561,24 @@ namespace CodeImp.DoomBuilder.Windows
LinedefActionInfo li = General.Map.Config.GetLinedefActionInfo(action.Value);
IDictionary<string, string> newFlags = (li == null || li.Flags.Count == 0) ? General.Map.Config.LinedefFlags : li.Flags;
flags.UpdateCheckboxes(newFlags);
}
// (Re)set hacky flat alignment
foreach (Linedef l in lines)
{
if (l.Tag == 0)
{
l.Front.Sector.UpdateFloorSurface();
l.Front.Sector.UpdateCeilingSurface();
}
else
foreach (Sector s in General.Map.Map.Sectors)
if (s.Tag == l.Tag)
{
s.UpdateFloorSurface();
s.UpdateCeilingSurface();
}
}
}
}
// Browse Action clicked
@ -611,6 +625,23 @@ namespace CodeImp.DoomBuilder.Windows
l.SetFlag(c.Tag.ToString(), false);
}
// (Re)set hacky flat alignment
if (l.IsFlatAlignment)
{
if (l.Tag == 0)
{
l.Front.Sector.UpdateFloorSurface();
l.Front.Sector.UpdateCeilingSurface();
}
else
foreach (Sector s in General.Map.Map.Sectors)
if (s.Tag == l.Tag)
{
s.UpdateFloorSurface();
s.UpdateCeilingSurface();
}
}
i++;
}
@ -824,6 +855,23 @@ namespace CodeImp.DoomBuilder.Windows
}
}
// (Re)set hacky flat alignment
if (l.IsFlatAlignment && l.IsFlagSet("8192"))
{
if (l.Tag == 0)
{
l.Front.Sector.UpdateFloorSurface();
l.Front.Sector.UpdateCeilingSurface();
}
else
foreach (Sector s in General.Map.Map.Sectors)
if (s.Tag == l.Tag)
{
s.UpdateFloorSurface();
s.UpdateCeilingSurface();
}
}
i++;
}