Core info page cleanup and firmware icons (#17153)

This commit is contained in:
sonninnos 2024-11-04 02:14:53 +02:00 committed by GitHub
parent d5dd3689fc
commit cd4bca9178
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 73 additions and 23 deletions

View File

@ -505,7 +505,7 @@ MSG_HASH(
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_PATH,
"Full path of core"
"Full Path"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CORE_INFO_SAVESTATE_SUPPORT_LEVEL,
@ -537,7 +537,7 @@ MSG_HASH(
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CORE_INFO_FIRMWARE_PATH,
"- Looking in: '%s'"
"- Looking in: %s"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MISSING_REQUIRED,

View File

@ -10527,6 +10527,18 @@ static void materialui_list_insert(
}
/* for other types we don't have an icon */
break;
case MENU_SETTINGS_CORE_INFO_NONE:
node->icon_type = MUI_ICON_TYPE_INTERNAL;
if (strstr(path, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_MISSING_REQUIRED)))
node->icon_texture_index = MUI_TEXTURE_CLOSE;
else if (strstr(path, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_MISSING_OPTIONAL)))
node->icon_texture_index = MUI_TEXTURE_INFO;
else if (strstr(path, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PRESENT_REQUIRED))
|| strstr(path, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PRESENT_OPTIONAL)))
node->icon_texture_index = MUI_TEXTURE_CHECKMARK;
else
node->icon_type = MUI_ICON_TYPE_NONE;
break;
case FILE_TYPE_RPL_ENTRY:
case MENU_SETTING_DROPDOWN_ITEM:
case MENU_SETTING_DROPDOWN_ITEM_RESOLUTION:
@ -10552,7 +10564,6 @@ static void materialui_list_insert(
case MENU_SETTING_DROPDOWN_SETTING_FLOAT_ITEM_SPECIAL:
case MENU_SETTING_DROPDOWN_SETTING_INT_ITEM_SPECIAL:
case MENU_SETTING_DROPDOWN_SETTING_UINT_ITEM_SPECIAL:
case MENU_SETTINGS_CORE_INFO_NONE:
case MENU_SETTING_ITEM_CORE_RESTORE_BACKUP:
case MENU_SETTING_ITEM_CORE_DELETE_BACKUP:
/* None of these entries have icons - catch them

View File

@ -1946,6 +1946,15 @@ static uintptr_t ozone_entries_icon_get_texture(
if (!string_is_equal(enum_path, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INFORMATION)))
return 0;
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_CORE];
case MENU_ENUM_LABEL_CORE_INFO_ENTRY:
if (strstr(enum_path, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_MISSING_REQUIRED)))
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_CLOSE];
else if (strstr(enum_path, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_MISSING_OPTIONAL)))
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INFO];
else if (strstr(enum_path, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PRESENT_REQUIRED))
|| strstr(enum_path, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PRESENT_OPTIONAL)))
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_CHECKMARK];
return 0;
case MENU_ENUM_LABEL_LOAD_CONTENT_LIST:
case MENU_ENUM_LABEL_SUBSYSTEM_SETTINGS:
case MENU_ENUM_LABEL_SCAN_FILE:

View File

@ -3214,6 +3214,15 @@ static uintptr_t xmb_icon_get_id(xmb_handle_t *xmb,
case MENU_ENUM_LABEL_QUICK_MENU_SHOW_SET_CORE_ASSOCIATION:
case MENU_ENUM_LABEL_CORE_INFORMATION:
return xmb->textures.list[XMB_TEXTURE_CORE];
case MENU_ENUM_LABEL_CORE_INFO_ENTRY:
if (strstr(enum_path, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_MISSING_REQUIRED)))
return xmb->textures.list[XMB_TEXTURE_CLOSE];
else if (strstr(enum_path, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_MISSING_OPTIONAL)))
return xmb->textures.list[XMB_TEXTURE_INFO];
else if (strstr(enum_path, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PRESENT_REQUIRED))
|| strstr(enum_path, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PRESENT_OPTIONAL)))
return xmb->textures.list[XMB_TEXTURE_CHECKMARK];
break;
case MENU_ENUM_LABEL_LOAD_CONTENT_LIST:
case MENU_ENUM_LABEL_SUBSYSTEM_SETTINGS:
case MENU_ENUM_LABEL_SCAN_FILE:

View File

@ -544,6 +544,7 @@ static int menu_displaylist_parse_core_info(
const char *savestate_support = NULL;
runloop_state_t *runloop_st = runloop_state_get_ptr();
bool kiosk_mode_enable = settings->bools.kiosk_mode_enable;
bool core_info_list_hide[64] = {false};
#if defined(HAVE_DYNAMIC)
enum menu_contentless_cores_display_type
contentless_display_type = (enum menu_contentless_cores_display_type)
@ -845,36 +846,53 @@ static int menu_displaylist_parse_core_info(
MENU_ENUM_LABEL_CORE_INFO_ENTRY, MENU_SETTINGS_CORE_INFO_NONE, 0, 0, NULL))
count++;
len = strlcpy(tmp, "(!) ", sizeof(tmp));
/* FIXME: This looks hacky and probably
* needs to be improved for good translation support. */
for (i = 0; i < core_info->firmware_count; i++)
{
if (!core_info->firmware[i].desc)
continue;
snprintf(tmp + len, sizeof(tmp) - len, "%s %s",
core_info->firmware[i].missing ?
(
core_info->firmware[i].optional
? missing_optional
: missing_required)
:
(
core_info->firmware[i].optional
? present_optional
: present_required),
core_info->firmware[i].desc ?
core_info->firmware[i].desc :
rdb_entry_name
);
snprintf(tmp, sizeof(tmp), "%s %s",
core_info->firmware[i].missing
? (core_info->firmware[i].optional ? missing_optional : missing_required)
: (core_info->firmware[i].optional ? present_optional : present_required),
core_info->firmware[i].desc ? core_info->firmware[i].desc : rdb_entry_name
);
if (menu_entries_append(list, tmp, "",
MENU_ENUM_LABEL_CORE_INFO_ENTRY,
MENU_SETTINGS_CORE_INFO_NONE, 0, 0, NULL))
count++;
/* Show relevant note row and skip showing it later */
if (core_info->notes)
{
unsigned pos;
unsigned j;
char firmware_basename[64];
strlcpy(firmware_basename, core_info->firmware[i].desc, sizeof(firmware_basename));
path_basename(firmware_basename);
firmware_basename[string_find_index_substring_string(firmware_basename, " ")] = '\0';
for (j = 0; j < core_info->note_list->size; j++)
{
if ( !strstr(core_info->note_list->elems[j].data, firmware_basename)
|| !strstr(core_info->note_list->elems[j].data, "(md5)"))
continue;
pos = string_find_index_substring_string(core_info->note_list->elems[j].data, "(md5)");
core_info_list_hide[j] = true;
len = strlcpy(tmp, "- ", sizeof(tmp));
strlcat(tmp, core_info->note_list->elems[j].data + pos, sizeof(tmp));
if (menu_entries_append(list, tmp, "",
MENU_ENUM_LABEL_CORE_INFO_ENTRY,
MENU_SETTINGS_CORE_INFO_NONE, 0, 0, NULL))
count++;
break;
}
}
}
}
}
@ -883,6 +901,9 @@ static int menu_displaylist_parse_core_info(
{
for (i = 0; i < core_info->note_list->size; i++)
{
if (core_info_list_hide[i])
continue;
strlcpy(tmp,
core_info->note_list->elems[i].data, sizeof(tmp));
if (menu_entries_append(list, tmp, "",