Merge pull request #9807 from libretro/deferred-refactors-pt2

(menu_cbs_ok) Cleanups
This commit is contained in:
Twinaphex 2019-12-02 06:17:30 +01:00 committed by GitHub
commit bfe00ac6f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6154,30 +6154,33 @@ static int is_rdb_entry(enum msg_hash_enums enum_idx)
static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
const char *label, uint32_t hash)
{
if (cbs->enum_idx != MSG_UNKNOWN && is_rdb_entry(cbs->enum_idx) == 0)
{
BIND_ACTION_OK(cbs, action_ok_rdb_entry_submenu);
return 0;
}
if (cbs->enum_idx != MSG_UNKNOWN)
{
const char *str = msg_hash_to_str(cbs->enum_idx);
if (str && strstr(str, "input_binds_list"))
if (str)
{
unsigned i;
for (i = 0; i < MAX_USERS; i++)
if (is_rdb_entry(cbs->enum_idx) == 0)
{
unsigned first_char = atoi(&str[0]);
if (first_char != ((i+1)))
continue;
BIND_ACTION_OK(cbs, action_ok_push_user_binds_list);
BIND_ACTION_OK(cbs, action_ok_rdb_entry_submenu);
return 0;
}
if (strstr(str, "input_binds_list"))
{
unsigned i;
for (i = 0; i < MAX_USERS; i++)
{
unsigned first_char = atoi(&str[0]);
if (first_char != ((i+1)))
continue;
BIND_ACTION_OK(cbs, action_ok_push_user_binds_list);
return 0;
}
}
}
}