fix menu slider sounds
This commit is contained in:
parent
47ac5c663f
commit
3c2f6fe4e8
|
@ -113,10 +113,9 @@ void sliderMenuItemInit(struct MenuBuilderElement* element) {
|
|||
|
||||
enum MenuDirection sliderMenuItemUpdate(struct MenuBuilderElement* element, MenuActionCalback actionCallback, void* data) {
|
||||
struct MenuSlider* slider = (struct MenuSlider*)element->data;
|
||||
|
||||
if (element->params->params.slider.discrete) {
|
||||
int controllerDir = controllerGetDirectionDown(0);
|
||||
|
||||
if (element->params->params.slider.discrete) {
|
||||
int numTicks = element->params->params.slider.numberOfTicks;
|
||||
int currentValue = (int)floorf(slider->value * (numTicks - 1));
|
||||
int newValue = currentValue;
|
||||
|
@ -197,6 +196,9 @@ enum MenuDirection sliderMenuItemUpdate(struct MenuBuilderElement* element, Menu
|
|||
}
|
||||
}
|
||||
|
||||
if (controllerGetButtonDown(0, L_JPAD | R_JPAD | A_BUTTON) || (element->params->params.slider.discrete && ((controllerDir & ControllerDirectionLeft) || (controllerDir & ControllerDirectionRight))))
|
||||
soundPlayerPlay(SOUNDS_BUTTONCLICKRELEASE, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
||||
|
||||
return MenuDirectionStay;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue