mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 01:32:19 +00:00
fix(selection): selecting or tracking a contact never recolours it
A tracked aircraft's icon and 3D model keep the colours they have untracked in Flights and Military Flights (no cyan, no lighter amber); only the icon's alpha changes (stale fade, clear while its model draws). A selected vessel or aid keeps its type colour instead of white, and a tracked satellite's dot keeps its class colour instead of yellow. An emergency stays red while tracked.
This commit is contained in:
1 parent
2f0c01eaa7
commit
f49352d228
23 files changed
+192
-108
No files matched your search
@@ -1,5 +1,3 @@
|
||||
import { TRACKED_ICON_COLOR } from '../layers/military/policy.js';
|
||||
import { TRACKED_CYAN } from '../layers/flights/policy.js';
|
||||
import { createRendering as civilRendering } from '../layers/flights/rendering.js';
|
||||
import { createRendering as militaryRendering } from '../layers/military/rendering.js';
|
||||
import { createMilitarySnapshotRenderer } from '../layers/military/snapshotRenderer.js';
|
||||
@@ -463,15 +461,16 @@ test('tint priorities cover normal, priority, emergency, tracking and Cockpit do
|
||||
assert.equal(rendering._modelColor('civil'), red);
|
||||
if (rendering._cockpitContactColor)
|
||||
assert.equal(rendering._cockpitContactColor('civil'), red);
|
||||
// Tracking never recolours: a tracked emergency stays red.
|
||||
flightState._trackedIcao = 'civil';
|
||||
assert.equal(
|
||||
rendering._modelColor('civil'),
|
||||
factory === civilRendering ? TRACKED_CYAN : TRACKED_ICON_COLOR,
|
||||
);
|
||||
assert.equal(rendering._modelColor('civil'), red);
|
||||
flightState._trackedIcao = null;
|
||||
flightState.records.data.set('civil', { emergency: null });
|
||||
// An ordinary model draws its mesh's own colours, whatever the billboard's.
|
||||
assert.deepEqual([...rendering._modelColor('civil')], [1, 1, 1, 1]);
|
||||
flightState._trackedIcao = 'civil';
|
||||
assert.deepEqual([...rendering._modelColor('civil')], [1, 1, 1, 1]);
|
||||
flightState._trackedIcao = null;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user