diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index f32709d473..14a2a9abcd 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -860,6 +860,33 @@ static int menu_displaylist_parse_disk_options(menu_displaylist_info_t *info) return 0; } +static int menu_displaylist_parse_options(menu_displaylist_info_t *info) +{ + global_t *global = global_get_ptr(); + + menu_list_push(info->list, "Core Options", "core_options", + MENU_SETTING_ACTION, 0); + if (global->main_is_init) + { + if (global->has_set_input_descriptors) + menu_list_push(info->list, "Core Input Remapping Options", "core_input_remapping_options", + MENU_SETTING_ACTION, 0); + menu_list_push(info->list, "Core Cheat Options", "core_cheat_options", + MENU_SETTING_ACTION, 0); + if (!global->libretro_dummy && global->system.disk_control.get_num_images) + menu_list_push(info->list, "Core Disk Options", "disk_options", + MENU_SETTING_ACTION, 0); + } + menu_list_push(info->list, "Video Options", "video_options", + MENU_SETTING_ACTION, 0); +#ifdef HAVE_SHADER_MANAGER + menu_list_push(info->list, "Shader Options", "shader_options", + MENU_SETTING_ACTION, 0); +#endif + + return 0; +} + int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type) { int ret = 0; @@ -897,6 +924,13 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type) menu_list_clear(info->list); ret = menu_displaylist_parse_horizontal_content_actions(info); need_refresh = true; + need_push = true; + break; + case DISPLAYLIST_OPTIONS: + menu_list_clear(info->list); + + ret = menu_displaylist_parse_options(info); + need_push = true; break; case DISPLAYLIST_OPTIONS_VIDEO: diff --git a/menu/menu_displaylist.h b/menu/menu_displaylist.h index 146446cb8a..8441e2af76 100644 --- a/menu/menu_displaylist.h +++ b/menu/menu_displaylist.h @@ -62,6 +62,7 @@ enum DISPLAYLIST_OVERLAYS, DISPLAYLIST_SHADER_PARAMETERS, DISPLAYLIST_SHADER_PARAMETERS_PRESET, + DISPLAYLIST_OPTIONS, DISPLAYLIST_OPTIONS_DISK, DISPLAYLIST_OPTIONS_VIDEO, DISPLAYLIST_OPTIONS_SHADERS, diff --git a/menu/menu_entries_cbs_deferred_push.c b/menu/menu_entries_cbs_deferred_push.c index 5ddd944f9d..6b559b0209 100644 --- a/menu/menu_entries_cbs_deferred_push.c +++ b/menu/menu_entries_cbs_deferred_push.c @@ -1204,37 +1204,15 @@ static int deferred_push_shader_options(void *data, void *userdata, static int deferred_push_options(void *data, void *userdata, const char *path, const char *label, unsigned type) { - file_list_t *list = (file_list_t*)data; - file_list_t *menu_list = (file_list_t*)userdata; - global_t *global = global_get_ptr(); + menu_displaylist_info_t info = {0}; - if (!list || !menu_list) - return -1; + info.list = (file_list_t*)data; + info.menu_list = (file_list_t*)userdata; + info.type = type; + strlcpy(info.path, path, sizeof(info.path)); + strlcpy(info.label, label, sizeof(info.label)); - menu_list_clear(list); - menu_list_push(list, "Core Options", "core_options", - MENU_SETTING_ACTION, 0); - if (global->main_is_init) - { - if (global->has_set_input_descriptors) - menu_list_push(list, "Core Input Remapping Options", "core_input_remapping_options", - MENU_SETTING_ACTION, 0); - menu_list_push(list, "Core Cheat Options", "core_cheat_options", - MENU_SETTING_ACTION, 0); - if (!global->libretro_dummy && global->system.disk_control.get_num_images) - menu_list_push(list, "Core Disk Options", "disk_options", - MENU_SETTING_ACTION, 0); - } - menu_list_push(list, "Video Options", "video_options", - MENU_SETTING_ACTION, 0); -#ifdef HAVE_SHADER_MANAGER - menu_list_push(list, "Shader Options", "shader_options", - MENU_SETTING_ACTION, 0); -#endif - - menu_driver_populate_entries(path, label, type); - - return 0; + return menu_displaylist_push_list(&info, DISPLAYLIST_OPTIONS); } static int deferred_push_management_options(void *data, void *userdata,