Checkpoint WebGL book reveal optimization
This commit is contained in:
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user