@vnejs/plugins.canvas.child.sprite.speak 0.2.5 → 0.2.6
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.
- package/dist/modules/speak.d.ts +1 -1
- package/dist/modules/speak.js +5 -5
- package/package.json +1 -1
- package/src/modules/speak.ts +6 -6
package/dist/modules/speak.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare class LayerSpriteSpeak extends ModuleCore<SpriteSpeakPluginEvents
|
|
|
5
5
|
name: string;
|
|
6
6
|
currentSpeaker: string | null;
|
|
7
7
|
subscribe: () => void;
|
|
8
|
-
onStart: () => Promise<import("@vnejs/shared").EmitResults<"vne:layer_sprite_speak:option_set"> | undefined>;
|
|
9
8
|
onEnd: () => Promise<false | import("@vnejs/shared").EmitResults<"vne:layer_sprite_speak:option_set"> | undefined>;
|
|
9
|
+
onStart: () => Promise<import("@vnejs/shared").EmitResults<"vne:layer_sprite_speak:option_set"> | undefined>;
|
|
10
10
|
onSpeaker: ({ speaker }?: SpriteSpeakSpeakerPayload) => Promise<void>;
|
|
11
11
|
}
|
package/dist/modules/speak.js
CHANGED
|
@@ -7,18 +7,18 @@ export class LayerSpriteSpeak extends ModuleCore {
|
|
|
7
7
|
this.on(this.EVENTS.LAYER_SPRITE_SPEAK.START, this.onStart);
|
|
8
8
|
this.on(this.EVENTS.LAYER_SPRITE_SPEAK.SPEAKER, this.onSpeaker);
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
onEnd = async () => {
|
|
11
11
|
if (!this.currentSpeaker)
|
|
12
12
|
return;
|
|
13
13
|
const sprite = (await this.emitOne(this.EVENTS.LAYER_SPRITE_SPEAK.SPRITE_GET, { speaker: this.currentSpeaker }));
|
|
14
|
-
|
|
14
|
+
this.currentSpeaker = null;
|
|
15
|
+
return sprite?.args?.options?.speak && this.emit(this.EVENTS.LAYER_SPRITE_SPEAK.OPTION_SET, { sprite, value: false });
|
|
15
16
|
};
|
|
16
|
-
|
|
17
|
+
onStart = async () => {
|
|
17
18
|
if (!this.currentSpeaker)
|
|
18
19
|
return;
|
|
19
20
|
const sprite = (await this.emitOne(this.EVENTS.LAYER_SPRITE_SPEAK.SPRITE_GET, { speaker: this.currentSpeaker }));
|
|
20
|
-
this.
|
|
21
|
-
return sprite?.args?.options?.speak && this.emit(this.EVENTS.LAYER_SPRITE_SPEAK.OPTION_SET, { sprite, value: false });
|
|
21
|
+
return sprite && this.emit(this.EVENTS.LAYER_SPRITE_SPEAK.OPTION_SET, { sprite, value: true });
|
|
22
22
|
};
|
|
23
23
|
onSpeaker = async ({ speaker = "" } = {}) => {
|
|
24
24
|
if (this.currentSpeaker && this.currentSpeaker !== speaker) {
|
package/package.json
CHANGED
package/src/modules/speak.ts
CHANGED
|
@@ -14,22 +14,22 @@ export class LayerSpriteSpeak extends ModuleCore<SpriteSpeakPluginEvents, Sprite
|
|
|
14
14
|
this.on(this.EVENTS.LAYER_SPRITE_SPEAK.SPEAKER, this.onSpeaker);
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
onEnd = async () => {
|
|
18
18
|
if (!this.currentSpeaker) return;
|
|
19
19
|
|
|
20
20
|
const sprite = (await this.emitOne(this.EVENTS.LAYER_SPRITE_SPEAK.SPRITE_GET, { speaker: this.currentSpeaker })) as SpriteSpeakRecord | undefined;
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
this.currentSpeaker = null;
|
|
23
|
+
|
|
24
|
+
return sprite?.args?.options?.speak && this.emit(this.EVENTS.LAYER_SPRITE_SPEAK.OPTION_SET, { sprite, value: false });
|
|
23
25
|
};
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
onStart = async () => {
|
|
26
28
|
if (!this.currentSpeaker) return;
|
|
27
29
|
|
|
28
30
|
const sprite = (await this.emitOne(this.EVENTS.LAYER_SPRITE_SPEAK.SPRITE_GET, { speaker: this.currentSpeaker })) as SpriteSpeakRecord | undefined;
|
|
29
31
|
|
|
30
|
-
this.
|
|
31
|
-
|
|
32
|
-
return sprite?.args?.options?.speak && this.emit(this.EVENTS.LAYER_SPRITE_SPEAK.OPTION_SET, { sprite, value: false });
|
|
32
|
+
return sprite && this.emit(this.EVENTS.LAYER_SPRITE_SPEAK.OPTION_SET, { sprite, value: true });
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
onSpeaker = async ({ speaker = "" }: SpriteSpeakSpeakerPayload = {}) => {
|