Checkpoint WebGL book reveal optimization

This commit is contained in:
2026-06-08 08:19:20 +02:00
parent 7abd3387f3
commit c86a304364
13 changed files with 618 additions and 112 deletions
+7 -1
View File
@@ -20,6 +20,7 @@ class ChoiceDisplayModule extends BaseModule {
this.currentTurnId = 0;
this.autoTurnCounter = 0;
this.lastAutoTurn = new Map();
this.selectionInProgress = false;
this.template = {
cells: {
default: {
@@ -136,6 +137,7 @@ class ChoiceDisplayModule extends BaseModule {
};
this.currentGlossaryEntries = detail.glossaryEntries;
this.choices = this.normalizeChoices(detail.choices);
this.selectionInProgress = false;
this.render();
}
@@ -159,7 +161,7 @@ class ChoiceDisplayModule extends BaseModule {
return;
}
if (event.ctrlKey || event.metaKey || event.altKey || event.key.length !== 1) {
if (event.repeat || event.ctrlKey || event.metaKey || event.altKey || event.key.length !== 1) {
return;
}
@@ -434,6 +436,9 @@ class ChoiceDisplayModule extends BaseModule {
}
async selectChoice(index) {
if (this.selectionInProgress) {
return;
}
if (!this.socketClient) {
this.socketClient = this.getModule('socket-client');
}
@@ -442,6 +447,7 @@ class ChoiceDisplayModule extends BaseModule {
return;
}
this.selectionInProgress = true;
this.clear();
document.dispatchEvent(new CustomEvent('story:process-state', {
detail: { state: 'command-waiting', reason: 'choice-selected', choiceIndex: index }