Completed range rings

This commit is contained in:
Pax1601
2023-10-06 16:07:54 +02:00
parent d462bd16b5
commit 0db2e56e32
15 changed files with 1761 additions and 1502 deletions

View File

@@ -29,6 +29,7 @@ export class ContextMenu {
this.#x = x;
this.#y = y;
this.clip();
this.getContainer()?.dispatchEvent(new Event("show"));
}
/** Hide the contextmenu
@@ -36,6 +37,7 @@ export class ContextMenu {
*/
hide() {
this.#container?.classList.toggle("hide", true);
this.getContainer()?.dispatchEvent(new Event("hide"));
}
/**

View File

@@ -79,7 +79,15 @@ export class MapContextMenu extends ContextMenu {
this.#groundUnitSpawnMenu.getContainer().addEventListener("hide", () => this.hide());
this.#navyUnitSpawnMenu.getContainer().addEventListener("hide", () => this.hide());
this.hide();
this.getContainer()?.addEventListener("show", () => this.#aircraftSpawnMenu.showCirclesPreviews());
this.getContainer()?.addEventListener("show", () => this.#helicopterSpawnMenu.showCirclesPreviews());
this.getContainer()?.addEventListener("show", () => this.#groundUnitSpawnMenu.showCirclesPreviews());
this.getContainer()?.addEventListener("show", () => this.#navyUnitSpawnMenu.showCirclesPreviews());
this.getContainer()?.addEventListener("hide", () => this.#aircraftSpawnMenu.clearCirclesPreviews());
this.getContainer()?.addEventListener("hide", () => this.#helicopterSpawnMenu.clearCirclesPreviews());
this.getContainer()?.addEventListener("hide", () => this.#groundUnitSpawnMenu.clearCirclesPreviews());
this.getContainer()?.addEventListener("hide", () => this.#navyUnitSpawnMenu.clearCirclesPreviews());
}
/** Show the contextmenu on top of the map, usually at the location where the user has clicked on it.
@@ -189,6 +197,11 @@ export class MapContextMenu extends ContextMenu {
this.#groundUnitSpawnMenu.reset();
this.#navyUnitSpawnMenu.reset();
this.#aircraftSpawnMenu.clearCirclesPreviews();
this.#helicopterSpawnMenu.clearCirclesPreviews();
this.#groundUnitSpawnMenu.clearCirclesPreviews();
this.#navyUnitSpawnMenu.clearCirclesPreviews();
this.setVisibleSubMenu(null);
this.clip();
}