diff --git a/frontend/react/src/constants/constants.ts b/frontend/react/src/constants/constants.ts index 8264596b..58970552 100644 --- a/frontend/react/src/constants/constants.ts +++ b/frontend/react/src/constants/constants.ts @@ -419,6 +419,7 @@ export const MAP_OPTIONS_DEFAULTS: MapOptions = { hideChromeWarning: false, hideSecureWarning: false, showMissionDrawings: false, + showMissionNavpoints: false, clusterGroundUnits: true, showUnitCallsigns: true, }; diff --git a/frontend/react/src/map/drawings/drawingsmanager.ts b/frontend/react/src/map/drawings/drawingsmanager.ts index 4de83577..108bda5e 100644 --- a/frontend/react/src/map/drawings/drawingsmanager.ts +++ b/frontend/react/src/map/drawings/drawingsmanager.ts @@ -714,6 +714,7 @@ export class DrawingsManager { MapOptionsChangedEvent.on((mapOptions: MapOptions) => { this.#drawingsContainer.setVisibility(mapOptions.showMissionDrawings); + this.#navpointsContainer.setVisibility(mapOptions.showMissionNavpoints); }); SessionDataLoadedEvent.on((sessionData) => { @@ -724,6 +725,7 @@ export class DrawingsManager { if (this.#sessionDataNavpoints["Navpoints"]) this.#navpointsContainer.fromJSON(this.#sessionDataNavpoints["Navpoints"]); } this.#drawingsContainer.setVisibility(getApp().getMap().getOptions().showMissionDrawings); + this.#navpointsContainer.setVisibility(getApp().getMap().getOptions().showMissionNavpoints); }); } diff --git a/frontend/react/src/types/types.ts b/frontend/react/src/types/types.ts index d733f5d7..8e9a57e5 100644 --- a/frontend/react/src/types/types.ts +++ b/frontend/react/src/types/types.ts @@ -31,6 +31,7 @@ export type MapOptions = { hideChromeWarning: boolean; hideSecureWarning: boolean; showMissionDrawings: boolean; + showMissionNavpoints: boolean; clusterGroundUnits: boolean; showUnitCallsigns: boolean; }; diff --git a/frontend/react/src/ui/panels/drawingmenu.tsx b/frontend/react/src/ui/panels/drawingmenu.tsx index bfd5bee3..6433a136 100644 --- a/frontend/react/src/ui/panels/drawingmenu.tsx +++ b/frontend/react/src/ui/panels/drawingmenu.tsx @@ -170,7 +170,7 @@ export function DrawingMenu(props: { open: boolean; onClose: () => void }) { onClick={() => { const latLng = drawing.getLayer()["getLatLng"] && drawing.getLayer()["getLatLng"](); const bounds = drawing.getLayer()["getBounds"] && drawing.getLayer()["getBounds"](); - latLng && getApp().getMap().setView(latLng, 14); + latLng && getApp().getMap().setView(latLng, 10); bounds && getApp().getMap().fitBounds(bounds); }} /> diff --git a/frontend/react/src/ui/panels/header.tsx b/frontend/react/src/ui/panels/header.tsx index e9efa96c..8a2b3458 100644 --- a/frontend/react/src/ui/panels/header.tsx +++ b/frontend/react/src/ui/panels/header.tsx @@ -1,21 +1,17 @@ +import { faCompass } from "@fortawesome/free-regular-svg-icons"; +import { faCamera, faDrawPolygon, faFlag, faObjectGroup, faSkull, faTriangleExclamation, faVolumeHigh, faWifi } from "@fortawesome/free-solid-svg-icons"; import React, { useEffect, useRef, useState } from "react"; -import { OlRoundStateButton, OlStateButton, OlLockStateButton } from "../components/olstatebutton"; -import { faSkull, faCamera, faFlag, faVolumeHigh, faDrawPolygon, faTriangleExclamation, faWifi, faObjectGroup } from "@fortawesome/free-solid-svg-icons"; -import { OlDropdownItem, OlDropdown } from "../components/oldropdown"; -import { OlLabelToggle } from "../components/ollabeltoggle"; -import { getApp, IP, VERSION } from "../../olympusapp"; -import { - olButtonsVisibilityAirbase, - olButtonsVisibilityAircraft, - olButtonsVisibilityDcs, - olButtonsVisibilityGroundunit, - olButtonsVisibilityGroundunitSam, - olButtonsVisibilityHelicopter, - olButtonsVisibilityHuman, - olButtonsVisibilityNavyunit, - olButtonsVisibilityOlympus, -} from "../components/olicons"; +import { FaCheck, FaRedo, FaSpinner } from "react-icons/fa"; import { FaChevronLeft, FaChevronRight, FaFloppyDisk } from "react-icons/fa6"; +import { + AudioManagerState, + BLUE_COMMANDER, + COMMAND_MODE_OPTIONS_DEFAULTS, + GAME_MASTER, + MAP_HIDDEN_TYPES_DEFAULTS, + MAP_OPTIONS_DEFAULTS, + RED_COMMANDER, +} from "../../constants/constants"; import { AudioManagerStateChangedEvent, CommandModeOptionsChangedEvent, @@ -28,21 +24,23 @@ import { SessionDataLoadedEvent, SessionDataSavedEvent, } from "../../events"; -import { - AudioManagerState, - BLUE_COMMANDER, - COMMAND_MODE_OPTIONS_DEFAULTS, - GAME_MASTER, - LoginSubState, - MAP_HIDDEN_TYPES_DEFAULTS, - MAP_OPTIONS_DEFAULTS, - OlympusState, - RED_COMMANDER, -} from "../../constants/constants"; import { OlympusConfig } from "../../interfaces"; -import { FaCheck, FaRedo, FaSpinner } from "react-icons/fa"; +import { getApp, IP, VERSION } from "../../olympusapp"; +import { OlDropdown, OlDropdownItem } from "../components/oldropdown"; import { OlExpandingTooltip } from "../components/olexpandingtooltip"; -import { stat } from "fs"; +import { + olButtonsVisibilityAirbase, + olButtonsVisibilityAircraft, + olButtonsVisibilityDcs, + olButtonsVisibilityGroundunit, + olButtonsVisibilityGroundunitSam, + olButtonsVisibilityHelicopter, + olButtonsVisibilityHuman, + olButtonsVisibilityNavyunit, + olButtonsVisibilityOlympus, +} from "../components/olicons"; +import { OlLabelToggle } from "../components/ollabeltoggle"; +import { OlLockStateButton, OlRoundStateButton, OlStateButton } from "../components/olstatebutton"; export function Header() { const [mapHiddenTypes, setMapHiddenTypes] = useState(MAP_HIDDEN_TYPES_DEFAULTS); @@ -267,13 +265,9 @@ export function Header() { Game Master {enabledCommandModes.length > 0 && ( <> - {loadingNewCommandMode ? ( - - ) : ( - - )} + {loadingNewCommandMode ? : } )} @@ -299,9 +293,9 @@ export function Header() { {enabledCommandModes.length > 0 && ( <> {loadingNewCommandMode ? ( - + ) : ( )} @@ -330,9 +324,9 @@ export function Header() { {enabledCommandModes.length > 0 && ( <> {loadingNewCommandMode ? ( - + ) : ( )} @@ -367,9 +361,11 @@ export function Header() { onClick={() => { audioState === AudioManagerState.RUNNING ? getApp().getAudioManager().stop() : getApp().getAudioManager().start(); }} - className={audioState === AudioManagerState.ERROR ? ` - animate-pulse !border-red-500 !text-red-500 - ` : ""} + className={ + audioState === AudioManagerState.ERROR + ? `animate-pulse !border-red-500 !text-red-500` + : "" + } tooltip={() => ( )} /> + { + getApp().getMap().setOption("showMissionNavpoints", !mapOptions.showMissionNavpoints); + }} + tooltip={() => ( + + )} + /> getApp().getMap().setOption("showUnitsEngagementRings", !mapOptions.showUnitsEngagementRings)} checked={mapOptions.showUnitsEngagementRings}