diff --git a/client/@types/olympus/index.d.ts b/client/@types/olympus/index.d.ts index 835537c5..397f5c32 100644 --- a/client/@types/olympus/index.d.ts +++ b/client/@types/olympus/index.d.ts @@ -854,17 +854,20 @@ declare module "controls/unitspawnmenu" { import { UnitDatabase } from "unit/databases/unitdatabase"; import { Airbase } from "mission/airbase"; import { UnitSpawnOptions } from "interfaces"; - export class UnitSpawnMenu { + /** This is the common code for all the unit spawn menus. It is shown both when right clicking on the map and when spawning from airbase. + * + */ + export abstract class UnitSpawnMenu { #private; protected showRangeCircles: boolean; - protected spawnOptions: UnitSpawnOptions; protected unitTypeFilter: (unit: any) => boolean; + protected spawnOptions: UnitSpawnOptions; constructor(ID: string, unitDatabase: UnitDatabase, orderByRole: boolean); + abstract deployUnits(spawnOptions: UnitSpawnOptions, unitsCount: number): void; getContainer(): HTMLElement; getVisible(): boolean; reset(): void; setCountries(): void; - refreshOptions(): void; showCirclesPreviews(): void; clearCirclesPreviews(): void; setAirbase(airbase: Airbase | undefined): void; @@ -878,7 +881,8 @@ declare module "controls/unitspawnmenu" { getLiveryDropdown(): Dropdown; getLoadoutPreview(): HTMLDivElement; getAltitudeSlider(): Slider; - deployUnits(spawnOptions: UnitSpawnOptions, unitsCount: number): void; + setShowLoadout(showLoadout: boolean): void; + setShowAltitudeSlider(showAltitudeSlider: boolean): void; } export class AircraftSpawnMenu extends UnitSpawnMenu { /** @@ -1265,6 +1269,8 @@ declare module "unit/unit" { setGroup(group: Group | null): void; drawLines(): void; checkZoomRedraw(): boolean; + isControlledByDCS(): boolean; + isControlledByOlympus(): boolean; /********************** Icon *************************/ createIcon(): void; /********************** Visibility *************************/ diff --git a/client/public/stylesheets/other/toolbar.css b/client/public/stylesheets/other/toolbar.css index bae81189..8c3ec441 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) { 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..32f24448 100644 --- a/client/src/constants/constants.ts +++ b/client/src/constants/constants.ts @@ -181,6 +181,13 @@ export const MAP_MARKER_CONTROLS: MapMarkerVisibilityControl[] = [{ "image": "visibility/human.svg", "toggles": ["human"], "tooltip": "Toggle human players' visibility" +}, { + "image": "visibility/head-side-virus-solid.svg", + "isProtected": false, + "name": "Olympus", + "protectable": false, + "toggles": ["olympus"], + "tooltip": "Toggle Olympus-controlled units' visibility" }, { "image": "visibility/dcs.svg", "isProtected": true, 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 */