Skip to content

Commit

Permalink
feat: set default region height and allow corners to set bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
PeenScreeker authored and tsa96 committed Aug 28, 2024
1 parent aeac492 commit 6625e6f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions scripts/pages/zoning/zoning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ const PickType = {
teleDestYaw: 'teleDestYaw'
};

const FLT_MAX = 3.402823466e38;
const DEFAULT_HEIGHT = 160;

class ZoneMenu {
static panels = {
zoningMenu: $.GetContextPanel(),
Expand Down Expand Up @@ -356,8 +359,8 @@ class ZoneMenu {
static createRegion() {
return {
points: [] as number[][],
bottom: 0,
height: 0,
bottom: FLT_MAX,
height: DEFAULT_HEIGHT,
teleDestTargetname: ''
} as Region;
}
Expand Down Expand Up @@ -676,6 +679,10 @@ class ZoneMenu {
return;

case PickType.corner:
if (point.z < region.bottom) {
region.bottom = point.z;
this.panels.regionBottom.text = point.z.toFixed(2);
}
if (GameInterfaceAPI.GetSettingBool('mom_zone_two_click') && region.points.length === 1) {
region.points.push([region.points[0][0], point.y]);
this.addPointToList(region.points.length - 1, [region.points[0][0], point.y]);
Expand Down

0 comments on commit 6625e6f

Please sign in to comment.