mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-29 15:11:56 +00:00
192ddc9e6c
- Add two new example scripts, remove one useless example script
33 lines
782 B
JavaScript
33 lines
782 B
JavaScript
/// <reference path="../udbscript.d.ts" />
|
|
|
|
`#version 5`;
|
|
|
|
`#name Copy slope from opposite surface`;
|
|
|
|
`#scriptoptions
|
|
|
|
surfaceType
|
|
{
|
|
description = "Affected surface type";
|
|
default = 0;
|
|
type = 11; // Enum
|
|
enumvalues {
|
|
0 = "Floor";
|
|
1 = "Ceiling";
|
|
}
|
|
}
|
|
`;
|
|
|
|
UDB.Map.getSelectedOrHighlightedSectors().forEach(sector => {
|
|
if (UDB.ScriptOptions.surfaceType == 0) {
|
|
const slope = sector.getCeilingSlope();
|
|
sector.setFloorSlope([-slope.x, -slope.y, -slope.z]);
|
|
sector.floorSlopeOffset = -sector.ceilingSlopeOffset;
|
|
sector.floorHeight = sector.ceilingHeight;
|
|
} else {
|
|
const slope = sector.getFloorSlope();
|
|
sector.setCeilingSlope([-slope.x, -slope.y, -slope.z]);
|
|
sector.ceilingSlopeOffset = -sector.floorSlopeOffset;
|
|
sector.ceilingHeight = sector.floorHeight;
|
|
}
|
|
});
|