Add sound effect to sliders in options menu

This commit is contained in:
hackgrid 2023-10-18 23:17:02 +02:00
parent 99a1303d87
commit cd6c598302
3 changed files with 6 additions and 0 deletions

View file

@ -58,11 +58,13 @@ void audioOptionsHandleSlider(short selectedItem, unsigned short* settingValue,
newValue = newValue + chunk_size; newValue = newValue + chunk_size;
newValue = newValue - (newValue % chunk_size); newValue = newValue - (newValue % chunk_size);
} }
soundPlayerPlay(SOUNDS_BUTTONCLICKRELEASE, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
} }
if (controllerGetButtonDown(0, L_JPAD)) { if (controllerGetButtonDown(0, L_JPAD)) {
newValue = newValue - 1; newValue = newValue - 1;
newValue = newValue - (newValue % chunk_size); newValue = newValue - (newValue % chunk_size);
soundPlayerPlay(SOUNDS_BUTTONCLICKRELEASE, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
} }
if (newValue < 0) { if (newValue < 0) {

View file

@ -33,11 +33,13 @@ void gameplayOptionsHandleSlider(unsigned short* settingValue, float* sliderValu
newValue = newValue + SCROLL_CHUNK_SIZE; newValue = newValue + SCROLL_CHUNK_SIZE;
newValue = newValue - (newValue % SCROLL_CHUNK_SIZE); newValue = newValue - (newValue % SCROLL_CHUNK_SIZE);
} }
soundPlayerPlay(SOUNDS_BUTTONCLICKRELEASE, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
} }
if (controllerGetButtonDown(0, L_JPAD)) { if (controllerGetButtonDown(0, L_JPAD)) {
newValue = newValue - 1; newValue = newValue - 1;
newValue = newValue - (newValue % SCROLL_CHUNK_SIZE); newValue = newValue - (newValue % SCROLL_CHUNK_SIZE);
soundPlayerPlay(SOUNDS_BUTTONCLICKRELEASE, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
} }
if (newValue < 0) { if (newValue < 0) {

View file

@ -60,11 +60,13 @@ void joystickOptionsHandleSlider(unsigned short* settingValue, float* sliderValu
newValue = newValue + SCROLL_CHUNK_SIZE; newValue = newValue + SCROLL_CHUNK_SIZE;
newValue = newValue - (newValue % SCROLL_CHUNK_SIZE); newValue = newValue - (newValue % SCROLL_CHUNK_SIZE);
} }
soundPlayerPlay(SOUNDS_BUTTONCLICKRELEASE, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
} }
if (controllerGetButtonDown(0, L_JPAD)) { if (controllerGetButtonDown(0, L_JPAD)) {
newValue = newValue - 1; newValue = newValue - 1;
newValue = newValue - (newValue % SCROLL_CHUNK_SIZE); newValue = newValue - (newValue % SCROLL_CHUNK_SIZE);
soundPlayerPlay(SOUNDS_BUTTONCLICKRELEASE, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
} }
if (newValue < 0) { if (newValue < 0) {