From 1a3bcfcbffc05e7f9bebd0581075989197ca1d76 Mon Sep 17 00:00:00 2001 From: PeenScreeker Date: Tue, 26 Nov 2024 15:20:14 -0500 Subject: [PATCH] fix: move const enums to zoning.ts --- scripts/pages/zoning/zoning.ts | 30 ++++++++++++++++++++++++++ scripts/types-mom/panels.d.ts | 39 ++++++---------------------------- 2 files changed, 36 insertions(+), 33 deletions(-) diff --git a/scripts/pages/zoning/zoning.ts b/scripts/pages/zoning/zoning.ts index 66bd0038..0246b013 100644 --- a/scripts/pages/zoning/zoning.ts +++ b/scripts/pages/zoning/zoning.ts @@ -35,6 +35,36 @@ enum RegionMenu { RESET = 'Reset' } +export enum PickType { + NONE = 0, + CORNER = 1, + BOTTOM = 2, + HEIGHT = 3, + SAFE_HEIGHT = 4, + TELE_DEST_POS = 5, + TELE_DEST_YAW = 6 +} + +export enum RegionRenderMode { + NONE = 0, + START = 1, + START_WITH_SAFE_HEIGHT = 2, + TRACK_SWITCH = 3, + END = 4, + MAJOR_CHECKPOINT = 5, + MINOR_CHECKPOINT = 6, + CANCEL = 7 +} + +export enum RegionPolygonProblem { + INVALID_INPUT = -1, + NONE = 0, + POINTS_TOO_CLOSE = 1, + ANGLE_TOO_SMALL = 2, + COLINEAR_POINTS = 3, + SELF_INTERSECTING = 4 +} + @PanelHandler() class ZoneMenuHandler { readonly panels = { diff --git a/scripts/types-mom/panels.d.ts b/scripts/types-mom/panels.d.ts index 57fa4f39..5b806f12 100644 --- a/scripts/types-mom/panels.d.ts +++ b/scripts/types-mom/panels.d.ts @@ -132,29 +132,9 @@ interface MomHudDFJump extends AbstractHudPanel<'MomHudDFJump'> {} interface MomHudSynchronizer extends AbstractHudPanel<'MomHudSynchronizer'> {} -declare const enum RegionRenderMode { - NONE = 0, - START = 1, - START_WITH_SAFE_HEIGHT = 2, - TRACK_SWITCH = 3, - END = 4, - MAJOR_CHECKPOINT = 5, - MINOR_CHECKPOINT = 6, - CANCEL = 7 -} - -declare const enum RegionPolygonProblem { - INVALID_INPUT = -1, - NONE = 0, - POINTS_TOO_CLOSE = 1, - ANGLE_TOO_SMALL = 2, - COLINEAR_POINTS = 3, - SELF_INTERSECTING = 4 -} - interface ZoneEditorRegion { region: import('common/web').Region; - renderMode: RegionRenderMode; + renderMode: import('pages/zoning/zoning').RegionRenderMode; editing: boolean; } @@ -167,18 +147,8 @@ 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(mode: PickType): void; + startPointPick(mode: import('pages/zoning/zoning').PickType): void; getEntityList(): import('pages/zoning/zoning').EntityList; @@ -188,7 +158,10 @@ interface ZoneMenu extends AbstractPanel<'ZoneMenu'> { drawRegions(editorRegions: ZoneEditorRegion[]): void; - validateRegionPolygon(points: import('common/web').Vector2D[], closed: boolean): RegionPolygonProblem; + validateRegionPolygon( + points: import('common/web').Vector2D[], + closed: boolean + ): import('pages/zoning/zoning').RegionPolygonProblem; getZoningLimits(): ZoneEditorLimits; }