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(); super.destroy();
} }
// TODO: Remove silent store and check for status?
isSilent() { isSilent() {
isSilentStore.set(true); isSilentStore.set(true);
} }

View File

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

View File

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