diff --git a/general.h b/general.h index e14b7f3a41..0a9f583282 100644 --- a/general.h +++ b/general.h @@ -301,6 +301,13 @@ struct settings bool horizontal_enable; bool vertical_enable; } wraparound; + struct + { + struct + { + bool supported_extensions_enable; + } filter; + } browser; } navigation; } menu; #endif diff --git a/menu/menu_entries.c b/menu/menu_entries.c index 6bceb21eff..9eaf1be6aa 100644 --- a/menu/menu_entries.c +++ b/menu/menu_entries.c @@ -354,7 +354,7 @@ int menu_entries_parse_list(file_list_t *list, file_list_t *menu_list, if (path_is_compressed) str_list = compressed_file_list_new(dir,exts); else - str_list = dir_list_new(dir, exts, true); + str_list = dir_list_new(dir, g_settings.menu.navigation.browser.filter.supported_extensions_enable ? exts : NULL, true); if (!str_list) return -1; diff --git a/retroarch.cfg b/retroarch.cfg index c641204b20..2d9a6214c6 100644 --- a/retroarch.cfg +++ b/retroarch.cfg @@ -567,6 +567,9 @@ # Wrap-around to beginning and/or end if boundary of list reached vertically # menu_navigation_wraparound_vertical_enable = false +# Filter files being show in 'Load Content' by supported extensions +# menu_navigation_browser_filter_supported_extensions_enable = true + #### Camera # Override the default camera device the camera driver uses. This is driver dependant. diff --git a/settings.c b/settings.c index c5e4ded1f8..805e5daecb 100644 --- a/settings.c +++ b/settings.c @@ -435,6 +435,7 @@ static void config_set_defaults(void) g_settings.menu.mouse_enable = false; g_settings.menu.navigation.wraparound.horizontal_enable = true; g_settings.menu.navigation.wraparound.vertical_enable = true; + g_settings.menu.navigation.browser.filter.supported_extensions_enable = true; #endif @@ -902,6 +903,7 @@ static bool config_load_file(const char *path, bool set_defaults) CONFIG_GET_BOOL(menu.mouse_enable, "menu_mouse_enable"); CONFIG_GET_BOOL(menu.navigation.wraparound.horizontal_enable, "menu_navigation_wraparound_horizontal_enable"); CONFIG_GET_BOOL(menu.navigation.wraparound.vertical_enable, "menu_navigation_wraparound_vertical_enable"); + CONFIG_GET_BOOL(menu.navigation.browser.filter.supported_extensions_enable, "menu_navigation_browser_filter_supported_extensions_enable"); #endif CONFIG_GET_INT(video.hard_sync_frames, "video_hard_sync_frames"); @@ -1707,6 +1709,8 @@ bool config_save_file(const char *path) g_settings.menu.navigation.wraparound.horizontal_enable); config_set_bool(conf, "menu_navigation_wraparound_vertical_enable", g_settings.menu.navigation.wraparound.vertical_enable); + config_set_bool(conf, "menu_navigation_browser_filter_supported_extensions_enable", + g_settings.menu.navigation.browser.filter.supported_extensions_enable); #endif config_set_path(conf, "game_history_path", g_settings.content_history_path); diff --git a/settings_data.c b/settings_data.c index 57b95720bb..bcdcd6cc76 100644 --- a/settings_data.c +++ b/settings_data.c @@ -4784,6 +4784,22 @@ static bool setting_data_append_list_menu_options( END_SUB_GROUP(list, list_info); + START_SUB_GROUP(list, list_info, "Browser", group_info.name, subgroup_info); + + CONFIG_BOOL( + g_settings.menu.navigation.browser.filter.supported_extensions_enable, + "menu_navigation_browser_filter_supported_extensions_enable", + "Load Content - Filter by supported extensions", + true, + "OFF", + "ON", + group_info.name, + subgroup_info.name, + general_write_handler, + general_read_handler); + + END_SUB_GROUP(list, list_info); + END_GROUP(list, list_info); #endif