Skip to content

Commit

Permalink
feat: pass point placement mode to c++
Browse files Browse the repository at this point in the history
  • Loading branch information
PeenScreeker committed Dec 1, 2024
1 parent ffacecd commit 42a6770
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
22 changes: 6 additions & 16 deletions scripts/pages/zoning/zoning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,6 @@ enum DefragFlags {
BFG = 1 << 5
}

enum PickType {
NONE,
CORNER,
BOTTOM,
HEIGHT,
SAFE_HEIGHT,
TELE_DEST_POS,
TELE_DEST_YAW
}

enum RegionMenu {
POINTS = 'Points',
PROPERTIES = 'Properties',
Expand Down Expand Up @@ -574,7 +564,7 @@ class ZoneMenuHandler {
region.points.length = 0;
this.panels.pointsList.RemoveAndDeleteChildren();
}
this.panels.zoningMenu.startPointPick(true);
this.panels.zoningMenu.startPointPick(this.pointPick);

this.panels.zoningMenu.setCornersFromRegion(region);
}
Expand Down Expand Up @@ -614,7 +604,7 @@ class ZoneMenuHandler {

pickBottom() {
this.pointPick = PickType.BOTTOM;
this.panels.zoningMenu.startPointPick(false);
this.panels.zoningMenu.startPointPick(this.pointPick);
}

setRegionBottom() {
Expand All @@ -630,7 +620,7 @@ class ZoneMenuHandler {

pickHeight() {
this.pointPick = PickType.HEIGHT;
this.panels.zoningMenu.startPointPick(false);
this.panels.zoningMenu.startPointPick(this.pointPick);
}

setRegionHeight() {
Expand All @@ -646,7 +636,7 @@ class ZoneMenuHandler {

pickSafeHeight() {
this.pointPick = PickType.SAFE_HEIGHT;
this.panels.zoningMenu.startPointPick(false);
this.panels.zoningMenu.startPointPick(this.pointPick);
}

setRegionSafeHeight() {
Expand All @@ -662,12 +652,12 @@ class ZoneMenuHandler {

pickTeleDestPos() {
this.pointPick = PickType.TELE_DEST_POS;
this.panels.zoningMenu.startPointPick(false);
this.panels.zoningMenu.startPointPick(this.pointPick);
}

pickTeleDestYaw() {
this.pointPick = PickType.TELE_DEST_YAW;
this.panels.zoningMenu.startPointPick(false);
this.panels.zoningMenu.startPointPick(this.pointPick);
}

updateRegionTPDest() {
Expand Down
12 changes: 11 additions & 1 deletion scripts/types-mom/panels.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,18 @@ interface ZoneEditorLimits {
MAX_ZONES_ALL_TRACKS: number;
}

declare const enum PickType {
NONE = 0,
CORNER = 1,
BOTTOM = 2,
HEIGHT = 3,
SAFE_HEIGHT = 4,
TELE_DEST_POS = 5,
TELE_DEST_YAW = 6
}

interface ZoneMenu extends AbstractPanel<'ZoneMenu'> {
startPointPick(multiPick: boolean): void;
startPointPick(mode: PickType): void;

getEntityList(): import('pages/zoning/zoning').EntityList;

Expand Down

0 comments on commit 42a6770

Please sign in to comment.