mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-22 03:02:20 +00:00
Hold the shell's inputs between two engines instead of reaching released controllers
A visual choice made while no globe is attached (a style key, a Display control, a voice command) is queued and applied to the next engine's settings after it restored the address's view, so the person's choice wins; reads answer from the released settings. The globe reset and a location lookup started without a globe do nothing, and the map-source chips and camera buttons are unbound until the next globe binds them.
This commit is contained in:
1 parent
df73c5b21a
commit
40a81c58e6
7 files changed
+193
-5
No files matched your search
@@ -216,3 +216,30 @@ test('an attachment that throws part-way leaves the shell detached and attachabl
|
||||
assert.equal(shell.engine, engine);
|
||||
assert.ok(log.includes('shareRestoration.start'));
|
||||
});
|
||||
|
||||
test('between engines a style key waits for the next engine instead of the released settings', async () => {
|
||||
const { shell } = fakeShell();
|
||||
const released = [];
|
||||
shell._visualSettings = {
|
||||
stop() {},
|
||||
releaseIrBoost() {},
|
||||
destroy() {},
|
||||
setStyle: (name) => released.push(name),
|
||||
};
|
||||
Object.defineProperty(shell, 'initialRestorePromise', {
|
||||
value: Promise.resolve(),
|
||||
});
|
||||
await shell.detachScene({ handoff: true });
|
||||
shell.setStyle('crt');
|
||||
assert.deepEqual(released, [], 'the released settings do not change');
|
||||
const applied = [];
|
||||
shell._buildSceneControls = () => {
|
||||
shell._shareRestoration = { attachLinks() {}, start() {}, destroy() {} };
|
||||
shell._layerBindings = { observeCamera() {}, stop() {}, disconnect() {} };
|
||||
shell._visualSettings = { setStyle: (name) => applied.push(name) };
|
||||
};
|
||||
shell.attachScene({ engine: { kind: 'cesium' } });
|
||||
await Promise.resolve();
|
||||
await Promise.resolve();
|
||||
assert.deepEqual(applied, ['crt']);
|
||||
});
|
||||
Reference in new issue
Block a user