Simplify menu_common_type_is

This commit is contained in:
twinaphex 2014-10-16 04:25:38 +02:00
parent e371d598df
commit 395dc79f6c
4 changed files with 11 additions and 25 deletions

View File

@ -545,7 +545,7 @@ static int menu_common_iterate(unsigned action)
return menu_load_or_open_zip_iterate(action);
else if (!strcmp(label, "info_screen"))
return menu_info_screen_iterate(action);
else if (menu_common_type_is(label, type) == MENU_SETTINGS)
else if (type == MENU_SETTINGS || type == MENU_FILE_CATEGORY)
return menu_settings_iterate(action, cbs);
else if (
type == MENU_SETTINGS_CUSTOM_VIEWPORT ||

View File

@ -440,24 +440,6 @@ int menu_iterate(retro_input_t input,
unsigned menu_common_type_is(const char *label, unsigned type)
{
if (
type == MENU_SETTINGS ||
type == MENU_FILE_CATEGORY ||
!strcmp(label, "Shader Options") ||
!strcmp(label, "Input Options") ||
!strcmp(label, "core_options") ||
!strcmp(label, "core_information") ||
!strcmp(label, "video_shader_parameters") ||
!strcmp(label, "video_shader_preset_parameters") ||
!strcmp(label, "disk_options") ||
!strcmp(label, "settings") ||
!strcmp(label, "performance_counters") ||
!strcmp(label, "frontend_counters") ||
!strcmp(label, "core_counters")
)
return MENU_SETTINGS;
if (
!strcmp(label, "rgui_browser_directory") ||
!strcmp(label, "content_directory") ||

View File

@ -109,14 +109,17 @@ int setting_set_flags(rarch_setting_t *setting)
{
if (setting->flags & SD_FLAG_ALLOW_INPUT)
return MENU_FILE_LINEFEED;
if (
setting->flags & SD_FLAG_IS_CATEGORY ||
setting->type == ST_GROUP ||
setting->type == ST_SUB_GROUP)
return MENU_FILE_CATEGORY;
if (setting->flags & SD_FLAG_PUSH_ACTION)
return MENU_FILE_SWITCH;
if (setting->flags & SD_FLAG_IS_DRIVER)
return MENU_FILE_DRIVER;
if (setting->type == ST_PATH)
return MENU_FILE_PATH;
if (setting->flags & SD_FLAG_IS_CATEGORY)
return MENU_FILE_CATEGORY;
return 0;
}

View File

@ -1826,9 +1826,9 @@ static int deferred_push_shader_options(void *data, void *userdata,
file_list_push(list, "Shader Preset Save As",
"video_shader_preset_save_as", MENU_FILE_LINEFEED_SWITCH, 0);
file_list_push(list, "Parameters (Current)",
"video_shader_parameters", MENU_FILE_SWITCH, 0);
"video_shader_parameters", MENU_FILE_CATEGORY, 0);
file_list_push(list, "Parameters (Menu)",
"video_shader_preset_parameters", MENU_FILE_SWITCH, 0);
"video_shader_preset_parameters", MENU_FILE_CATEGORY, 0);
file_list_push(list, "Shader Passes", "video_shader_num_passes",
0, 0);
@ -2433,10 +2433,11 @@ static void menu_entries_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs,
cbs->action_deferred_push = deferred_push_default;
if (type == MENU_FILE_CATEGORY)
cbs->action_deferred_push = deferred_push_category;
if (!strcmp(label, "history_list"))
cbs->action_deferred_push = deferred_push_history_list;
else if (type == MENU_FILE_CATEGORY)
cbs->action_deferred_push = deferred_push_category;
else if (!strcmp(label, "deferred_core_list"))
cbs->action_deferred_push = deferred_push_core_list_deferred;
else if (!strcmp(label, "Input Options"))