int menu_cbs_init_bind_select(menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx) { if (!cbs) return -1; BIND_ACTION_SELECT(cbs, action_select_default); if (cbs->setting) { uint64_t flags = cbs->setting->flags; if (flags & SD_FLAG_IS_DRIVER) { BIND_ACTION_SELECT(cbs, action_select_driver_setting); return 0; } } if ((type >= MENU_SETTINGS_CORE_OPTION_START)) { BIND_ACTION_SELECT(cbs, action_select_core_setting); return 0; } if (menu_cbs_init_bind_select_compare_label(cbs, label) == 0) return 0; if (menu_cbs_init_bind_select_compare_type(cbs, type) == 0) return 0; return -1; }
int menu_cbs_init_bind_select(menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx) { if (!cbs) return -1; BIND_ACTION_SELECT(cbs, action_select_default); #ifdef HAVE_NETWORKING if (cbs->enum_idx == MENU_ENUM_LABEL_CONNECT_NETPLAY_ROOM) { BIND_ACTION_SELECT(cbs, action_select_netplay_connect_room); return 0; } #endif if (cbs->setting) { uint64_t flags = cbs->setting->flags; if (flags & SD_FLAG_IS_DRIVER) { BIND_ACTION_SELECT(cbs, action_select_driver_setting); return 0; } } if ((type >= MENU_SETTINGS_CORE_OPTION_START)) { BIND_ACTION_SELECT(cbs, action_select_core_setting); return 0; } if (menu_cbs_init_bind_select_compare_label(cbs, label) == 0) return 0; if (menu_cbs_init_bind_select_compare_type(cbs, type) == 0) return 0; return -1; }
static int menu_cbs_init_bind_select_compare_type( menu_file_list_cbs_t *cbs, unsigned type) { if (type >= MENU_SETTINGS_CHEAT_BEGIN && type <= MENU_SETTINGS_CHEAT_END) { BIND_ACTION_SELECT(cbs, action_select_cheat); } #ifdef HAVE_SHADER_MANAGER else if (type >= MENU_SETTINGS_SHADER_PARAMETER_0 && type <= MENU_SETTINGS_SHADER_PARAMETER_LAST) { BIND_ACTION_SELECT(cbs, shader_action_parameter_select); } else if (type >= MENU_SETTINGS_SHADER_PRESET_PARAMETER_0 && type <= MENU_SETTINGS_SHADER_PRESET_PARAMETER_LAST) { BIND_ACTION_SELECT(cbs, shader_action_parameter_preset_select); } #endif else if (type >= MENU_SETTINGS_INPUT_DESC_BEGIN && type <= MENU_SETTINGS_INPUT_DESC_END) { BIND_ACTION_SELECT(cbs, action_select_input_desc); } #ifdef HAVE_KEYMAPPER else if (type >= MENU_SETTINGS_INPUT_DESC_KBD_BEGIN && type <= MENU_SETTINGS_INPUT_DESC_KBD_END) { BIND_ACTION_SELECT(cbs, action_select_input_desc_kbd); } #endif else { switch (type) { case FILE_TYPE_USE_DIRECTORY: BIND_ACTION_SELECT(cbs, action_select_path_use_directory); break; default: return -1; } } return 0; }