Merge pull request #3359 from Gymnasiast/runemute

Add shortcut to mute sound
This commit is contained in:
Ted John 2016-04-20 22:02:04 +01:00
commit 4e53fc4c40
7 changed files with 14 additions and 1 deletions

View File

@ -4109,6 +4109,8 @@ STR_5800 :{SMALLFONT}{BLACK}Prevents rides from breaking down
STR_5801 :Disable littering
STR_5802 :{SMALLFONT}{BLACK}Stops guests from littering and vomiting
STR_5803 :{SMALLFONT}{BLACK}Rotate selected map element
STR_5804 :Mute sound
#############
# Scenarios #

View File

@ -1035,6 +1035,7 @@ static const uint16 _defaultShortcutKeys[SHORTCUT_COUNT] = {
PLATFORM_MODIFIER | SDL_SCANCODE_F10, // SHORTCUT_QUICK_SAVE_GAME
SHORTCUT_UNDEFINED, // SHORTCUT_SHOW_OPTIONS
SHORTCUT_UNDEFINED, // SHORTCUT_MUTE_SOUND
};
#define SHORTCUT_FILE_VERSION 1

View File

@ -79,6 +79,7 @@ enum {
SHORTCUT_OPEN_CHAT_WINDOW,
SHORTCUT_QUICK_SAVE_GAME,
SHORTCUT_SHOW_OPTIONS,
SHORTCUT_MUTE_SOUND,
SHORTCUT_COUNT
};

View File

@ -29,6 +29,7 @@
#include "viewport.h"
#include "window.h"
#include "widget.h"
#include "../audio/audio.h"
typedef void (*shortcut_action)();
@ -529,6 +530,11 @@ static void shortcut_show_options()
window_options_open();
}
static void shortcut_mute_sound()
{
audio_toggle_all_sounds();
}
static const shortcut_action shortcut_table[SHORTCUT_COUNT] = {
shortcut_close_top_most_window,
shortcut_close_all_floating_windows,
@ -576,6 +582,7 @@ static const shortcut_action shortcut_table[SHORTCUT_COUNT] = {
shortcut_open_chat_window,
shortcut_quick_save_game,
shortcut_show_options,
shortcut_mute_sound
};
#pragma endregion

View File

@ -2440,6 +2440,8 @@ enum {
STR_CHEAT_DISABLE_LITTERING = 5801,
STR_CHEAT_DISABLE_LITTERING_TIP = 5802,
STR_SHORTCUT_MUTE_SOUND = 5804,
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
STR_COUNT = 32768
};

View File

@ -636,7 +636,6 @@ static void window_options_mouseup(rct_window *w, int widgetIndex)
case WINDOW_OPTIONS_PAGE_AUDIO:
switch (widgetIndex) {
case WIDX_SOUND_CHECKBOX:
// audio_toggle_all_sounds();
gConfigSound.sound_enabled = !gConfigSound.sound_enabled;
config_save_default();
window_invalidate(w);

View File

@ -133,6 +133,7 @@ const rct_string_id ShortcutStringIds[] = {
STR_SEND_MESSAGE,
STR_SHORTCUT_QUICK_SAVE_GAME,
STR_SHORTCUT_SHOW_OPTIONS,
STR_SHORTCUT_MUTE_SOUND
};
/**