diff --git a/gui/public/i18n/en/translation.ftl b/gui/public/i18n/en/translation.ftl index caa9e14d1..314e44dd1 100644 --- a/gui/public/i18n/en/translation.ftl +++ b/gui/public/i18n/en/translation.ftl @@ -333,6 +333,9 @@ settings-general-interface-dev_mode-label = Developer Mode settings-general-interface-serial_detection = Serial device detection settings-general-interface-serial_detection-description = This option will show a pop-up every time you plug a new serial device that could be a tracker. It helps improving the setup process of a tracker. settings-general-interface-serial_detection-label = Serial device detection +settings-general-interface-feedback_sound = Feedback Sound +settings-general-interface-feedback_sound-description = This option will play a sound when a reset is triggered +settings-general-interface-feedback_sound-label = Feedback Sound settings-general-interface-lang = Select language settings-general-interface-lang-description = Change the default language you want to use. settings-general-interface-lang-placeholder = Select the language to use diff --git a/gui/public/sounds/full-reset-started-sound.mp3 b/gui/public/sounds/full-reset-started-sound.mp3 new file mode 100644 index 000000000..cda148355 Binary files /dev/null and b/gui/public/sounds/full-reset-started-sound.mp3 differ diff --git a/gui/public/sounds/mounting-reset-started-sound.mp3 b/gui/public/sounds/mounting-reset-started-sound.mp3 new file mode 100644 index 000000000..d9f0634fb Binary files /dev/null and b/gui/public/sounds/mounting-reset-started-sound.mp3 differ diff --git a/gui/public/sounds/quick-reset-started-sound.mp3 b/gui/public/sounds/quick-reset-started-sound.mp3 new file mode 100644 index 000000000..af10120ff Binary files /dev/null and b/gui/public/sounds/quick-reset-started-sound.mp3 differ diff --git a/gui/src/components/home/ResetButton.tsx b/gui/src/components/home/ResetButton.tsx index 5d35b7eca..b7d23593d 100644 --- a/gui/src/components/home/ResetButton.tsx +++ b/gui/src/components/home/ResetButton.tsx @@ -1,8 +1,10 @@ import { useLocalization } from '@fluent/react'; import { useMemo } from 'react'; import { ResetRequestT, ResetType, RpcMessage } from 'solarxr-protocol'; +import { useConfig } from '../../hooks/config'; import { useCountdown } from '../../hooks/countdown'; import { useWebsocketAPI } from '../../hooks/websocket-api'; +import { playSoundForStarted } from '../../sounds/sounds'; import { BigButton } from '../commons/BigButton'; import { Button } from '../commons/Button'; import { @@ -22,6 +24,7 @@ export function ResetButton({ }) { const { l10n } = useLocalization(); const { sendRPCPacket } = useWebsocketAPI(); + const { config } = useConfig(); const reset = () => { const req = new ResetRequestT(); @@ -61,13 +64,23 @@ export function ResetButton({ const variantsMap = { small: type == ResetType.Yaw ? ( - ) : (