Merge pull request #526 from Pax1601/523-selected-units-dont-get-hidden

Selected units now hidden on request
This commit is contained in:
Pax1601 2023-11-17 17:22:36 +01:00 committed by GitHub
commit 8905cd5e85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -682,9 +682,7 @@ export abstract class Unit extends CustomMarker {
(!this.belongsToCommandedCoalition() && (this.#detectionMethods.length == 0 || (this.#detectionMethods.length == 1 && this.#detectionMethods[0] === RWR))) ||
/* Hide the unit if grouping is activated, the unit is not the group leader, it is not selected, and the zoom is higher than the grouping threshold */
(getApp().getMap().getVisibilityOptions()[HIDE_GROUP_MEMBERS] && !this.#isLeader && this.getCategory() == "GroundUnit" && getApp().getMap().getZoom() < GROUPING_ZOOM_TRANSITION &&
(this.belongsToCommandedCoalition() || (!this.belongsToCommandedCoalition() && this.#detectionMethods.length == 0)))) &&
!(this.getSelected()
);
(this.belongsToCommandedCoalition() || (!this.belongsToCommandedCoalition() && this.#detectionMethods.length == 0))));
/* Force dead units to be hidden */
this.setHidden(hidden || !this.#alive);