@vnejs/plugins.views.scenario.interface 0.1.29 → 0.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,7 +6,7 @@ import type { InterfaceForcePayload, InterfaceModuleState, InterfaceSpeakerChang
|
|
|
6
6
|
export declare class Interface extends ModuleCore<InterfacePluginEvents, InterfacePluginConstants, InterfacePluginSettings, InterfacePluginParams, InterfaceModuleState> {
|
|
7
7
|
name: string;
|
|
8
8
|
subscribe: () => void;
|
|
9
|
-
init: () => Promise<unknown[]
|
|
9
|
+
init: () => Promise<[unknown[] | undefined, unknown[] | undefined]>;
|
|
10
10
|
onLineExec: ({ line }?: LineExecHandlerArg) => Promise<void>;
|
|
11
11
|
onInteract: () => Promise<unknown[]> | undefined;
|
|
12
12
|
onShow: ({ isForce }?: InterfaceForcePayload) => false | Promise<unknown[] | undefined>;
|
|
@@ -12,13 +12,15 @@ export class Interface extends ModuleCore {
|
|
|
12
12
|
this.on(this.EVENTS.INTERFACE.VISIBLE_TOKENS_CHANGED, this.onVisibleTokensChanged);
|
|
13
13
|
this.on(this.EVENTS.TEXT.CHANGED, this.onTextChanged);
|
|
14
14
|
this.on(this.EVENTS.TEXT.SPEAKER_CHANGED, this.onTextSpeakerChanged);
|
|
15
|
-
this.on(this.EVENTS.TEXT.EMIT_BEFORE, this.onTextEmitBefore);
|
|
16
15
|
this.on(this.EVENTS.STATE.SET, this.onStateSet);
|
|
17
16
|
this.on(this.EVENTS.STATE.CLEAR, this.onStateClear);
|
|
18
17
|
};
|
|
19
18
|
init = () => {
|
|
20
19
|
this.shared.interfaceTextShowAllTokensOnChange = true;
|
|
21
|
-
return
|
|
20
|
+
return Promise.all([
|
|
21
|
+
this.emit(this.EVENTS.SCENARIO.LINE_EXEC_REG, { module: this.name, handler: this.onLineExec }),
|
|
22
|
+
this.emit(this.EVENTS.TEXT.EMIT_BEFORE_REG, { handler: this.onTextEmitBefore }),
|
|
23
|
+
]);
|
|
22
24
|
};
|
|
23
25
|
onLineExec = async ({ line = "" } = {}) => {
|
|
24
26
|
const isForce = this.shared.viewForceAnimationSources.isNotEmpty();
|
package/package.json
CHANGED
package/src/modules/interface.ts
CHANGED
|
@@ -34,7 +34,6 @@ export class Interface extends ModuleCore<
|
|
|
34
34
|
|
|
35
35
|
this.on(this.EVENTS.TEXT.CHANGED, this.onTextChanged);
|
|
36
36
|
this.on(this.EVENTS.TEXT.SPEAKER_CHANGED, this.onTextSpeakerChanged);
|
|
37
|
-
this.on(this.EVENTS.TEXT.EMIT_BEFORE, this.onTextEmitBefore);
|
|
38
37
|
|
|
39
38
|
this.on(this.EVENTS.STATE.SET, this.onStateSet);
|
|
40
39
|
this.on(this.EVENTS.STATE.CLEAR, this.onStateClear);
|
|
@@ -43,7 +42,10 @@ export class Interface extends ModuleCore<
|
|
|
43
42
|
init = () => {
|
|
44
43
|
this.shared.interfaceTextShowAllTokensOnChange = true;
|
|
45
44
|
|
|
46
|
-
return
|
|
45
|
+
return Promise.all([
|
|
46
|
+
this.emit(this.EVENTS.SCENARIO.LINE_EXEC_REG, { module: this.name, handler: this.onLineExec }),
|
|
47
|
+
this.emit(this.EVENTS.TEXT.EMIT_BEFORE_REG, { handler: this.onTextEmitBefore }),
|
|
48
|
+
]);
|
|
47
49
|
};
|
|
48
50
|
|
|
49
51
|
onLineExec = async ({ line = "" }: LineExecHandlerArg = {}) => {
|