* Add an emote when the user is in silent zone * Update silent icon strategy * Update strategy for silent zone - Add svelte store - Show silent zone indication and replace camera This update permit to hide silent zone when user is in Jitsi discussion * Fix css silent zone Signed-off-by: Gregoire Parant <g.parant@thecodingmachine.com>
20 lines
587 B
TypeScript
20 lines
587 B
TypeScript
import { emoteEventStream } from "../../Connexion/EmoteEventStream";
|
|
import type { GameScene } from "./GameScene";
|
|
import type { Subscription } from "rxjs";
|
|
|
|
export class EmoteManager {
|
|
private subscription: Subscription;
|
|
|
|
constructor(private scene: GameScene) {
|
|
this.subscription = emoteEventStream.stream.subscribe((event) => {
|
|
const actor = this.scene.MapPlayersByKey.get(event.userId);
|
|
if (actor) {
|
|
actor.playEmote(event.emote);
|
|
}
|
|
});
|
|
}
|
|
|
|
destroy() {
|
|
this.subscription.unsubscribe();
|
|
}
|
|
}
|