diff --git a/source/director.cpp b/source/director.cpp index a3d691a..ad01640 100644 --- a/source/director.cpp +++ b/source/director.cpp @@ -123,6 +123,7 @@ void Director::initInput() input->bindKey(input_window_inc_size, SDL_SCANCODE_F2); input->bindKey(input_window_fullscreen, SDL_SCANCODE_F3); input->bindKey(input_video_shaders, SDL_SCANCODE_F4); + input->bindKey(input_mute, SDL_SCANCODE_F5); input->bindKey(input_reset, SDL_SCANCODE_F10); const int numGamePads = input->getNumControllers(); diff --git a/source/game.cpp b/source/game.cpp index 6cb377f..c01f9d1 100644 --- a/source/game.cpp +++ b/source/game.cpp @@ -2137,6 +2137,18 @@ void Game::checkInput() return; } + else if (input->checkInput(input_mute, DO_NOT_ALLOW_REPEAT)) + { + const bool value = !options->audio.music.enabled; + options->audio.music.enabled = value; + options->audio.sound.enabled = value; + JA_EnableMusic(value); + JA_EnableSound(value); + const std::string text = value ? "on" : "off"; + screen->showNotification("Audio " + text); + return; + } + else if (input->checkInput(input_pause, DO_NOT_ALLOW_REPEAT)) { pause(!paused);