mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Merge pull request #133 from Pax1601/102-smoke-spawn-menu-doesnt-work
102 smoke spawn menu doesnt work
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { LatLng } from "leaflet";
|
||||
import { getActiveCoalition, setActiveCoalition } from "..";
|
||||
import { spawnAircraft, spawnGroundUnit } from "../server/server";
|
||||
import { spawnAircraft, spawnGroundUnit, spawnSmoke } from "../server/server";
|
||||
import { aircraftDatabase } from "../units/aircraftdatabase";
|
||||
import { groundUnitsDatabase } from "../units/groundunitsdatabase";
|
||||
import { ContextMenu } from "./contextmenu";
|
||||
@@ -35,21 +35,26 @@ export class MapContextMenu extends ContextMenu {
|
||||
|
||||
document.addEventListener("contextMenuShow", (e: any) => {
|
||||
this.showSubMenu(e.detail.type);
|
||||
})
|
||||
});
|
||||
|
||||
document.addEventListener("contextMenuDeployAircraft", () => {
|
||||
this.hide();
|
||||
this.#spawnOptions.coalition = getActiveCoalition();
|
||||
if (this.#spawnOptions)
|
||||
spawnAircraft(this.#spawnOptions);
|
||||
})
|
||||
});
|
||||
|
||||
document.addEventListener("contextMenuDeployGroundUnit", () => {
|
||||
this.hide();
|
||||
this.#spawnOptions.coalition = getActiveCoalition();
|
||||
if (this.#spawnOptions)
|
||||
spawnGroundUnit(this.#spawnOptions);
|
||||
})
|
||||
});
|
||||
|
||||
document.addEventListener("contextMenuDeploySmoke", (e: any) => {
|
||||
this.hide();
|
||||
spawnSmoke(e.detail.color, this.getLatLng());
|
||||
});
|
||||
|
||||
this.hide();
|
||||
}
|
||||
|
||||
@@ -228,6 +228,7 @@ export class Map extends L.Map {
|
||||
|
||||
#onMouseDown(e: any)
|
||||
{
|
||||
this.hideAllContextMenus();
|
||||
if ((e.originalEvent.which == 1) && (e.originalEvent.button == 0))
|
||||
this.dragging.disable();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user