change status when entering silent zone

This commit is contained in:
Piotr 'pwh' Hanusiak 2022-04-14 12:37:31 +02:00
parent 99854e2d62
commit 91f299ba82
3 changed files with 7 additions and 2 deletions

View File

@ -356,6 +356,7 @@ export abstract class Character extends Container implements OutlineableInterfac
super.destroy();
}
// TODO: Remove silent store and check for status?
isSilent() {
isSilentStore.set(true);
}

View File

@ -17,6 +17,7 @@ import { audioManagerFileStore, audioManagerVisibilityStore } from "../../Stores
import { iframeListener } from "../../Api/IframeListener";
import { Room } from "../../Connexion/Room";
import LL from "../../i18n/i18n-svelte";
import { AvailabilityStatus } from "../../Messages/ts-proto-generated/protos/messages";
interface OpenCoWebsite {
actionId: string;
@ -144,10 +145,12 @@ export class GameMapPropertiesListener {
this.gameMap.onPropertyChange(GameMapProperties.SILENT, (newValue) => {
if (newValue === undefined || newValue === false || newValue === "") {
// this.scene.connection?.setSilent(false);
this.scene.connection?.emitPlayerStatusChange(AvailabilityStatus.ONLINE);
this.scene.CurrentPlayer.setStatus(AvailabilityStatus.ONLINE);
this.scene.CurrentPlayer.noSilent();
} else {
// this.scene.connection?.setSilent(true);
this.scene.connection?.emitPlayerStatusChange(AvailabilityStatus.SILENT);
this.scene.CurrentPlayer.setStatus(AvailabilityStatus.SILENT);
this.scene.CurrentPlayer.isSilent();
}
});

View File

@ -2109,6 +2109,7 @@ ${escapedMessage}
character.showTalkIcon(message.details?.showVoiceIndicator);
}
if (message.details?.status !== undefined) {
console.log(message.details);
character.setStatus(message.details?.status);
}
}