From 08471a27b7292c1f574ce01875b89325d73731d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20CHOMAZ?= Date: Fri, 12 Apr 2024 21:32:08 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20deux=20param=C3=A8tres=20dans=20la?= =?UTF-8?q?=20page=20de=20settings=20ces=20boutons=20permettent=20de=20jou?= =?UTF-8?q?er=20certains=20sons=20lors=20de=20l'ajout=20ou=20la=20suppress?= =?UTF-8?q?ion=20de=20score?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/views/SettingsView.vue | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/ui/src/views/SettingsView.vue b/ui/src/views/SettingsView.vue index c7f848f..62a1d42 100644 --- a/ui/src/views/SettingsView.vue +++ b/ui/src/views/SettingsView.vue @@ -24,6 +24,14 @@ + Jeu + +
+ +
+ + + @@ -36,6 +44,8 @@ const MQTTSound = ref(false); // Définition d'une référence pour la case à cocher. Initialement décochée. const MQTTBrokerState = ref(false); // Définition d'une référence pour la case à cocher. Initialement décochée. const SattelitesDisplay = ref(false); + const SuccessPlay = ref(false); + const ErrorPlay = ref(false); const router = useRouter(); const goToDebugRoute = () => { @@ -54,18 +64,27 @@ } if (localStorage.getItem('SattelitesDisplay')) { SattelitesDisplay.value = localStorage.getItem('SattelitesDisplay') === 'true'; // Added a default value for this switch + } + if (localStorage.getItem('SuccessPlay')) { + SuccessPlay.value = localStorage.getItem('SuccessPlay') === 'true'; // Added a default value for this switch + } + if (localStorage.getItem('ErrorPlay')) { + ErrorPlay.value = localStorage.getItem('ErrorPlay') === 'true'; // Added a default value for this switch } }); + watch(EmbeddedSound, (EmbeddedSoundNewValue) => { if (EmbeddedSoundNewValue !== null) { localStorage.setItem('EmbeddedSound', EmbeddedSoundNewValue); // Mettre à jour l'état de la case à cocher dans le LocalStorage chaque fois qu'il change. } }); + watch(EmbeddedSoundVolume, (EmbeddedSoundVolumeNewValue) => { if (EmbeddedSoundVolumeNewValue !== null) { localStorage.setItem('EmbeddedSoundVolume', EmbeddedSoundVolumeNewValue); // Mettre à jour l'état de la case à cocher dans le LocalStorage chaque fois qu'il change. } }); + watch(MQTTSound, (MQTTSoundNewValue) => { if (MQTTSoundNewValue !== null) { @@ -75,9 +94,20 @@ watch(SattelitesDisplay, (SattelitesDisplaynewValue) => { if (SattelitesDisplaynewValue !== null) { localStorage.setItem('SattelitesDisplay', SattelitesDisplaynewValue); // Added a default value for this switch + } + }); + + watch(SuccessPlay, (SuccessPlaynewValue) => { + if (SuccessPlaynewValue !== null) { + localStorage.setItem('SuccessPlay', SuccessPlaynewValue); // Added a default value for this switch } -}); - + }); + + watch(ErrorPlay, (ErrorPlaynewValue) => { + if (ErrorPlaynewValue !== null) { + localStorage.setItem('ErrorPlay', ErrorPlaynewValue); // Added a default value for this switch + } + });