Merge pull request #7583 from alfrix/input_icons

Input icons (User Binds)
This commit is contained in:
Twinaphex 2018-11-12 21:53:07 +01:00 committed by GitHub
commit 1ef286ec7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 57 additions and 14 deletions

View File

@ -862,6 +862,7 @@ switch (id)
break;
case OZONE_ENTRIES_ICONS_TEXTURE_SHUTDOWN:
icon_name = "menu_shutdown.png";
break;
case OZONE_ENTRIES_ICONS_TEXTURE_INPUT_DPAD_U:
icon_name = "input_DPAD-U.png";
break;
@ -1162,6 +1163,7 @@ static unsigned ozone_entries_icon_get_id(ozone_handle_t *ozone,
case MENU_ENUM_LABEL_REBOOT:
case MENU_ENUM_LABEL_RESET_TO_DEFAULT_CONFIG:
case MENU_ENUM_LABEL_CHEAT_RELOAD_CHEATS:
case MENU_ENUM_LABEL_RESTART_RETROARCH:
return OZONE_ENTRIES_ICONS_TEXTURE_RELOAD;
case MENU_ENUM_LABEL_SHUTDOWN:
return OZONE_ENTRIES_ICONS_TEXTURE_SHUTDOWN;
@ -1275,15 +1277,29 @@ static unsigned ozone_entries_icon_get_id(ozone_handle_t *ozone,
#endif
if (
(type >= MENU_SETTINGS_INPUT_DESC_BEGIN) &&
(type >= MENU_SETTINGS_INPUT_BEGIN) &&
(type <= MENU_SETTINGS_INPUT_DESC_END)
)
{
unsigned input_id;
input_id = MENU_SETTINGS_INPUT_DESC_BEGIN;
while (type > (input_id + 23))
if (type < MENU_SETTINGS_INPUT_DESC_BEGIN)
{
input_id = (input_id + 24) ;
input_id = MENU_SETTINGS_INPUT_BEGIN;
if ( type == input_id + 2)
return OZONE_ENTRIES_ICONS_TEXTURE_INPUT_SETTINGS;
if ( type == input_id + 4)
return OZONE_ENTRIES_ICONS_TEXTURE_RELOAD;
if ( type == input_id + 5)
return OZONE_ENTRIES_ICONS_TEXTURE_SAVING;
input_id = input_id + 7;
}
else
{
input_id = MENU_SETTINGS_INPUT_DESC_BEGIN;
while (type > (input_id + 23))
{
input_id = (input_id + 24) ;
}
}
if ( type == input_id )
return OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_D;

View File

@ -2483,6 +2483,7 @@ static uintptr_t xmb_icon_get_id(xmb_handle_t *xmb,
case MENU_ENUM_LABEL_REBOOT:
case MENU_ENUM_LABEL_RESET_TO_DEFAULT_CONFIG:
case MENU_ENUM_LABEL_CHEAT_RELOAD_CHEATS:
case MENU_ENUM_LABEL_RESTART_RETROARCH:
return xmb->textures.list[XMB_TEXTURE_RELOAD];
case MENU_ENUM_LABEL_SHUTDOWN:
return xmb->textures.list[XMB_TEXTURE_SHUTDOWN];
@ -2620,15 +2621,29 @@ static uintptr_t xmb_icon_get_id(xmb_handle_t *xmb,
#endif
if (
(type >= MENU_SETTINGS_INPUT_DESC_BEGIN) &&
(type >= MENU_SETTINGS_INPUT_BEGIN) &&
(type <= MENU_SETTINGS_INPUT_DESC_END)
)
{
unsigned input_id;
input_id = MENU_SETTINGS_INPUT_DESC_BEGIN;
while (type > (input_id + 23))
if (type < MENU_SETTINGS_INPUT_DESC_BEGIN)
{
input_id = (input_id + 24) ;
input_id = MENU_SETTINGS_INPUT_BEGIN;
if ( type == input_id + 2)
return xmb->textures.list[XMB_TEXTURE_INPUT_SETTINGS];
if ( type == input_id + 4)
return xmb->textures.list[XMB_TEXTURE_RELOAD];
if ( type == input_id + 5)
return xmb->textures.list[XMB_TEXTURE_SAVING];
input_id = input_id + 7;
}
else
{
input_id = MENU_SETTINGS_INPUT_DESC_BEGIN;
while (type > (input_id + 23))
{
input_id = (input_id + 24) ;
}
}
if ( type == input_id )
return xmb->textures.list[XMB_TEXTURE_INPUT_BTN_D];
@ -4837,6 +4852,7 @@ static const char *xmb_texture_path(unsigned id)
break;
case XMB_TEXTURE_SHUTDOWN:
icon_name = "menu_shutdown.png";
break;
case XMB_TEXTURE_INPUT_DPAD_U:
icon_name = "input_DPAD-U.png";
break;

View File

@ -2080,6 +2080,7 @@ static int menu_displaylist_parse_settings_internal(void *data,
menu_displaylist_info_t *info,
enum menu_displaylist_parse_type parse_type,
bool add_empty_entry,
unsigned entry_type,
rarch_setting_t *setting
)
{
@ -2231,8 +2232,16 @@ static int menu_displaylist_parse_settings_internal(void *data,
goto loop;
#endif
if (
(entry_type >= MENU_SETTINGS_INPUT_BEGIN) &&
(entry_type < MENU_SETTINGS_INPUT_END)
)
entry_type = MENU_SETTINGS_INPUT_BEGIN + count;
if (entry_type == 0)
entry_type = menu_setting_set_flags(setting);
menu_entries_append(info->list, short_description,
name, menu_setting_set_flags(setting), 0, 0);
name, entry_type, 0, 0);
count++;
loop:
@ -2481,7 +2490,7 @@ loop:
return 0;
}
#define menu_displaylist_parse_settings(data, info, info_label, parse_type, add_empty_entry) menu_displaylist_parse_settings_internal(data, info, parse_type, add_empty_entry, menu_setting_find(info_label))
#define menu_displaylist_parse_settings(data, info, info_label, parse_type, add_empty_entry, entry_type) menu_displaylist_parse_settings_internal(data, info, parse_type, add_empty_entry, entry_type, menu_setting_find(info_label))
#define menu_displaylist_parse_settings_enum(data, info, label, parse_type, add_empty_entry) menu_displaylist_parse_settings_internal_enum(data, info, parse_type, add_empty_entry, menu_setting_find_enum(label), label)
@ -3310,9 +3319,9 @@ static int menu_displaylist_parse_options_remappings(
msg_hash_to_str(MENU_ENUM_LABEL_INPUT_PLAYER_ANALOG_DPAD_MODE), val);
menu_displaylist_parse_settings(menu, info,
key_type, PARSE_ONLY_UINT, true);
key_type, PARSE_ONLY_UINT, true, 0);
menu_displaylist_parse_settings(menu, info,
key_analog, PARSE_ONLY_UINT, true);
key_analog, PARSE_ONLY_UINT, true, 0);
}
menu_entries_append_enum(info->list,
@ -6855,7 +6864,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist
msg_hash_to_str(MENU_ENUM_LABEL_INPUT_SPLIT_JOYCON), val);
menu_displaylist_parse_settings(menu, info,
key_split_joycon, PARSE_ONLY_UINT, true);
key_split_joycon, PARSE_ONLY_UINT, true, 0);
}
}
#endif
@ -7643,7 +7652,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist
strlcpy(lbl, temp_val, sizeof(lbl));
ret = menu_displaylist_parse_settings(menu, info,
lbl, PARSE_NONE, true);
lbl, PARSE_NONE, true, MENU_SETTINGS_INPUT_BEGIN);
info->need_refresh = true;
info->need_push = true;
}

View File

@ -226,6 +226,8 @@ enum menu_settings_type
MENU_SETTINGS_PERF_COUNTERS_END = MENU_SETTINGS_PERF_COUNTERS_BEGIN + (MAX_COUNTERS - 1),
MENU_SETTINGS_CHEAT_BEGIN,
MENU_SETTINGS_CHEAT_END = MENU_SETTINGS_CHEAT_BEGIN + (MAX_CHEAT_COUNTERS - 1),
MENU_SETTINGS_INPUT_BEGIN,
MENU_SETTINGS_INPUT_END = MENU_SETTINGS_INPUT_BEGIN + RARCH_CUSTOM_BIND_LIST_END,
MENU_SETTINGS_INPUT_DESC_BEGIN,
MENU_SETTINGS_INPUT_DESC_END = MENU_SETTINGS_INPUT_DESC_BEGIN + ((RARCH_FIRST_CUSTOM_BIND + 8) * MAX_USERS),
MENU_SETTINGS_INPUT_DESC_KBD_BEGIN,