Changed the way WOKA's are stored

This commit is contained in:
Hanusiak Piotr 2021-11-30 19:10:35 +01:00
parent 2ea54fd243
commit 642d3bb301
6 changed files with 61 additions and 73 deletions

View file

@ -0,0 +1,31 @@
<script lang="typescript">
import { onDestroy } from 'svelte';
import { gameManager } from '../../Phaser/Game/GameManager';
import logoWA from "../images/logo-WA-pixel.png"; // placeholder
export let userId: number;
const gameScene = gameManager.getCurrentGameScene();
const playerWokaPictureStore = gameScene.getUserWokaPictureStore(userId);
let src = logoWA;
const unsubscribe = playerWokaPictureStore.picture.subscribe((htmlElement) => {
src = htmlElement?.src ?? logoWA;
});
onDestroy(unsubscribe);
</script>
<img src={src} alt="woka" class="nes-pointer">
<style>
img {
display: block;
pointer-events: auto;
width: 60px;
height: 60px;
margin: 3px;
image-rendering: pixelated;
}
</style>