Cursor reflects game state over the 3D scene again
Two regressions made the cursor stop communicating game state: - The canvas had a hardcoded `cursor: grab`, overriding the document-level process-state cursor everywhere over the 3D scene (always a hand). Removed it so the canvas inherits the state cursor; grab is now shown only transiently while right-drag-rotating the camera. - normalizeProcessState pinned ready/waiting-generating to the playing (feather) cursor whenever playbackCoordinator.isPlaying was set, which lingered at choice prompts — so an open choice showed the feather instead of the input cursor. Now, when an input prompt is open AND no sentence is actively playing (timeline's webglBookPlaybackActive), the playback overlay is stripped (playing-ready->ready, playing-generating->waiting-generating) and the input/server cursor shows. Opening an input mode also refreshes the cursor immediately. Verified live over the canvas: feather while a sentence plays, input arrow at a choice/idle, and they switch correctly with playback state (no stuck feather, no constant grab). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,9 @@ import { OutputPass } from 'https://esm.sh/three@0.165.0/examples/jsm/postproces
|
||||
import { PROCEDURAL_BOOK, createProceduralBookModel, snapProceduralPageCount } from './procedural-book-model.js?v=20260610-book-timeline-l';
|
||||
|
||||
const canvas = document.getElementById('scene');
|
||||
canvas.style.cursor = 'grab';
|
||||
// The canvas inherits the document-level process-state cursor (awaiting input / server /
|
||||
// background / animation) so the 3D scene communicates game state like the overlay does.
|
||||
// A grab cursor is shown only transiently while actively right-drag-rotating the camera.
|
||||
const tableDebugModes = {
|
||||
none: 0,
|
||||
shadow: 1,
|
||||
@@ -4432,7 +4434,7 @@ function installCameraControls() {
|
||||
cameraRig.dragging = false;
|
||||
cameraRig.navigationActive = false;
|
||||
cameraRig.keys.clear();
|
||||
canvas.style.cursor = 'grab';
|
||||
canvas.style.cursor = '';
|
||||
canvas.releasePointerCapture(event.pointerId);
|
||||
});
|
||||
|
||||
@@ -4440,7 +4442,7 @@ function installCameraControls() {
|
||||
cameraRig.dragging = false;
|
||||
cameraRig.navigationActive = false;
|
||||
cameraRig.keys.clear();
|
||||
canvas.style.cursor = 'grab';
|
||||
canvas.style.cursor = '';
|
||||
});
|
||||
|
||||
canvas.addEventListener('wheel', (event) => {
|
||||
|
||||
Reference in New Issue
Block a user