mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Robots are no longer considered for waypoints
This commit is contained in:
parent
25edfc45e5
commit
0e78b7559b
@ -791,7 +791,7 @@ export class Map extends L.Map {
|
||||
|
||||
#showDestinationCursors() {
|
||||
const singleCursor = !this.#shiftKey;
|
||||
const selectedUnitsCount = getApp().getUnitsManager().getSelectedUnits({ excludeHumans: true, onlyOnePerGroup: true }).length;
|
||||
const selectedUnitsCount = getApp().getUnitsManager().getSelectedUnits({ excludeHumans: true, excludeProtected: true, onlyOnePerGroup: true }).length;
|
||||
if (singleCursor) {
|
||||
this.#hideDestinationCursors();
|
||||
}
|
||||
@ -817,7 +817,7 @@ export class Map extends L.Map {
|
||||
}
|
||||
|
||||
#updateDestinationCursors() {
|
||||
const selectedUnitsCount = getApp().getUnitsManager().getSelectedUnits({ excludeHumans: true, onlyOnePerGroup: true }).length;
|
||||
const selectedUnitsCount = getApp().getUnitsManager().getSelectedUnits({ excludeHumans: true, excludeProtected: true, onlyOnePerGroup: true }).length;
|
||||
if (selectedUnitsCount > 1) {
|
||||
const groupLatLng = this.#computeDestinationRotation && this.#destinationRotationCenter != null ? this.#destinationRotationCenter : this.getMouseCoordinates();
|
||||
if (this.#destinationPreviewCursors.length == 1)
|
||||
|
||||
@ -138,6 +138,10 @@ export class UnitsManager {
|
||||
return;
|
||||
const messageText = (numOfProtectedUnits === 1) ? `Unit is protected` : `All selected units are protected`;
|
||||
(getApp().getPopupsManager().get("infoPopup") as Popup).setText(messageText);
|
||||
// Cheap way for now until we use more locks
|
||||
let lock = <HTMLElement>document.querySelector("#unit-visibility-control button.lock");
|
||||
lock.classList.add("prompt");
|
||||
setTimeout(() => lock.classList.remove("prompt"), 4000);
|
||||
}
|
||||
|
||||
/** Update the data of all the units. The data is directly decoded from the binary buffer received from the REST Server. This is necessary for performance and bandwidth reasons.
|
||||
@ -301,13 +305,8 @@ export class UnitsManager {
|
||||
}
|
||||
}
|
||||
if (options) {
|
||||
if (options.showProtectionReminder === true && numProtectedUnits > selectedUnits.length && selectedUnits.length === 0) {
|
||||
if (options.showProtectionReminder === true && numProtectedUnits > selectedUnits.length && selectedUnits.length === 0)
|
||||
this.showProtectedUnitsPopup(numProtectedUnits);
|
||||
// Cheap way for now until we use more locks
|
||||
let lock = <HTMLElement>document.querySelector("#unit-visibility-control button.lock");
|
||||
lock.classList.add("prompt");
|
||||
setTimeout(() => lock.classList.remove("prompt"), 4000);
|
||||
}
|
||||
|
||||
if (options.onlyOnePerGroup) {
|
||||
var temp: Unit[] = [];
|
||||
@ -1148,6 +1147,14 @@ export class UnitsManager {
|
||||
if (units === null)
|
||||
units = this.getSelectedUnits({ excludeHumans: true, excludeProtected: true, onlyOnePerGroup: true });
|
||||
|
||||
const segregatedUnits = this.segregateUnits(units);
|
||||
if (segregatedUnits.controllable.length === 0) {
|
||||
this.showProtectedUnitsPopup(segregatedUnits.dcsProtected.length);
|
||||
return {};
|
||||
}
|
||||
|
||||
units = segregatedUnits.controllable;
|
||||
|
||||
if (units.length === 0)
|
||||
return {};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user