Introduce suppressNextDialogueAdvanceClick in RuntimeHost and related updates
This commit is contained in:
@@ -282,6 +282,7 @@ export class RuntimeHost {
|
|||||||
null;
|
null;
|
||||||
private currentInteractionPrompt: RuntimeInteractionPrompt | null = null;
|
private currentInteractionPrompt: RuntimeInteractionPrompt | null = null;
|
||||||
private currentDialogue: RuntimeDialogueState | null = null;
|
private currentDialogue: RuntimeDialogueState | null = null;
|
||||||
|
private suppressNextDialogueAdvanceClick = false;
|
||||||
private currentSceneLoadState: RuntimeSceneLoadState | null = null;
|
private currentSceneLoadState: RuntimeSceneLoadState | null = null;
|
||||||
private currentClockState: RuntimeClockState | null = null;
|
private currentClockState: RuntimeClockState | null = null;
|
||||||
private lastPublishedClockState: RuntimeClockState | null = null;
|
private lastPublishedClockState: RuntimeClockState | null = null;
|
||||||
@@ -487,6 +488,7 @@ export class RuntimeHost {
|
|||||||
this.interactionSystem.reset();
|
this.interactionSystem.reset();
|
||||||
this.setInteractionPrompt(null);
|
this.setInteractionPrompt(null);
|
||||||
this.setRuntimeDialogue(null);
|
this.setRuntimeDialogue(null);
|
||||||
|
this.suppressNextDialogueAdvanceClick = false;
|
||||||
this.currentPlayerControllerTelemetry = null;
|
this.currentPlayerControllerTelemetry = null;
|
||||||
this.currentPlayerAudioHooks = null;
|
this.currentPlayerAudioHooks = null;
|
||||||
this.playerControllerTelemetryHandler?.(null);
|
this.playerControllerTelemetryHandler?.(null);
|
||||||
@@ -599,6 +601,7 @@ export class RuntimeHost {
|
|||||||
const nextLineIndex = this.currentDialogue.lineIndex + 1;
|
const nextLineIndex = this.currentDialogue.lineIndex + 1;
|
||||||
|
|
||||||
if (nextLineIndex >= dialogue.lines.length) {
|
if (nextLineIndex >= dialogue.lines.length) {
|
||||||
|
this.suppressNextDialogueAdvanceClick = false;
|
||||||
this.setRuntimeDialogue(null);
|
this.setRuntimeDialogue(null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -613,6 +616,7 @@ export class RuntimeHost {
|
|||||||
}
|
}
|
||||||
|
|
||||||
closeRuntimeDialogue() {
|
closeRuntimeDialogue() {
|
||||||
|
this.suppressNextDialogueAdvanceClick = false;
|
||||||
this.setRuntimeDialogue(null);
|
this.setRuntimeDialogue(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3081,7 +3085,8 @@ export class RuntimeHost {
|
|||||||
this.currentDialogue?.source.kind === dialogue?.source.kind &&
|
this.currentDialogue?.source.kind === dialogue?.source.kind &&
|
||||||
this.currentDialogue?.source.sourceEntityId ===
|
this.currentDialogue?.source.sourceEntityId ===
|
||||||
dialogue?.source.sourceEntityId &&
|
dialogue?.source.sourceEntityId &&
|
||||||
this.currentDialogue?.source.linkId === dialogue?.source.linkId
|
this.currentDialogue?.source.linkId === dialogue?.source.linkId &&
|
||||||
|
this.currentDialogue?.source.trigger === dialogue?.source.trigger
|
||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -3095,7 +3100,8 @@ export class RuntimeHost {
|
|||||||
source: RuntimeDialogueStartSource = {
|
source: RuntimeDialogueStartSource = {
|
||||||
kind: "direct",
|
kind: "direct",
|
||||||
sourceEntityId: null,
|
sourceEntityId: null,
|
||||||
linkId: null
|
linkId: null,
|
||||||
|
trigger: null
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
if (this.currentDialogue?.dialogueId === dialogueId) {
|
if (this.currentDialogue?.dialogueId === dialogueId) {
|
||||||
@@ -3109,6 +3115,8 @@ export class RuntimeHost {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.suppressNextDialogueAdvanceClick =
|
||||||
|
source.trigger === "enter" || source.trigger === "exit";
|
||||||
this.setRuntimeDialogue(dialogue);
|
this.setRuntimeDialogue(dialogue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3159,6 +3167,11 @@ export class RuntimeHost {
|
|||||||
this.audioSystem.handleUserGesture();
|
this.audioSystem.handleUserGesture();
|
||||||
|
|
||||||
if (this.currentDialogue !== null) {
|
if (this.currentDialogue !== null) {
|
||||||
|
if (this.suppressNextDialogueAdvanceClick) {
|
||||||
|
this.suppressNextDialogueAdvanceClick = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.advanceRuntimeDialogue();
|
this.advanceRuntimeDialogue();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user