mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
feat: added airborne variable
This commit is contained in:
@@ -513,6 +513,7 @@ export enum DataIndexes {
|
||||
targetingRange,
|
||||
aimMethodRange,
|
||||
acquisitionRange,
|
||||
airborne,
|
||||
endOfData = 255,
|
||||
}
|
||||
|
||||
|
||||
@@ -283,6 +283,7 @@ export interface UnitData {
|
||||
targetingRange: number;
|
||||
aimMethodRange: number;
|
||||
acquisitionRange: number;
|
||||
airborne: boolean;
|
||||
}
|
||||
|
||||
export interface LoadoutItemBlueprint {
|
||||
|
||||
@@ -2269,11 +2269,13 @@ export function UnitControlMenu(props: { open: boolean; onClose: () => void }) {
|
||||
</div>
|
||||
|
||||
<div className="my-auto text-sm text-gray-400">{selectedUnits[0].getTask()}</div>
|
||||
{([UnitState.SIMULATE_FIRE_FIGHT, UnitState.MISS_ON_PURPOSE, UnitState.SCENIC_AAA] as string[]).includes(selectedUnits[0].getState()) && (
|
||||
{/* Useful for debugging but very data hungry
|
||||
|
||||
([UnitState.SIMULATE_FIRE_FIGHT, UnitState.MISS_ON_PURPOSE, UnitState.SCENIC_AAA] as string[]).includes(selectedUnits[0].getState()) && (
|
||||
<div className="my-auto text-sm text-gray-400">
|
||||
Time to next tasking: {zeroAppend(selectedUnits[0].getTimeToNextTasking(), 0, true, 2)}s
|
||||
</div>
|
||||
)}
|
||||
)*/}
|
||||
|
||||
<div className="flex content-center gap-2">
|
||||
<OlLocation
|
||||
|
||||
@@ -154,6 +154,7 @@ export abstract class Unit extends CustomMarker {
|
||||
#racetrackLength: number = 0;
|
||||
#racetrackAnchor: LatLng = new LatLng(0, 0);
|
||||
#racetrackBearing: number = 0;
|
||||
#airborne: boolean = false;
|
||||
|
||||
/* Other members used to draw the unit, mostly ancillary stuff like targets, ranges and so on */
|
||||
#blueprint: UnitBlueprint | null = null;
|
||||
@@ -391,6 +392,9 @@ export abstract class Unit extends CustomMarker {
|
||||
getAcquisitionRange() {
|
||||
return this.#acquisitionRange;
|
||||
}
|
||||
getAirborne() {
|
||||
return this.#airborne;
|
||||
}
|
||||
|
||||
static getConstructor(type: string) {
|
||||
if (type === "GroundUnit") return GroundUnit;
|
||||
@@ -754,6 +758,9 @@ export abstract class Unit extends CustomMarker {
|
||||
case DataIndexes.acquisitionRange:
|
||||
this.#acquisitionRange = dataExtractor.extractFloat64();
|
||||
break;
|
||||
case DataIndexes.airborne:
|
||||
this.#airborne = dataExtractor.extractBool();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -874,6 +881,7 @@ export abstract class Unit extends CustomMarker {
|
||||
targetingRange: this.#targetingRange,
|
||||
aimMethodRange: this.#aimMethodRange,
|
||||
acquisitionRange: this.#acquisitionRange,
|
||||
airborne: this.#airborne
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user