Skip to content

Commit

Permalink
feat: teleport to region on double click
Browse files Browse the repository at this point in the history
  • Loading branch information
PeenScreeker committed Sep 13, 2024
1 parent 3028525 commit e3dbfd6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/pages/zoning/zoning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,11 @@ class ZoneMenuHandler {
selectButton.SetPanelEvent('onactivate', () =>
this.updateSelection(selectionObj.track, selectionObj.segment, selectionObj.zone)
);
if (selectionObj.zone) {
selectButton.SetPanelEvent('ondblclick', () =>
this.panels.zoningMenu.moveToRegion(selectionObj.zone.regions[0])
);
}

if (setActive) {
selectButton.SetSelected(true);
Expand Down
2 changes: 2 additions & 0 deletions scripts/types-mom/panels.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,6 @@ interface ZoneMenu extends AbstractPanel<'ZoneMenu'> {
getEntityList(): import('pages/zoning/zoning').EntityList;

setCornersFromRegion(region: import('common/web').Region): void;

moveToRegion(region: import('common/web').Region): void;
}

0 comments on commit e3dbfd6

Please sign in to comment.