Fixing prettier
This commit is contained in:
parent
cf6d461247
commit
257162c451
@ -4,7 +4,7 @@ declare let window: any;
|
|||||||
|
|
||||||
class AnalyticsClient {
|
class AnalyticsClient {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
private posthogPromise: Promise<any>|undefined;
|
private posthogPromise: Promise<any> | undefined;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
if (POSTHOG_API_KEY && POSTHOG_URL) {
|
if (POSTHOG_API_KEY && POSTHOG_URL) {
|
||||||
@ -18,74 +18,64 @@ class AnalyticsClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
identifyUser(uuid: string, email: string | null) {
|
identifyUser(uuid: string, email: string | null) {
|
||||||
this.posthogPromise
|
this.posthogPromise?.then((posthog) => {
|
||||||
?.then((posthog) => {
|
posthog.identify(uuid, { uuid, email, wa: true });
|
||||||
posthog.identify(uuid, { uuid, email, wa: true });
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
loggedWithSso() {
|
loggedWithSso() {
|
||||||
this.posthogPromise
|
this.posthogPromise?.then((posthog) => {
|
||||||
?.then((posthog) => {
|
posthog.capture("wa-logged-sso");
|
||||||
posthog.capture("wa-logged-sso");
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
loggedWithToken() {
|
loggedWithToken() {
|
||||||
this.posthogPromise
|
this.posthogPromise?.then((posthog) => {
|
||||||
?.then((posthog) => {
|
posthog.capture("wa-logged-token");
|
||||||
posthog.capture("wa-logged-token");
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enteredRoom(roomId: string, roomGroup: string | null) {
|
enteredRoom(roomId: string, roomGroup: string | null) {
|
||||||
this.posthogPromise
|
this.posthogPromise?.then((posthog) => {
|
||||||
?.then((posthog) => {
|
posthog.capture("$pageView", { roomId, roomGroup });
|
||||||
posthog.capture("$pageView", { roomId, roomGroup });
|
posthog.capture("enteredRoom");
|
||||||
posthog.capture("enteredRoom");
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
openedMenu() {
|
openedMenu() {
|
||||||
this.posthogPromise
|
this.posthogPromise?.then((posthog) => {
|
||||||
?.then((posthog) => {
|
posthog.capture("wa-opened-menu");
|
||||||
posthog.capture("wa-opened-menu");
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
launchEmote(emote: string) {
|
launchEmote(emote: string) {
|
||||||
this.posthogPromise
|
this.posthogPromise?.then((posthog) => {
|
||||||
?.then((posthog) => {
|
posthog.capture("wa-emote-launch", { emote });
|
||||||
posthog.capture("wa-emote-launch", { emote });
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enteredJitsi(roomName: string, roomId: string) {
|
enteredJitsi(roomName: string, roomId: string) {
|
||||||
this.posthogPromise
|
this.posthogPromise?.then((posthog) => {
|
||||||
?.then((posthog) => {
|
posthog.capture("wa-entered-jitsi", { roomName, roomId });
|
||||||
posthog.capture("wa-entered-jitsi", { roomName, roomId });
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
validationName() {
|
validationName() {
|
||||||
this.posthogPromise
|
this.posthogPromise?.then((posthog) => {
|
||||||
?.then((posthog) => {
|
posthog.capture("wa-name-validation");
|
||||||
posthog.capture("wa-name-validation");
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
validationWoka(scene: string) {
|
validationWoka(scene: string) {
|
||||||
this.posthogPromise
|
this.posthogPromise?.then((posthog) => {
|
||||||
?.then((posthog) => {
|
posthog.capture("wa-woka-validation", { scene });
|
||||||
posthog.capture("wa-woka-validation", { scene });
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
validationVideo() {
|
validationVideo() {
|
||||||
this.posthogPromise
|
this.posthogPromise?.then((posthog) => {
|
||||||
?.then((posthog) => {
|
posthog.capture("wa-video-validation");
|
||||||
posthog.capture("wa-video-validation");
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export const analyticsClient = new AnalyticsClient();
|
export const analyticsClient = new AnalyticsClient();
|
||||||
|
@ -49,7 +49,7 @@ class IframeListener {
|
|||||||
public readonly openTabStream = this._openTabStream.asObservable();
|
public readonly openTabStream = this._openTabStream.asObservable();
|
||||||
|
|
||||||
private readonly _loadPageStream: Subject<string> = new Subject();
|
private readonly _loadPageStream: Subject<string> = new Subject();
|
||||||
public readonly loadPageStream = this._loadPageStream.asObservable()
|
public readonly loadPageStream = this._loadPageStream.asObservable();
|
||||||
|
|
||||||
private readonly _disablePlayerControlStream: Subject<void> = new Subject();
|
private readonly _disablePlayerControlStream: Subject<void> = new Subject();
|
||||||
public readonly disablePlayerControlStream = this._disablePlayerControlStream.asObservable();
|
public readonly disablePlayerControlStream = this._disablePlayerControlStream.asObservable();
|
||||||
|
@ -122,7 +122,7 @@ class LocalUserStore {
|
|||||||
|
|
||||||
setLastRoomUrl(roomUrl: string): void {
|
setLastRoomUrl(roomUrl: string): void {
|
||||||
localStorage.setItem(lastRoomUrl, roomUrl.toString());
|
localStorage.setItem(lastRoomUrl, roomUrl.toString());
|
||||||
if ('caches' in window) {
|
if ("caches" in window) {
|
||||||
caches.open(cacheAPIIndex).then((cache) => {
|
caches.open(cacheAPIIndex).then((cache) => {
|
||||||
const stringResponse = new Response(JSON.stringify({ roomUrl }));
|
const stringResponse = new Response(JSON.stringify({ roomUrl }));
|
||||||
cache.put(`/${lastRoomUrl}`, stringResponse);
|
cache.put(`/${lastRoomUrl}`, stringResponse);
|
||||||
@ -135,7 +135,7 @@ class LocalUserStore {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
getLastRoomUrlCacheApi(): Promise<string | undefined> {
|
getLastRoomUrlCacheApi(): Promise<string | undefined> {
|
||||||
if (!('caches' in window)) {
|
if (!("caches" in window)) {
|
||||||
return Promise.resolve(undefined);
|
return Promise.resolve(undefined);
|
||||||
}
|
}
|
||||||
return caches.open(cacheAPIIndex).then((cache) => {
|
return caches.open(cacheAPIIndex).then((cache) => {
|
||||||
|
@ -13,11 +13,10 @@ export class Loader {
|
|||||||
private progressContainer!: Phaser.GameObjects.Graphics;
|
private progressContainer!: Phaser.GameObjects.Graphics;
|
||||||
private progress!: Phaser.GameObjects.Graphics;
|
private progress!: Phaser.GameObjects.Graphics;
|
||||||
private progressAmount: number = 0;
|
private progressAmount: number = 0;
|
||||||
private logo: Phaser.GameObjects.Image|undefined;
|
private logo: Phaser.GameObjects.Image | undefined;
|
||||||
private loadingText: Phaser.GameObjects.Text | null = null;
|
private loadingText: Phaser.GameObjects.Text | null = null;
|
||||||
|
|
||||||
public constructor(private scene: Phaser.Scene) {
|
public constructor(private scene: Phaser.Scene) {}
|
||||||
}
|
|
||||||
|
|
||||||
public addLoader(): void {
|
public addLoader(): void {
|
||||||
// If there is nothing to load, do not display the loader.
|
// If there is nothing to load, do not display the loader.
|
||||||
@ -30,11 +29,19 @@ export class Loader {
|
|||||||
const promiseLoadLogoTexture = new Promise<Phaser.GameObjects.Image>((res) => {
|
const promiseLoadLogoTexture = new Promise<Phaser.GameObjects.Image>((res) => {
|
||||||
if (this.scene.load.textureManager.exists(LogoNameIndex)) {
|
if (this.scene.load.textureManager.exists(LogoNameIndex)) {
|
||||||
return res(
|
return res(
|
||||||
this.logo = this.scene.add.image(this.scene.game.renderer.width / 2, this.scene.game.renderer.height / 2 - 150, LogoNameIndex)
|
(this.logo = this.scene.add.image(
|
||||||
|
this.scene.game.renderer.width / 2,
|
||||||
|
this.scene.game.renderer.height / 2 - 150,
|
||||||
|
LogoNameIndex
|
||||||
|
))
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
//add loading if logo image is not ready
|
//add loading if logo image is not ready
|
||||||
this.loadingText = this.scene.add.text(this.scene.game.renderer.width / 2, this.scene.game.renderer.height / 2 - 50, TextName);
|
this.loadingText = this.scene.add.text(
|
||||||
|
this.scene.game.renderer.width / 2,
|
||||||
|
this.scene.game.renderer.height / 2 - 50,
|
||||||
|
TextName
|
||||||
|
);
|
||||||
}
|
}
|
||||||
this.scene.load.spritesheet(LogoNameIndex, LogoResource, LogoFrame);
|
this.scene.load.spritesheet(LogoNameIndex, LogoResource, LogoFrame);
|
||||||
this.scene.load.once(`filecomplete-spritesheet-${LogoNameIndex}`, () => {
|
this.scene.load.once(`filecomplete-spritesheet-${LogoNameIndex}`, () => {
|
||||||
@ -42,7 +49,11 @@ export class Loader {
|
|||||||
this.loadingText.destroy();
|
this.loadingText.destroy();
|
||||||
}
|
}
|
||||||
return res(
|
return res(
|
||||||
this.logo = this.scene.add.image(this.scene.game.renderer.width / 2, this.scene.game.renderer.height / 2 - 150, LogoNameIndex)
|
(this.logo = this.scene.add.image(
|
||||||
|
this.scene.game.renderer.width / 2,
|
||||||
|
this.scene.game.renderer.height / 2 - 150,
|
||||||
|
LogoNameIndex
|
||||||
|
))
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -72,7 +83,6 @@ export class Loader {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public removeLoader(): void {
|
public removeLoader(): void {
|
||||||
if (this.scene.load.textureManager.exists(LogoNameIndex)) {
|
if (this.scene.load.textureManager.exists(LogoNameIndex)) {
|
||||||
this.scene.load.textureManager.remove(LogoNameIndex);
|
this.scene.load.textureManager.remove(LogoNameIndex);
|
||||||
|
@ -4,7 +4,7 @@ import { EnableCameraSceneName } from "./EnableCameraScene";
|
|||||||
import { CustomizeSceneName } from "./CustomizeScene";
|
import { CustomizeSceneName } from "./CustomizeScene";
|
||||||
import { localUserStore } from "../../Connexion/LocalUserStore";
|
import { localUserStore } from "../../Connexion/LocalUserStore";
|
||||||
import { loadAllDefaultModels } from "../Entity/PlayerTexturesLoadingManager";
|
import { loadAllDefaultModels } from "../Entity/PlayerTexturesLoadingManager";
|
||||||
import { Loader} from "../Components/Loader";
|
import { Loader } from "../Components/Loader";
|
||||||
import type { BodyResourceDescriptionInterface } from "../Entity/PlayerTextures";
|
import type { BodyResourceDescriptionInterface } from "../Entity/PlayerTextures";
|
||||||
import { AbstractCharacterScene } from "./AbstractCharacterScene";
|
import { AbstractCharacterScene } from "./AbstractCharacterScene";
|
||||||
import { areCharacterLayersValid } from "../../Connexion/LocalUser";
|
import { areCharacterLayersValid } from "../../Connexion/LocalUser";
|
||||||
|
Loading…
Reference in New Issue
Block a user