mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-23 11:42:21 +00:00
Voice Cockpit entry no longer switches Contacts on (#1889)
* fix(voice): voice Cockpit entry no longer turns Contacts on Voice entry now changes no Context mode or detection setting, as the COCKPIT button does not. An entry that names a layer or class searches that layer's own aircraft, nearest first from the followed aircraft or the ground under the camera, and follows the nearest match before entering; the followed aircraft counts when it matches. A military request while Military Flights is off switches that layer on as a plain layer. The class filter is shared with Contacts navigation. * fix(voice): a military Cockpit entry waits for the layer's first data and leaves no layer behind A military entry that switched Military Flights on waits for that layer to report its first data before searching it, bounded by that update, the layer failing or going off, and the request's cancellation. If entry then fails, the layer is switched off again; a layer that was already on stays on. The search covers only the aircraft the person's filters show. * Add the changelog entry
This commit is contained in:
1 parent
5608b12a25
commit
fbbe6cd91f
9 files changed
+568
-384
No files matched your search
@@ -14,6 +14,35 @@ export const AWARENESS_RELATIONSHIP = Object.freeze({
|
||||
UNKNOWN: 'UNKNOWN',
|
||||
});
|
||||
|
||||
/**
|
||||
* Whether an aircraft matches a spoken class filter ("helicopter", "tanker"),
|
||||
* on its class or type fields. No filter matches everything; an aircraft
|
||||
* with no class or type matches no filter.
|
||||
* @param {object} item Aircraft summary (`getNearby` row or cohort item).
|
||||
* @param {string|null} aircraftClass Requested class.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export function aircraftClassMatches(item, aircraftClass) {
|
||||
const normalize = (value) =>
|
||||
String(value || '')
|
||||
.trim()
|
||||
.toLowerCase();
|
||||
const requested = normalize(aircraftClass);
|
||||
if (!requested) return true;
|
||||
return [
|
||||
item?.aircraftClass,
|
||||
item?.klass,
|
||||
item?.type,
|
||||
item?.typeCode,
|
||||
item?.typeName,
|
||||
]
|
||||
.map(normalize)
|
||||
.filter(Boolean)
|
||||
.some(
|
||||
(candidate) => candidate === requested || candidate.includes(requested),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Search an expanding area synchronously, doubling the radius after each miss.
|
||||
* The maximum covers the farthest possible Earth-surface chord while keeping
|
||||
|
||||
Reference in new issue
Block a user