mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Added Olympus unit toggle
This commit is contained in:
@@ -188,6 +188,13 @@ export const MAP_MARKER_CONTROLS: MapMarkerVisibilityControl[] = [{
|
||||
"protectable": true,
|
||||
"toggles": ["dcs"],
|
||||
"tooltip": "Toggle DCS-controlled units' visibility"
|
||||
}, {
|
||||
"image": "visibility/head-side-virus-solid.svg",
|
||||
"isProtected": false,
|
||||
"name": "Olympus",
|
||||
"protectable": false,
|
||||
"toggles": ["olympus"],
|
||||
"tooltip": "Toggle Olympus-controlled units' visibility"
|
||||
}, {
|
||||
"image": "visibility/aircraft.svg",
|
||||
"name": "Aircraft",
|
||||
|
||||
@@ -565,6 +565,14 @@ export abstract class Unit extends CustomMarker {
|
||||
return false;
|
||||
}
|
||||
|
||||
isControlledByDCS() {
|
||||
return this.getControlled() === false && this.getHuman() === false;
|
||||
}
|
||||
|
||||
isControlledByOlympus() {
|
||||
return this.getControlled() === true;
|
||||
}
|
||||
|
||||
/********************** Icon *************************/
|
||||
createIcon(): void {
|
||||
/* Set the icon */
|
||||
@@ -691,9 +699,11 @@ export abstract class Unit extends CustomMarker {
|
||||
const hiddenTypes = getApp().getMap().getHiddenTypes();
|
||||
var hidden = (
|
||||
/* Hide the unit if it is a human and humans are hidden */
|
||||
(this.#human && hiddenTypes.includes("human")) ||
|
||||
/* Hide the unit if it is DCS controlled and DCS controlled units are hidden */
|
||||
(this.#controlled == false && hiddenTypes.includes("dcs")) ||
|
||||
(this.getHuman() && hiddenTypes.includes("human")) ||
|
||||
/* Hide the unit if it is DCS-controlled and DCS controlled units are hidden */
|
||||
(this.isControlledByDCS() && hiddenTypes.includes("dcs")) ||
|
||||
/* Hide the unit if it is Olympus-controlled and Olympus-controlled units are hidden */
|
||||
(this.isControlledByOlympus() && hiddenTypes.includes("olympus")) ||
|
||||
/* Hide the unit if this specific category is hidden */
|
||||
(hiddenTypes.includes(this.getMarkerCategory())) ||
|
||||
/* Hide the unit if this coalition is hidden */
|
||||
|
||||
Reference in New Issue
Block a user