diff --git a/front/dist/resources/characters/pipoya/Bird 01-1.png b/front/dist/resources/characters/pipoya/Bird 01-1.png new file mode 100644 index 00000000..c72c6e68 Binary files /dev/null and b/front/dist/resources/characters/pipoya/Bird 01-1.png differ diff --git a/front/dist/resources/characters/pipoya/Butterfly 01-1.png b/front/dist/resources/characters/pipoya/Butterfly 01-1.png new file mode 100644 index 00000000..6fdbc79a Binary files /dev/null and b/front/dist/resources/characters/pipoya/Butterfly 01-1.png differ diff --git a/front/dist/resources/characters/pipoya/Chicken 01-1.png b/front/dist/resources/characters/pipoya/Chicken 01-1.png new file mode 100644 index 00000000..ed79dbce Binary files /dev/null and b/front/dist/resources/characters/pipoya/Chicken 01-1.png differ diff --git a/front/dist/resources/characters/pipoya/Pika 01-1.png b/front/dist/resources/characters/pipoya/Pika 01-1.png new file mode 100644 index 00000000..223da878 Binary files /dev/null and b/front/dist/resources/characters/pipoya/Pika 01-1.png differ diff --git a/front/src/Components/AudioManager/AudioManager.svelte b/front/src/Components/AudioManager/AudioManager.svelte index e201254c..09798bc8 100644 --- a/front/src/Components/AudioManager/AudioManager.svelte +++ b/front/src/Components/AudioManager/AudioManager.svelte @@ -15,15 +15,12 @@ let unsubscriberFileStore: Unsubscriber | null = null; let unsubscriberVolumeStore: Unsubscriber | null = null; - let volume: number = 1; let decreaseWhileTalking: boolean = true; onMount(() => { - volume = localUserStore.getAudioPlayerVolume(); + let volume = Math.min(localUserStore.getAudioPlayerVolume(), get(audioManagerVolumeStore).volume); + audioManagerVolumeStore.setVolume(volume); audioManagerVolumeStore.setMuted(localUserStore.getAudioPlayerMuted()); - changeVolume(); - - loadAudioSettings(); unsubscriberFileStore = audioManagerFileStore.subscribe(() => { HTMLAudioPlayer.pause(); @@ -43,6 +40,7 @@ HTMLAudioPlayer.volume = audioManager.volume; HTMLAudioPlayer.muted = audioManager.muted; HTMLAudioPlayer.loop = audioManager.loop; + updateVolumeUI(); }) }) @@ -55,11 +53,12 @@ } }) - function changeVolume() { + function updateVolumeUI() { if (get(audioManagerVolumeStore).muted) { audioPlayerVolumeIcon.classList.add('muted'); audioPlayerVol.value = "0"; } else { + let volume = HTMLAudioPlayer.volume; audioPlayerVol.value = "" + volume; audioPlayerVolumeIcon.classList.remove('muted'); if (volume < 0.3) { @@ -78,21 +77,14 @@ const muted = !get(audioManagerVolumeStore).muted; audioManagerVolumeStore.setMuted(muted); localUserStore.setAudioPlayerMuted(muted); - changeVolume(); - } - - function loadAudioSettings() { - audioManagerVolumeStore.setVolume(localUserStore.getAudioPlayerVolume()); - audioManagerVolumeStore.setMuted(localUserStore.getAudioPlayerMuted()); } function setVolume() { - volume = parseFloat(audioPlayerVol.value); + let volume = parseFloat(audioPlayerVol.value); audioManagerVolumeStore.setVolume(volume); localUserStore.setAudioPlayerVolume(volume); audioManagerVolumeStore.setMuted(false); localUserStore.setAudioPlayerMuted(false); - changeVolume(); } function disallowKeys() { @@ -208,4 +200,4 @@ display: none; } } - \ No newline at end of file + diff --git a/front/src/Phaser/Companion/CompanionTextures.ts b/front/src/Phaser/Companion/CompanionTextures.ts index 279b027d..19077d4e 100644 --- a/front/src/Phaser/Companion/CompanionTextures.ts +++ b/front/src/Phaser/Companion/CompanionTextures.ts @@ -1,7 +1,7 @@ export interface CompanionResourceDescriptionInterface { name: string; img: string; - behaviour: "dog" | "cat"; + behaviour: "dog" | "cat" | "butterfly" | "chicken" | "bird"; } export const COMPANION_RESOURCES: CompanionResourceDescriptionInterface[] = [ @@ -11,4 +11,8 @@ export const COMPANION_RESOURCES: CompanionResourceDescriptionInterface[] = [ { name: "cat1", img: "resources/characters/pipoya/Cat 01-1.png", behaviour: "cat" }, { name: "cat2", img: "resources/characters/pipoya/Cat 01-2.png", behaviour: "cat" }, { name: "cat3", img: "resources/characters/pipoya/Cat 01-3.png", behaviour: "cat" }, + { name: "butterfly1", img: "resources/characters/pipoya/Butterfly 01-1.png", behaviour: "butterfly" }, + { name: "chicken1", img: "resources/characters/pipoya/Chicken 01-1.png", behaviour: "chicken" }, + { name: "bird1", img: "resources/characters/pipoya/Bird 01-1.png", behaviour: "bird" }, + { name: "pokemon1", img: "resources/characters/pipoya/Pika 01-1.png", behaviour: "cat" }, ];