Add WA.player.language in the API

This commit is contained in:
Nolway 2021-12-09 01:31:18 +01:00 committed by Alexis Faizeau
parent 77f8426788
commit 8286cdd41d
5 changed files with 31 additions and 2 deletions

View file

@ -76,6 +76,7 @@ import { userIsAdminStore } from "../../Stores/GameStore";
import { contactPageStore } from "../../Stores/MenuStore";
import type { WasCameraUpdatedEvent } from "../../Api/Events/WasCameraUpdatedEvent";
import { audioManagerFileStore, audioManagerVisibilityStore } from "../../Stores/AudioManagerStore";
import { Translator } from "../../Translator/Translator";
import EVENT_TYPE = Phaser.Scenes.Events;
import Texture = Phaser.Textures.Texture;
@ -211,6 +212,7 @@ export class GameScene extends DirtyScene {
private loader: Loader;
private lastCameraEvent: WasCameraUpdatedEvent | undefined;
private firstCameraUpdateSent: boolean = false;
private translator: Translator;
constructor(private room: Room, MapUrlFile: string, customKey?: string | undefined) {
super({
@ -230,6 +232,7 @@ export class GameScene extends DirtyScene {
this.connectionAnswerPromiseResolve = resolve;
});
this.loader = new Loader(this);
this.translator = Translator.getInstance();
}
//hook preload scene
@ -1321,6 +1324,7 @@ ${escapedMessage}
startLayerName: this.startPositionCalculator.startLayerName,
uuid: localUserStore.getLocalUser()?.uuid,
nickname: this.playerName,
language: Translator.getStringByLanguage(this.translator.getCurrentLanguage()),
roomId: this.roomUrl,
tags: this.connection ? this.connection.getAllTags() : [],
variables: this.sharedVariablesManager.variables,