Added Olympus unit toggle

This commit is contained in:
PeekabooSteam
2023-12-02 12:47:00 +00:00
parent 0b8f48b4fd
commit 5da1df7e20
4 changed files with 22 additions and 4 deletions

View File

@@ -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",

View File

@@ -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 */