Skip to content

Commit

Permalink
fix: move const enums to zoning.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
PeenScreeker committed Dec 1, 2024
1 parent a7526d1 commit e5359ba
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 33 deletions.
30 changes: 30 additions & 0 deletions scripts/pages/zoning/zoning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
39 changes: 6 additions & 33 deletions scripts/types-mom/panels.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;

Expand All @@ -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;
}

0 comments on commit e5359ba

Please sign in to comment.