diff --git a/client/public/stylesheets/other/toolbar.css b/client/public/stylesheets/other/toolbar.css index 4754fa83..e770a8ca 100644 --- a/client/public/stylesheets/other/toolbar.css +++ b/client/public/stylesheets/other/toolbar.css @@ -68,7 +68,7 @@ display: none; } -#unit-visibility-control > div:nth-child(3), +#unit-visibility-control > div:nth-child(4), #coalition-visibility-control { border-left: 2px solid white; padding-left: 12px; diff --git a/client/public/themes/olympus/images/buttons/visibility/head-side-virus-solid.svg b/client/public/themes/olympus/images/buttons/visibility/head-side-virus-solid.svg new file mode 100644 index 00000000..b701e751 --- /dev/null +++ b/client/public/themes/olympus/images/buttons/visibility/head-side-virus-solid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/client/src/constants/constants.ts b/client/src/constants/constants.ts index d3961b1f..41ec43fc 100644 --- a/client/src/constants/constants.ts +++ b/client/src/constants/constants.ts @@ -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", diff --git a/client/src/unit/unit.ts b/client/src/unit/unit.ts index 1e6df10a..57483072 100644 --- a/client/src/unit/unit.ts +++ b/client/src/unit/unit.ts @@ -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 */