Setting recordings from the menu works now

This commit is contained in:
twinaphex 2015-04-15 10:55:23 +02:00
parent ee3442b962
commit 3717414e2e
3 changed files with 32 additions and 0 deletions

View File

@ -87,6 +87,7 @@ typedef enum
MENU_FILE_RDB,
MENU_FILE_RDB_ENTRY,
MENU_FILE_CURSOR,
MENU_FILE_RECORD_CONFIG,
MENU_SETTINGS,
MENU_SETTING_DRIVER,
MENU_SETTING_ACTION,

View File

@ -1759,6 +1759,13 @@ static int deferred_push_remap_file_load(void *data, void *userdata,
MENU_FILE_REMAP, "rmp", NULL);
}
static int deferred_push_record_configfile(void *data, void *userdata,
const char *path, const char *label, unsigned type)
{
return menu_entries_parse_list((file_list_t*)data, (file_list_t*)userdata, path, label, type,
MENU_FILE_RECORD_CONFIG, "cfg", NULL);
}
static int deferred_push_input_overlay(void *data, void *userdata,
const char *path, const char *label, unsigned type)
{
@ -1871,6 +1878,8 @@ void menu_entries_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs,
cbs->action_deferred_push = deferred_push_cheat_file_load;
else if (!strcmp(label, "remap_file_load"))
cbs->action_deferred_push = deferred_push_remap_file_load;
else if (!strcmp(label, "record_config"))
cbs->action_deferred_push = deferred_push_record_configfile;
else if (!strcmp(label, "content_actions"))
cbs->action_deferred_push = deferred_push_content_actions;
else if (!strcmp(label, "shader_options"))

View File

@ -349,6 +349,25 @@ static int action_ok_core_list(const char *path,
label, type, idx);
}
static int action_ok_record_configfile_load(const char *path,
const char *label, unsigned type, size_t idx)
{
const char *menu_path = NULL;
char record_configpath[PATH_MAX_LENGTH];
global_t *global = global_get_ptr();
menu_handle_t *menu = menu_driver_get_ptr();
if (!menu || !global)
return -1;
menu_list_get_last_stack(menu->menu_list, &menu_path, NULL,
NULL);
fill_pathname_join(global->record.config, menu_path, path, sizeof(global->record.config));
menu_list_flush_stack_by_needle(menu->menu_list, "Recording Settings");
return 0;
}
static int action_ok_remap_file_load(const char *path,
const char *label, unsigned type, size_t idx)
{
@ -1371,6 +1390,9 @@ void menu_entries_cbs_init_bind_ok(menu_file_list_cbs_t *cbs,
case MENU_FILE_CHEAT:
cbs->action_ok = action_ok_cheat_file_load;
break;
case MENU_FILE_RECORD_CONFIG:
cbs->action_ok = action_ok_record_configfile_load;
break;
case MENU_FILE_REMAP:
cbs->action_ok = action_ok_remap_file_load;
break;