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
@@ -81,12 +81,12 @@ test('an untinted model draws its mesh in its own colours', () => {
|
||||
}
|
||||
});
|
||||
|
||||
test('the tracked and emergency tints keep every paint, never black or one flat colour', () => {
|
||||
test('the emergency tints keep every paint, never black or one flat colour', () => {
|
||||
const tints = {
|
||||
'tracked cyan': flightsPolicy.TRACKED_CYAN,
|
||||
emergency: flightsPolicy.EMERGENCY_TINT,
|
||||
'military tracked': militaryPolicy.TRACKED_ICON_COLOR,
|
||||
'military emergency': militaryPolicy.EMERGENCY_ICON_COLOR,
|
||||
// Any saturated tint: one with no red once drew a red helicopter black.
|
||||
cyan: [0, 1, 1, 1],
|
||||
};
|
||||
for (const [tintName, tint] of Object.entries(tints)) {
|
||||
const blend = aircraftModelBlend(false, tint);
|
||||
@@ -94,7 +94,7 @@ test('the tracked and emergency tints keep every paint, never black or one flat
|
||||
for (const [paintName, paint] of Object.entries(PAINTS)) {
|
||||
const out = blended(paint, tint, blend);
|
||||
drawn[paintName] = out;
|
||||
// Multiplying by the tracked cyan (no red) drew a red helicopter black.
|
||||
// Multiplying by a tint with no red drew a red helicopter black.
|
||||
paint.forEach((c, i) =>
|
||||
assert.ok(
|
||||
out[i] >= c * 0.6,
|
||||
@@ -110,6 +110,6 @@ test('the tracked and emergency tints keep every paint, never black or one flat
|
||||
});
|
||||
|
||||
test('the IR boost draws every model flat white whatever its tint', () => {
|
||||
for (const tint of [null, flightsPolicy.TRACKED_CYAN])
|
||||
for (const tint of [null, flightsPolicy.EMERGENCY_TINT])
|
||||
assert.deepEqual(aircraftModelBlend(true, tint), { mode: 'mix', amount: 1 });
|
||||
});
|
||||
Reference in new issue
Block a user