Slightly tweaked size of Controls list. Added 'Reset plane slope' action.

This commit is contained in:
ZZYZX 2020-12-28 00:13:56 +02:00
parent a3aba9b371
commit eaa5227dc8
4 changed files with 2430 additions and 2351 deletions

View file

@ -1,4 +1,4 @@
URL http://devbuilds.drdteam.org/ultimatedoombuilder/
FileName Builder.exe
UpdateName UltimateDoomBuilder-r[REVNUM]-x64.7z
UpdaterName UDB_Updater-x64.7z
UpdateName UltimateDoomBuilder-r[REVNUM]-x86.7z
UpdaterName UDB_Updater-x86.7z

File diff suppressed because it is too large Load diff

View file

@ -1426,6 +1426,16 @@ togglevisualslopepicking
allowscroll = false;
}
resetslope
{
title = "Reset Plane Slope";
category = "visual";
description = "Resets UDMF slope applied to a floor/ceiling.";
allowkeys = true;
allowmouse = true;
allowscroll = false;
}
slopebetweenhandles
{
title = "Slope Between Handles";

View file

@ -4245,6 +4245,75 @@ namespace CodeImp.DoomBuilder.BuilderModes
}
}
[BeginAction("resetslope")]
public void ResetSlope()
{
List<IVisualEventReceiver> selectedsectors = GetSelectedObjects(true, false, false, false, false);
if (selectedsectors.Count == 0)
{
General.Interface.DisplayStatus(StatusType.Warning, "You need to select at least one floor or ceiling to reset slope.");
return;
}
General.Map.UndoRedo.CreateUndo("Reset plane slope");
int numfloors = 0;
int numceilings = 0;
// Reset slope
foreach (BaseVisualGeometrySector bvgs in selectedsectors)
{
SectorLevel level = bvgs.Level;
bool applytoceiling = false;
if (level.extrafloor)
{
// The top side of 3D floors is the ceiling of the sector, but it's a "floor" in UDB, so the
// ceiling of the control sector has to be modified
if (level.type == SectorLevelType.Floor)
applytoceiling = true;
}
else
{
if (level.type == SectorLevelType.Ceiling)
applytoceiling = true;
}
if (applytoceiling)
{
level.sector.CeilSlopeOffset = 0;
level.sector.CeilSlope = new Vector3D(0, 0, -1);
numceilings++;
}
else
{
level.sector.FloorSlopeOffset = 0;
level.sector.FloorSlope = new Vector3D(0, 0, 1);
numfloors++;
}
// Rebuild sector
BaseVisualSector vs;
if (VisualSectorExists(level.sector))
{
vs = (BaseVisualSector)GetVisualSector(level.sector);
}
else
{
vs = CreateBaseVisualSector(level.sector);
}
if (vs != null) vs.UpdateSectorGeometry(true);
}
string ptype = "plane";
if (numfloors == 0) ptype = "ceiling";
else if (numceilings == 0) ptype = "floor";
UpdateChangedObjects();
General.Interface.DisplayStatus(StatusType.Action, string.Format("{1} {0} slopes reset.", ptype, numfloors+numceilings));
}
[BeginAction("slopebetweenhandles")]
public void SlopeBetweenHandles()
{