Implement music and sound volume sliders

This adds music and volume sliders to the audio options. To use the
sliders, you navigate to the given option, then press ACTION, and your
selection will be transferred to the slider. Pressing left or right will
move the slider accordingly. Then you can press ACTION to confirm the
volume is what you want and deselect it, or you can press Esc to cancel
the volume change, and it will revert to the previous volume; both
actions will write your settings to disk.

Most of this commit is just adding infrastructure to support having
sliders in menus (without copy-pasting code), which is a totally
completely new user interface that has never been used before in this
game. If we're going to be adding something new, I want to make sure
that it at least is done the RIGHT way.

Closes #706.
This commit is contained in:
Misa
2021-04-11 17:43:17 -07:00
committed by Ethan Lee
parent 27874e1dc6
commit e8316c7e9a
6 changed files with 166 additions and 11 deletions

View File

@@ -1475,7 +1475,7 @@ void Graphics::drawmenu( int cr, int cg, int cb, bool levelmenu /*= false*/ )
SDL_strlcpy(tempstring, opt.text, sizeof(tempstring));
char buffer[MENU_TEXT_BYTES];
if ((int) i == game.currentmenuoption)
if ((int) i == game.currentmenuoption && game.slidermode == SLIDER_NONE)
{
if (opt.active)
{