mirror of
https://github.com/libretro/RetroArch
synced 2025-03-31 19:21:06 +00:00
Use enums for hotkey binds list
This commit is contained in:
parent
34c6b1f306
commit
fbd3b4898f
@ -1110,6 +1110,15 @@ int menu_hash_get_help_us(uint32_t hash, char *s, size_t len)
|
||||
|
||||
static const char *menu_hash_to_str_us_label_enum(enum msg_hash_enums msg)
|
||||
{
|
||||
if (msg <= MENU_ENUM_LABEL_INPUT_HOTKEY_BIND_END &&
|
||||
msg >= MENU_ENUM_LABEL_INPUT_HOTKEY_BIND_BEGIN)
|
||||
{
|
||||
static char hotkey_lbl[PATH_MAX_LENGTH] = {0};
|
||||
unsigned idx = msg - MENU_ENUM_LABEL_INPUT_HOTKEY_BIND_BEGIN;
|
||||
snprintf(hotkey_lbl, sizeof(hotkey_lbl), "input_hotkey_binds_%d", idx);
|
||||
return hotkey_lbl;
|
||||
}
|
||||
|
||||
switch (msg)
|
||||
{
|
||||
case MENU_ENUM_LABEL_VIDEO_MAX_SWAPCHAIN_IMAGES:
|
||||
|
@ -4189,8 +4189,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
||||
|
||||
for (i = 0; i < RARCH_BIND_LIST_END; i++)
|
||||
{
|
||||
ret = menu_displaylist_parse_settings(menu, info,
|
||||
input_config_bind_map_get_base(i), PARSE_ONLY_BIND, false);
|
||||
ret = menu_displaylist_parse_settings_enum(menu, info,
|
||||
MENU_ENUM_LABEL_INPUT_HOTKEY_BIND_BEGIN + i,
|
||||
PARSE_ONLY_BIND, false);
|
||||
(void)ret;
|
||||
}
|
||||
}
|
||||
|
@ -6255,7 +6255,8 @@ static bool setting_append_list(
|
||||
&retro_keybinds_1[i],
|
||||
&group_info, &subgroup_info, parent_group);
|
||||
(*list)[list_info->index - 1].bind_type = i + MENU_SETTINGS_BIND_BEGIN;
|
||||
/* TODO - add enum_idx */
|
||||
menu_settings_list_current_add_enum_idx(list, list_info,
|
||||
MENU_ENUM_LABEL_INPUT_HOTKEY_BIND_BEGIN + i);
|
||||
}
|
||||
|
||||
END_SUB_GROUP(list, list_info, parent_group);
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include <retro_common_api.h>
|
||||
|
||||
#include "driver.h"
|
||||
#include "input/input_driver.h"
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
@ -284,6 +285,9 @@ enum msg_hash_enums
|
||||
MSG_EXTRACTING_FILE,
|
||||
MSG_NO_CONTENT_STARTING_DUMMY_CORE,
|
||||
|
||||
MENU_ENUM_LABEL_INPUT_HOTKEY_BIND_BEGIN,
|
||||
MENU_ENUM_LABEL_INPUT_HOTKEY_BIND_END = MENU_ENUM_LABEL_INPUT_HOTKEY_BIND_BEGIN + RARCH_BIND_LIST_END,
|
||||
|
||||
MENU_ENUM_LABEL_MENU_WALLPAPER_OPACITY,
|
||||
MENU_ENUM_LABEL_VALUE_MENU_WALLPAPER_OPACITY,
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user