mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 17:43:02 +00:00
Create DISPLAYLIST_OPTIONS_REMAPPINGS
This commit is contained in:
parent
a86d56dbd8
commit
37fbbd3eb1
@ -995,6 +995,43 @@ static int menu_displaylist_parse_options_cheats(menu_displaylist_info_t *info)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int menu_displaylist_parse_options_remappings(menu_displaylist_info_t *info)
|
||||||
|
{
|
||||||
|
unsigned p, retro_id;
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
global_t *global = global_get_ptr();
|
||||||
|
|
||||||
|
menu_list_push(info->list, "Load Remap File", "remap_file_load",
|
||||||
|
MENU_SETTING_ACTION, 0);
|
||||||
|
menu_list_push(info->list, "Save Remap File As",
|
||||||
|
"remap_file_save_as", MENU_SETTING_ACTION, 0);
|
||||||
|
menu_list_push(info->list, "Save Core Remap File",
|
||||||
|
"remap_file_save_core", MENU_SETTING_ACTION, 0);
|
||||||
|
menu_list_push(info->list, "Save Game Remap File",
|
||||||
|
"remap_file_save_game", MENU_SETTING_ACTION, 0);
|
||||||
|
|
||||||
|
for (p = 0; p < settings->input.max_users; p++)
|
||||||
|
{
|
||||||
|
for (retro_id = 0; retro_id < RARCH_FIRST_META_KEY; retro_id++)
|
||||||
|
{
|
||||||
|
char desc_label[64];
|
||||||
|
unsigned user = p + 1;
|
||||||
|
const char *description = global->system.input_desc_btn[p][retro_id];
|
||||||
|
|
||||||
|
if (!description)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
snprintf(desc_label, sizeof(desc_label),
|
||||||
|
"User %u %s : ", user, description);
|
||||||
|
menu_list_push(info->list, desc_label, "",
|
||||||
|
MENU_SETTINGS_INPUT_DESC_BEGIN +
|
||||||
|
(p * RARCH_FIRST_META_KEY) + retro_id, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
|
int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
@ -1060,6 +1097,13 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
|
|||||||
|
|
||||||
ret = menu_displaylist_parse_options_management(info);
|
ret = menu_displaylist_parse_options_management(info);
|
||||||
|
|
||||||
|
need_push = true;
|
||||||
|
break;
|
||||||
|
case DISPLAYLIST_OPTIONS_REMAPPINGS:
|
||||||
|
menu_list_clear(info->list);
|
||||||
|
|
||||||
|
ret = menu_displaylist_parse_options_remappings(info);
|
||||||
|
|
||||||
need_push = true;
|
need_push = true;
|
||||||
break;
|
break;
|
||||||
case DISPLAYLIST_OPTIONS_VIDEO:
|
case DISPLAYLIST_OPTIONS_VIDEO:
|
||||||
|
@ -65,6 +65,7 @@ enum
|
|||||||
DISPLAYLIST_SHADER_PARAMETERS_PRESET,
|
DISPLAYLIST_SHADER_PARAMETERS_PRESET,
|
||||||
DISPLAYLIST_OPTIONS,
|
DISPLAYLIST_OPTIONS,
|
||||||
DISPLAYLIST_OPTIONS_CHEATS,
|
DISPLAYLIST_OPTIONS_CHEATS,
|
||||||
|
DISPLAYLIST_OPTIONS_REMAPPINGS,
|
||||||
DISPLAYLIST_OPTIONS_MANAGEMENT,
|
DISPLAYLIST_OPTIONS_MANAGEMENT,
|
||||||
DISPLAYLIST_OPTIONS_DISK,
|
DISPLAYLIST_OPTIONS_DISK,
|
||||||
DISPLAYLIST_OPTIONS_VIDEO,
|
DISPLAYLIST_OPTIONS_VIDEO,
|
||||||
|
@ -1209,52 +1209,19 @@ static int deferred_push_core_cheat_options(void *data, void *userdata,
|
|||||||
return menu_displaylist_push_list(&info, DISPLAYLIST_OPTIONS_CHEATS);
|
return menu_displaylist_push_list(&info, DISPLAYLIST_OPTIONS_CHEATS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int deferred_push_core_input_remapping_options(void *data, void *userdata,
|
static int deferred_push_core_input_remapping_options(void *data, void *userdata,
|
||||||
const char *path, const char *label, unsigned type)
|
const char *path, const char *label, unsigned type)
|
||||||
{
|
{
|
||||||
unsigned p, retro_id;
|
menu_displaylist_info_t info = {0};
|
||||||
file_list_t *list = (file_list_t*)data;
|
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
global_t *global = global_get_ptr();
|
|
||||||
|
|
||||||
(void)userdata;
|
info.list = (file_list_t*)data;
|
||||||
(void)type;
|
info.menu_list = (file_list_t*)userdata;
|
||||||
|
info.type = type;
|
||||||
|
strlcpy(info.path, path, sizeof(info.path));
|
||||||
|
strlcpy(info.label, label, sizeof(info.label));
|
||||||
|
|
||||||
if (!list)
|
return menu_displaylist_push_list(&info, DISPLAYLIST_OPTIONS_REMAPPINGS);
|
||||||
return -1;
|
|
||||||
|
|
||||||
menu_list_clear(list);
|
|
||||||
menu_list_push(list, "Load Remap File", "remap_file_load",
|
|
||||||
MENU_SETTING_ACTION, 0);
|
|
||||||
menu_list_push(list, "Save Remap File As",
|
|
||||||
"remap_file_save_as", MENU_SETTING_ACTION, 0);
|
|
||||||
menu_list_push(list, "Save Core Remap File",
|
|
||||||
"remap_file_save_core", MENU_SETTING_ACTION, 0);
|
|
||||||
menu_list_push(list, "Save Game Remap File",
|
|
||||||
"remap_file_save_game", MENU_SETTING_ACTION, 0);
|
|
||||||
|
|
||||||
for (p = 0; p < settings->input.max_users; p++)
|
|
||||||
{
|
|
||||||
for (retro_id = 0; retro_id < RARCH_FIRST_META_KEY; retro_id++)
|
|
||||||
{
|
|
||||||
char desc_label[64];
|
|
||||||
unsigned user = p + 1;
|
|
||||||
const char *description = global->system.input_desc_btn[p][retro_id];
|
|
||||||
|
|
||||||
if (!description)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
snprintf(desc_label, sizeof(desc_label),
|
|
||||||
"User %u %s : ", user, description);
|
|
||||||
menu_list_push(list, desc_label, "",
|
|
||||||
MENU_SETTINGS_INPUT_DESC_BEGIN +
|
|
||||||
(p * RARCH_FIRST_META_KEY) + retro_id, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
menu_driver_populate_entries(path, label, type);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int deferred_push_core_options(void *data, void *userdata,
|
static int deferred_push_core_options(void *data, void *userdata,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user