Cut down on code duplication

This commit is contained in:
twinaphex 2018-01-12 04:51:15 +01:00
parent ef6b87ae2c
commit fb38c0da21

View File

@ -189,6 +189,18 @@ static unsigned action_ok_dl_to_enum(unsigned lbl)
return MENU_ENUM_LABEL_DEFERRED_AUDIO_SETTINGS_LIST;
case ACTION_OK_DL_INPUT_HOTKEY_BINDS_LIST:
return MENU_ENUM_LABEL_DEFERRED_INPUT_HOTKEY_BINDS_LIST;
case ACTION_OK_DL_RECORDING_SETTINGS_LIST:
return MENU_ENUM_LABEL_DEFERRED_RECORDING_SETTINGS_LIST;
case ACTION_OK_DL_PLAYLIST_SETTINGS_LIST:
return MENU_ENUM_LABEL_DEFERRED_PLAYLIST_SETTINGS_LIST;
case ACTION_OK_DL_ACCOUNTS_CHEEVOS_LIST:
return MENU_ENUM_LABEL_DEFERRED_ACCOUNTS_CHEEVOS_LIST;
case ACTION_OK_DL_PLAYLIST_COLLECTION:
return MENU_ENUM_LABEL_DEFERRED_PLAYLIST_LIST;
case ACTION_OK_DL_FAVORITES_LIST:
return MENU_ENUM_LABEL_DEFERRED_FAVORITES_LIST;
case ACTION_OK_DL_BROWSE_URL_LIST:
return MENU_ENUM_LABEL_DEFERRED_BROWSE_URL_LIST;
default:
break;
}
@ -237,15 +249,6 @@ int generic_action_ok_displaylist_push(const char *path,
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_BROWSE_URL_START;
dl_type = DISPLAYLIST_GENERIC;
break;
case ACTION_OK_DL_FAVORITES_LIST:
info.type = type;
info.directory_ptr = idx;
info_path = label;
info_label = msg_hash_to_str(
MENU_ENUM_LABEL_DEFERRED_FAVORITES_LIST);
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_FAVORITES_LIST;
dl_type = DISPLAYLIST_GENERIC;
break;
case ACTION_OK_DL_IMAGES_LIST:
info.type = type;
info.directory_ptr = idx;
@ -446,15 +449,6 @@ int generic_action_ok_displaylist_push(const char *path,
info_label = label;
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_FILE;
break;
case ACTION_OK_DL_PLAYLIST_COLLECTION:
info.type = type;
info.directory_ptr = idx;
info_path = path;
info_label = msg_hash_to_str(
MENU_ENUM_LABEL_DEFERRED_PLAYLIST_LIST);
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_PLAYLIST_LIST;
dl_type = DISPLAYLIST_GENERIC;
break;
case ACTION_OK_DL_MUSIC_LIST:
info.type = type;
info.directory_ptr = idx;
@ -480,14 +474,6 @@ int generic_action_ok_displaylist_push(const char *path,
info_label = label;
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_CORE;
break;
case ACTION_OK_DL_BROWSE_URL_LIST:
info.directory_ptr = idx;
info.type = type;
info_path = path;
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_BROWSE_URL_LIST);
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_BROWSE_URL_LIST;
dl_type = DISPLAYLIST_GENERIC;
break;
case ACTION_OK_DL_CONTENT_COLLECTION_LIST:
info.type = type;
info.directory_ptr = idx;
@ -712,31 +698,13 @@ int generic_action_ok_displaylist_push(const char *path,
case ACTION_OK_DL_PRIVACY_SETTINGS_LIST:
case ACTION_OK_DL_AUDIO_SETTINGS_LIST:
case ACTION_OK_DL_INPUT_HOTKEY_BINDS_LIST:
action_ok_dl_lbl(action_ok_dl_to_enum(action_type), DISPLAYLIST_GENERIC);
break;
case ACTION_OK_DL_RECORDING_SETTINGS_LIST:
info.directory_ptr = idx;
info.type = type;
info_path = path;
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_RECORDING_SETTINGS_LIST);
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_RECORDING_SETTINGS_LIST;
dl_type = DISPLAYLIST_GENERIC;
break;
case ACTION_OK_DL_PLAYLIST_SETTINGS_LIST:
info.directory_ptr = idx;
info.type = type;
info_path = path;
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_PLAYLIST_SETTINGS_LIST);
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_PLAYLIST_SETTINGS_LIST;
dl_type = DISPLAYLIST_GENERIC;
break;
case ACTION_OK_DL_ACCOUNTS_CHEEVOS_LIST:
info.directory_ptr = idx;
info.type = type;
info_path = path;
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_ACCOUNTS_CHEEVOS_LIST);
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_ACCOUNTS_CHEEVOS_LIST;
dl_type = DISPLAYLIST_GENERIC;
case ACTION_OK_DL_PLAYLIST_COLLECTION:
case ACTION_OK_DL_FAVORITES_LIST:
case ACTION_OK_DL_BROWSE_URL_LIST:
action_ok_dl_lbl(action_ok_dl_to_enum(action_type), DISPLAYLIST_GENERIC);
break;
case ACTION_OK_DL_CONTENT_SETTINGS:
info.list = menu_entries_get_selection_buf_ptr(0);