Fixed destination preview handle showing incorrectly

This commit is contained in:
Pax1601 2023-10-11 12:49:44 +02:00
parent 867d7697d2
commit 3c65aefe61
2 changed files with 14 additions and 9 deletions

View File

@ -751,11 +751,16 @@ export class Map extends L.Map {
const singleCursor = !this.#shiftKey;
const selectedUnitsCount = getApp().getUnitsManager().getSelectedUnits({ excludeHumans: true, onlyOnePerGroup: true }).length;
if (selectedUnitsCount > 0) {
if (singleCursor && this.#destinationPreviewCursors.length != 1) {
this.#hideDestinationCursors();
var marker = new DestinationPreviewMarker(this.getMouseCoordinates(), { interactive: false });
marker.addTo(this);
this.#destinationPreviewCursors = [marker];
if (singleCursor) {
if ( this.#destinationPreviewCursors.length != 1) {
this.#hideDestinationCursors();
var marker = new DestinationPreviewMarker(this.getMouseCoordinates(), { interactive: false });
marker.addTo(this);
this.#destinationPreviewCursors = [marker];
}
this.#destinationPreviewHandleLine.removeFrom(this);
this.#destinationPreviewHandle.removeFrom(this);
}
else if (!singleCursor) {
while (this.#destinationPreviewCursors.length > selectedUnitsCount) {

View File

@ -63,14 +63,14 @@
<div id="tanker-on" class="switch-control">
<h4>Enable tanker</h4>
<div id="tanker-on-switch" class="ol-switch"></div>
<div id="tanker-on-switch" class="ol-switch" title="Enables the ability to operate as air to air refueling tanker. A/A TACAN, radio frequency and callsign set in Settings dialog."></div>
<div>Instructs the unit to operate as AAR tanker. More options available in Settings dialog.</div>
</div>
<div id="AWACS-on" class="switch-control">
<h4>Enable AWACS</h4>
<div id="AWACS-on-switch" class="ol-switch"></div>
<div>Instructs the unit to operate as AWACS. More options available in Settings dialog.</div>
<h4>Airborne Early Warning</h4>
<div id="AWACS-on-switch" class="ol-switch" title="Enables datalink and AI radio calls. The unit will operate as Overlord. Radio frequency and callsign set in Settings dialog."></div>
<div>Instructs the unit to operate as airborne early warning. More options available in Settings dialog.</div>
</div>
<div id="operate-as" class="switch-control">