fix: Unit targets not being shown

This commit is contained in:
Pax1601 2025-03-25 09:58:37 +01:00
parent b20134f8f1
commit 8e55051410
3 changed files with 13 additions and 2 deletions

View File

@ -402,7 +402,7 @@ export const MAP_OPTIONS_DEFAULTS: MapOptions = {
hideUnitsShortRangeRings: true,
showUnitContacts: true,
showUnitPaths: true,
showUnitTargets: false,
showUnitTargets: true,
showUnitLabels: true,
showUnitsEngagementRings: true,
showUnitsAcquisitionRings: true,

View File

@ -155,6 +155,17 @@ export function OptionsMenu(props: { open: boolean; onClose: () => void; childre
<OlCheckbox checked={mapOptions.showUnitTargets} onChange={() => {}}></OlCheckbox>
<span className="my-auto">Show detection lines</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("showUnitTargets", !mapOptions.showUnitTargets)}
>
<OlCheckbox checked={mapOptions.showUnitTargets} onChange={() => {}}></OlCheckbox>
<span className="my-auto">Show unit targets</span>
</div>
<div
className={`
group flex cursor-pointer flex-row content-center justify-start

View File

@ -2355,7 +2355,7 @@ export abstract class Unit extends CustomMarker {
}
#drawTarget() {
if (this.#targetPosition.lat != 0 && this.#targetPosition.lng != 0 && getApp().getMap().getOptions().showUnitPaths) {
if (this.#targetPosition.lat != 0 && this.#targetPosition.lng != 0 && getApp().getMap().getOptions().showUnitTargets) {
this.#drawTargetPosition(this.#targetPosition);
} else if (this.#targetID != 0 && getApp().getMap().getOptions().showUnitTargets) {
const target = getApp().getUnitsManager().getUnitByID(this.#targetID);