mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Added airbase info and spawn menu
This commit is contained in:
@@ -12,7 +12,6 @@ export class Airbase extends CustomMarker {
|
||||
runways: [],
|
||||
};
|
||||
#coalition: string = "";
|
||||
#hasChartDataBeenSet: boolean = false;
|
||||
#properties: string[] = [];
|
||||
#parkings: string[] = [];
|
||||
|
||||
@@ -22,10 +21,6 @@ export class Airbase extends CustomMarker {
|
||||
this.#name = options.name;
|
||||
}
|
||||
|
||||
chartDataHasBeenSet() {
|
||||
return this.#hasChartDataBeenSet;
|
||||
}
|
||||
|
||||
createIcon() {
|
||||
var icon = new DivIcon({
|
||||
className: "leaflet-airbase-marker",
|
||||
@@ -43,10 +38,10 @@ export class Airbase extends CustomMarker {
|
||||
el.appendChild(img);
|
||||
this.getElement()?.appendChild(el);
|
||||
el.addEventListener("mouseover", (ev) => {
|
||||
document.dispatchEvent(new CustomEvent("airbaseMouseover", { detail: this }));
|
||||
document.dispatchEvent(new CustomEvent("airbasemouseover", { detail: this }));
|
||||
});
|
||||
el.addEventListener("mouseout", (ev) => {
|
||||
document.dispatchEvent(new CustomEvent("airbaseMouseout", { detail: this }));
|
||||
document.dispatchEvent(new CustomEvent("airbasemouseout", { detail: this }));
|
||||
});
|
||||
el.dataset.coalition = this.#coalition;
|
||||
}
|
||||
@@ -73,7 +68,6 @@ export class Airbase extends CustomMarker {
|
||||
}
|
||||
|
||||
setChartData(chartData: AirbaseChartData) {
|
||||
this.#hasChartDataBeenSet = true;
|
||||
this.#chartData = chartData;
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ export class MissionManager {
|
||||
position: new LatLng(airbase.latitude, airbase.longitude),
|
||||
name: airbase.callsign,
|
||||
}).addTo(getApp().getMap());
|
||||
this.#airbases[airbase.callsign].on("contextmenu", (e) => this.#onAirbaseClick(e));
|
||||
this.#airbases[airbase.callsign].on("click", (e) => this.#onAirbaseClick(e));
|
||||
this.#loadAirbaseChartData(airbase.callsign);
|
||||
}
|
||||
|
||||
@@ -316,7 +316,9 @@ export class MissionManager {
|
||||
if (requestRefresh) getApp().getServerManager().refreshAll();
|
||||
}
|
||||
|
||||
#onAirbaseClick(e: any) {}
|
||||
#onAirbaseClick(ev: any) {
|
||||
document.dispatchEvent(new CustomEvent("airbaseclick", { detail: ev.target }));
|
||||
}
|
||||
|
||||
#loadAirbaseChartData(callsign: string) {
|
||||
if (!this.#theatre) {
|
||||
@@ -324,7 +326,7 @@ export class MissionManager {
|
||||
}
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", `api/airbases/${this.#theatre.toLowerCase()}/${callsign}`, true);
|
||||
xhr.open("GET", window.location.href.split("?")[0].replace("vite/", "") + `api/airbases/${this.#theatre.toLowerCase()}/${callsign}`, true);
|
||||
xhr.responseType = "json";
|
||||
xhr.onload = () => {
|
||||
var status = xhr.status;
|
||||
|
||||
Reference in New Issue
Block a user