From 0068699fec7ed10e2caf1a66b85aebfcc06c05ea Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sat, 28 Dec 2024 18:18:13 +0000 Subject: [PATCH] Default menu sound fx to off Rename functions to better describe them. --- src/menu/menu.c | 2 +- src/menu/settings.c | 6 +++--- src/menu/settings.h | 2 +- src/menu/views/settings_editor.c | 16 ++++++++-------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/menu/menu.c b/src/menu/menu.c index 91a51a09..a30ff6f0 100644 --- a/src/menu/menu.c +++ b/src/menu/menu.c @@ -91,7 +91,7 @@ static void menu_init (boot_params_t *boot_params) { path_free(path); - sound_use_sfx(menu->settings.sound_enabled); + sound_use_sfx(menu->settings.soundfx_enabled); menu->browser.directory = path_init(menu->storage_prefix, menu->settings.default_directory); if (!directory_exists(path_get(menu->browser.directory))) { diff --git a/src/menu/settings.c b/src/menu/settings.c index 5361f0a6..703871aa 100644 --- a/src/menu/settings.c +++ b/src/menu/settings.c @@ -13,7 +13,7 @@ static settings_t init = { .show_protected_entries = false, .default_directory = "/", .use_saves_folder = true, - .sound_enabled = true, + .soundfx_enabled = false, .rom_autoload_enabled = false, .rom_autoload_path = "", .rom_autoload_filename = "", @@ -42,7 +42,7 @@ void settings_load (settings_t *settings) { settings->show_protected_entries = mini_get_bool(ini, "menu", "show_protected_entries", init.show_protected_entries); settings->default_directory = strdup(mini_get_string(ini, "menu", "default_directory", init.default_directory)); settings->use_saves_folder = mini_get_bool(ini, "menu", "use_saves_folder", init.use_saves_folder); - settings->sound_enabled = mini_get_bool(ini, "menu", "sound_enabled", init.sound_enabled); + settings->soundfx_enabled = mini_get_bool(ini, "menu", "soundfx_enabled", init.soundfx_enabled); settings->rom_autoload_enabled = mini_get_bool(ini, "menu", "autoload_rom_enabled", init.rom_autoload_enabled); settings->rom_autoload_path = strdup(mini_get_string(ini, "autoload", "rom_path", init.rom_autoload_path)); @@ -62,7 +62,7 @@ void settings_save (settings_t *settings) { mini_set_bool(ini, "menu", "show_protected_entries", settings->show_protected_entries); mini_set_string(ini, "menu", "default_directory", settings->default_directory); mini_set_bool(ini, "menu", "use_saves_folder", settings->use_saves_folder); - mini_set_bool(ini, "menu", "sound_enabled", settings->sound_enabled); + mini_set_bool(ini, "menu", "soundfx_enabled", settings->soundfx_enabled); mini_set_bool(ini, "menu", "autoload_rom_enabled", settings->rom_autoload_enabled); mini_set_string(ini, "autoload", "rom_path", settings->rom_autoload_path); mini_set_string(ini, "autoload", "rom_filename", settings->rom_autoload_filename); diff --git a/src/menu/settings.h b/src/menu/settings.h index 471879eb..26454412 100644 --- a/src/menu/settings.h +++ b/src/menu/settings.h @@ -26,7 +26,7 @@ typedef struct { bool bgm_enabled; /** @brief Enable Sounds */ - bool sound_enabled; + bool soundfx_enabled; /** @brief Enable rumble feedback */ bool rumble_enabled; diff --git a/src/menu/views/settings_editor.c b/src/menu/views/settings_editor.c index 8e7c2bc9..a5c3acca 100644 --- a/src/menu/views/settings_editor.c +++ b/src/menu/views/settings_editor.c @@ -23,9 +23,9 @@ static void set_use_saves_folder_type (menu_t *menu, void *arg) { settings_save(&menu->settings); } -static void set_sound_enabled_type (menu_t *menu, void *arg) { - menu->settings.sound_enabled = (bool)(uintptr_t)(arg); - sound_use_sfx(menu->settings.sound_enabled); +static void set_soundfx_enabled_type (menu_t *menu, void *arg) { + menu->settings.soundfx_enabled = (bool)(uintptr_t)(arg); + sound_use_sfx(menu->settings.soundfx_enabled); settings_save(&menu->settings); } @@ -58,9 +58,9 @@ static component_context_menu_t set_protected_entries_type_context_menu = { .lis COMPONENT_CONTEXT_MENU_LIST_END, }}; -static component_context_menu_t set_sound_enabled_type_context_menu = { .list = { - {.text = "On", .action = set_sound_enabled_type, .arg = (void *)(uintptr_t)(true) }, - {.text = "Off", .action = set_sound_enabled_type, .arg = (void *)(uintptr_t)(false) }, +static component_context_menu_t set_soundfx_enabled_type_context_menu = { .list = { + {.text = "On", .action = set_soundfx_enabled_type, .arg = (void *)(uintptr_t)(true) }, + {.text = "Off", .action = set_soundfx_enabled_type, .arg = (void *)(uintptr_t)(false) }, COMPONENT_CONTEXT_MENU_LIST_END, }}; @@ -92,7 +92,7 @@ static component_context_menu_t set_rumble_enabled_type_context_menu = { .list = static component_context_menu_t options_context_menu = { .list = { { .text = "Show Hidden Files", .submenu = &set_protected_entries_type_context_menu }, - { .text = "Sound Effects", .submenu = &set_sound_enabled_type_context_menu }, + { .text = "Sound Effects", .submenu = &set_soundfx_enabled_type_context_menu }, { .text = "Use Saves Folder", .submenu = &set_use_saves_folder_type_context_menu }, #ifdef BETA_SETTINGS { .text = "PAL60 Mode", .submenu = &set_pal60_type_context_menu }, @@ -154,7 +154,7 @@ static void draw (menu_t *menu, surface_t *d) { format_switch(menu->settings.rom_autoload_enabled), format_switch(menu->settings.show_protected_entries), format_switch(menu->settings.use_saves_folder), - format_switch(menu->settings.sound_enabled) + format_switch(menu->settings.soundfx_enabled) #ifdef BETA_SETTINGS , format_switch(menu->settings.pal60_enabled),