feat(map): added option to toggle display of temporary engagement rings

This commit is contained in:
MarcoJayUsai 2025-04-28 16:22:51 +02:00
parent 5237dc688a
commit 600b649449
4 changed files with 14 additions and 0 deletions

View File

@ -406,6 +406,7 @@ export const MAP_OPTIONS_DEFAULTS: MapOptions = {
showUnitLabels: true,
showUnitsEngagementRings: true,
showUnitsAcquisitionRings: true,
showUnitsTemporaryEngagementRings: true,
showRacetracks: true,
fillSelectedRing: false,
showMinimap: false,

View File

@ -18,6 +18,7 @@ export type MapOptions = {
showUnitLabels: boolean;
showUnitsEngagementRings: boolean;
showUnitsAcquisitionRings: boolean;
showUnitsTemporaryEngagementRings: boolean;
showRacetracks: boolean;
fillSelectedRing: boolean;
showMinimap: boolean;

View File

@ -160,6 +160,17 @@ export function OptionsMenu(props: { open: boolean; onClose: () => void; childre
<OlCheckbox checked={mapOptions.showUnitsAcquisitionRings} onChange={() => {}}></OlCheckbox>
<span className="my-auto">Show detection rings</span>
</div>
<div
className={`
group flex cursor-pointer flex-row content-center justify-start
gap-4 rounded-md p-2
dark:hover:bg-olympus-400
`}
onClick={() => getApp().getMap().setOption("showUnitsTemporaryEngagementRings", !mapOptions.showUnitsTemporaryEngagementRings)}
>
<OlCheckbox checked={mapOptions.showUnitsTemporaryEngagementRings} onChange={() => {}}></OlCheckbox>
<span className="my-auto">Show temporary engagement rings</span>
</div>
<div
className={`
group flex cursor-pointer flex-row content-center justify-start

View File

@ -1644,6 +1644,7 @@ export abstract class Unit extends CustomMarker {
showTemporaryEngagementRing() {
if (!getApp().getMap().getOptions().showUnitsEngagementRings
&& !getApp().getMap().getOptions().showUnitsAcquisitionRings
&& getApp().getMap().getOptions().showUnitsTemporaryEngagementRings
&& this.#engagementRange > 0) {
this.#temporaryEngagementCircle.setLatLng(this.getPosition());
this.#temporaryEngagementCircle.setRadius(this.#engagementRange);