mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +00:00
Create action_ok_set_path in menu_entries_cbs.c
This commit is contained in:
parent
57ef160288
commit
17035b82c5
@ -824,15 +824,6 @@ static int menu_action_ok(const char *menu_path,
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
case MENU_FILE_FONT:
|
||||
case MENU_FILE_OVERLAY:
|
||||
case MENU_FILE_AUDIOFILTER:
|
||||
case MENU_FILE_VIDEOFILTER:
|
||||
|
||||
menu_action_setting_set_current_string_path(setting, menu_path, path);
|
||||
menu_entries_pop_stack(driver.menu->menu_stack, setting->name);
|
||||
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
@ -282,6 +282,30 @@ static int action_ok_config_load(const char *path,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int action_ok_set_path(const char *path,
|
||||
const char *label, unsigned type, size_t index)
|
||||
{
|
||||
const char *menu_path = NULL;
|
||||
const char *menu_label = NULL;
|
||||
rarch_setting_t *setting = NULL;
|
||||
|
||||
if (!driver.menu)
|
||||
return -1;
|
||||
|
||||
file_list_get_last(driver.menu->menu_stack, &menu_path, &menu_label, NULL);
|
||||
|
||||
setting = (rarch_setting_t*)
|
||||
setting_data_find_setting(driver.menu->list_settings, menu_label);
|
||||
|
||||
if (!setting)
|
||||
return -1;
|
||||
|
||||
menu_action_setting_set_current_string_path(setting, menu_path, path);
|
||||
menu_entries_pop_stack(driver.menu->menu_stack, setting->name);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Bind the OK callback function */
|
||||
|
||||
static int menu_entries_cbs_init_bind_ok(menu_file_list_cbs_t *cbs,
|
||||
@ -325,6 +349,12 @@ static int menu_entries_cbs_init_bind_ok(menu_file_list_cbs_t *cbs,
|
||||
else
|
||||
return -1;
|
||||
break;
|
||||
case MENU_FILE_FONT:
|
||||
case MENU_FILE_OVERLAY:
|
||||
case MENU_FILE_AUDIOFILTER:
|
||||
case MENU_FILE_VIDEOFILTER:
|
||||
cbs->action_ok = action_ok_set_path;
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user