Mis le son qui joue après que le volume soit changé pour les contrôles de volume

This commit is contained in:
MarcEricMartel 2023-12-15 06:39:18 -05:00
parent 935a977bdf
commit e4316e7d8d

View File

@ -2317,22 +2317,22 @@ void Engine::MousePressEvent(const MOUSE_BUTTON& button, int x, int y) {
float normalizedPosition = (x - leftBar) / barLength;
if (m_selectedOption == 0 && x > leftBar && x < rightBar && y > bottomBarPrincipal && y < topBarPrincipal) {
m_audio.playSound(AUDIO_PATH "snap.wav", m_sfxvolume);
m_selectedOptAudioMainBar = true;
m_mainvolume = normalizedPosition;
m_audio.SetMainVolume(m_mainvolume);
m_audio.playSound(AUDIO_PATH "snap.wav", m_sfxvolume);
}
else if (m_selectedOption == 0 && x > leftBar && x < rightBar && y > bottomBarMusique && y < topBarMusique) {
m_audio.playSound(AUDIO_PATH "snap.wav", m_sfxvolume);
m_selectedOptAudioMusicBar = true;
m_musicvolume = normalizedPosition;
m_audio.SetMusicVolume(m_musicvolume);
m_audio.playSound(AUDIO_PATH "snap.wav", m_sfxvolume);
}
else if (m_selectedOption == 0 && x > leftBar && x < rightBar && y > bottomBarEffets && y < topBarEffets) {
m_audio.playSound(AUDIO_PATH "snap.wav", m_sfxvolume);
m_selectedOptAudioSfxBar = true;
m_sfxvolume = normalizedPosition;
m_audio.SetSfxVolume(m_sfxvolume);
m_audio.playSound(AUDIO_PATH "snap.wav", m_sfxvolume);
}
// Resolution