mirror of
https://github.com/libretro/RetroArch
synced 2025-03-24 13:43:32 +00:00
Implement action_start callback for remap_file_load
This commit is contained in:
parent
5419757c40
commit
724e748254
@ -107,3 +107,14 @@ void input_remapping_save_file(const char *path)
|
||||
config_file_write(conf, remap_file);
|
||||
config_file_free(conf);
|
||||
}
|
||||
|
||||
void input_remapping_set_defaults(void)
|
||||
{
|
||||
unsigned i, j;
|
||||
|
||||
for (i = 0; i < MAX_USERS; i++)
|
||||
{
|
||||
for (j = 0; j < RARCH_BIND_LIST_END; j++)
|
||||
g_settings.input.remap_ids[i][j] = g_settings.input.binds[i][j].id;
|
||||
}
|
||||
}
|
||||
|
@ -42,6 +42,8 @@ bool input_remapping_load_file(const char *path);
|
||||
**/
|
||||
void input_remapping_save_file(const char *path);
|
||||
|
||||
void input_remapping_set_defaults(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -945,6 +945,14 @@ static int action_ok_help(const char *path,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int action_start_remap_file_load(unsigned type, const char *label,
|
||||
unsigned action)
|
||||
{
|
||||
g_settings.input.remapping_path[0] = '\0';
|
||||
input_remapping_set_defaults();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int action_start_performance_counters_core(unsigned type, const char *label,
|
||||
unsigned action)
|
||||
{
|
||||
@ -2726,7 +2734,9 @@ static void menu_entries_cbs_init_bind_start(menu_file_list_cbs_t *cbs,
|
||||
|
||||
cbs->action_start = action_start_lookup_setting;
|
||||
|
||||
if (!strcmp(label, "video_shader_pass"))
|
||||
if (!strcmp(label, "remap_file_load"))
|
||||
cbs->action_start = action_start_remap_file_load;
|
||||
else if (!strcmp(label, "video_shader_pass"))
|
||||
cbs->action_start = action_start_shader_pass;
|
||||
else if (!strcmp(label, "video_shader_scale_pass"))
|
||||
cbs->action_start = action_start_shader_scale_pass;
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <file/file_path.h>
|
||||
#include "input/input_common.h"
|
||||
#include "input/input_keymaps.h"
|
||||
#include "input/input_remapping.h"
|
||||
#include "settings.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -537,11 +538,7 @@ static void config_set_defaults(void)
|
||||
memcpy(g_settings.input.binds[i], retro_keybinds_rest,
|
||||
sizeof(retro_keybinds_rest));
|
||||
|
||||
for (i = 0; i < MAX_USERS; i++)
|
||||
{
|
||||
for (j = 0; j < RARCH_BIND_LIST_END; j++)
|
||||
g_settings.input.remap_ids[i][j] = g_settings.input.binds[i][j].id;
|
||||
}
|
||||
input_remapping_set_defaults();
|
||||
|
||||
for (i = 0; i < MAX_USERS; i++)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user