use Prettier to fix style issues

This commit is contained in:
Hanusiak Piotr 2021-11-29 20:39:09 +01:00
parent 913a07350d
commit 2ea54fd243
2 changed files with 14 additions and 15 deletions

View File

@ -64,7 +64,7 @@ export abstract class Character extends Container {
this.addTextures(textures, frame); this.addTextures(textures, frame);
this.invisible = false; this.invisible = false;
this.playAnimation(direction, moving); this.playAnimation(direction, moving);
this.emit('textures-loaded'); this.emit("textures-loaded");
}) })
.catch(() => { .catch(() => {
return lazyLoadPlayerCharacterTextures(scene.load, ["color_22", "eyes_23"]).then((textures) => { return lazyLoadPlayerCharacterTextures(scene.load, ["color_22", "eyes_23"]).then((textures) => {
@ -125,16 +125,18 @@ export abstract class Character extends Container {
} }
return new Promise<HTMLImageElement>((resolve, reject) => { return new Promise<HTMLImageElement>((resolve, reject) => {
try { try {
rt.snapshot((url) => { rt.snapshot(
(url) => {
resolve(url as HTMLImageElement); resolve(url as HTMLImageElement);
rt.destroy(); rt.destroy();
}, },
'image/png', "image/png",
1); 1
);
} catch (error) { } catch (error) {
reject(error); reject(error);
} }
}) });
} }
public addCompanion(name: string, texturePromise?: Promise<string>): void { public addCompanion(name: string, texturePromise?: Promise<string>): void {

View File

@ -66,7 +66,7 @@ import type { ItemFactoryInterface } from "../Items/ItemFactoryInterface";
import type { ITiledMap, ITiledMapLayer, ITiledMapProperty, ITiledMapObject, ITiledTileSet } from "../Map/ITiledMap"; import type { ITiledMap, ITiledMapLayer, ITiledMapProperty, ITiledMapObject, ITiledTileSet } from "../Map/ITiledMap";
import type { AddPlayerInterface } from "./AddPlayerInterface"; import type { AddPlayerInterface } from "./AddPlayerInterface";
import type { HasPlayerMovedEvent } from "../../Api/Events/HasPlayerMovedEvent"; import type { HasPlayerMovedEvent } from "../../Api/Events/HasPlayerMovedEvent";
import type { Character } from '../Entity/Character'; import type { Character } from "../Entity/Character";
import { peerStore } from "../../Stores/PeerStore"; import { peerStore } from "../../Stores/PeerStore";
import { biggestAvailableAreaStore } from "../../Stores/BiggestAvailableAreaStore"; import { biggestAvailableAreaStore } from "../../Stores/BiggestAvailableAreaStore";
@ -76,10 +76,7 @@ import { userWokaPictureStore } from "../../Stores/UserWokaPictureStore";
import { emoteStore, emoteMenuStore } from "../../Stores/EmoteStore"; import { emoteStore, emoteMenuStore } from "../../Stores/EmoteStore";
import { userIsAdminStore } from "../../Stores/GameStore"; import { userIsAdminStore } from "../../Stores/GameStore";
import { contactPageStore } from "../../Stores/MenuStore"; import { contactPageStore } from "../../Stores/MenuStore";
import { import { audioManagerFileStore, audioManagerVisibilityStore } from "../../Stores/AudioManagerStore";
audioManagerFileStore,
audioManagerVisibilityStore,
} from "../../Stores/AudioManagerStore";
import EVENT_TYPE = Phaser.Scenes.Events; import EVENT_TYPE = Phaser.Scenes.Events;
import Texture = Phaser.Textures.Texture; import Texture = Phaser.Textures.Texture;
@ -1499,7 +1496,7 @@ ${escapedMessage}
this.companion, this.companion,
this.companion !== null ? lazyLoadCompanionResource(this.load, this.companion) : undefined this.companion !== null ? lazyLoadCompanionResource(this.load, this.companion) : undefined
); );
this.CurrentPlayer.once('textures-loaded', () => { this.CurrentPlayer.once("textures-loaded", () => {
// TODO: How to be sure we always get hero id? // TODO: How to be sure we always get hero id?
this.savePlayerWokaPicture(this.CurrentPlayer, -1); this.savePlayerWokaPicture(this.CurrentPlayer, -1);
}); });
@ -1722,7 +1719,7 @@ ${escapedMessage}
addPlayerData.companion, addPlayerData.companion,
addPlayerData.companion !== null ? lazyLoadCompanionResource(this.load, addPlayerData.companion) : undefined addPlayerData.companion !== null ? lazyLoadCompanionResource(this.load, addPlayerData.companion) : undefined
); );
player.once('textures-loaded', () => { player.once("textures-loaded", () => {
this.savePlayerWokaPicture(player, addPlayerData.userId); this.savePlayerWokaPicture(player, addPlayerData.userId);
}); });
this.MapPlayers.add(player); this.MapPlayers.add(player);