More tweaking of gamelist icons

This commit is contained in:
Henrik Rydgård
2026-02-11 01:24:11 +01:00
parent 49e67975b4
commit 3ecb54e70a
3 changed files with 26 additions and 21 deletions
+18 -18
View File
@@ -294,8 +294,8 @@ void GameButton::Draw(UIContext &dc) {
ImageID imageIcon = ImageID::invalid();
bool drawBackground = true;
switch (ginfo->fileType) {
case IdentifiedFileType::PSP_ELF: imageIcon = ImageID("I_DEBUGGER"); drawBackground = false; break;
case IdentifiedFileType::UNKNOWN_ELF: imageIcon = ImageID("I_CROSS"); drawBackground = false; break;
case IdentifiedFileType::PSP_ELF: imageIcon = ImageID("I_APP"); drawBackground = false; break;
case IdentifiedFileType::UNKNOWN_ELF: imageIcon = ImageID("I_APP"); drawBackground = false; break;
case IdentifiedFileType::PPSSPP_GE_DUMP: imageIcon = ImageID("I_DISPLAY"); break;
case IdentifiedFileType::PSX_ISO:
case IdentifiedFileType::PSP_PS1_PBP: imageIcon = ImageID("I_PSX_ISO"); break;
@@ -309,6 +309,15 @@ void GameButton::Draw(UIContext &dc) {
default: break;
}
if (ginfo->Ready(GameInfoFlags::ICON)) {
if (ginfo->icon.texture && drawBackground) {
texture = ginfo->icon.texture;
} else if (drawBackground) {
// No icon, but drawBackground is set. Let's show a plain icon depending on type.
imageIcon = (ginfo->fileType == IdentifiedFileType::PSP_ISO || ginfo->fileType == IdentifiedFileType::PSP_ISO_NP) ? ImageID("I_UMD") : ImageID("I_APP");
}
}
Bounds overlayBounds = bounds_;
u32 overlayColor = 0;
if (holdEnabled_ && holdStart_ != 0.0) {
@@ -325,15 +334,6 @@ void GameButton::Draw(UIContext &dc) {
}
}
if (ginfo->Ready(GameInfoFlags::ICON)) {
if (ginfo->icon.texture && drawBackground) {
texture = ginfo->icon.texture;
} else if (drawBackground) {
// No icon, but drawBackground is set. Let's show a plain icon.
imageIcon = ImageID("I_APP");
}
}
int x = bounds_.x;
int y = bounds_.y;
int w = gridStyle_ ? bounds_.w : 144;
@@ -397,6 +397,13 @@ void GameButton::Draw(UIContext &dc) {
dc.Draw()->Flush();
}
if (gridStyle_ && g_Config.bShowIDOnGameIcon && ginfo->fileType != IdentifiedFileType::PSP_ELF && !ginfo->id_version.empty()) {
dc.SetFontScale(0.5f * g_Config.fGameGridScale, 0.5f * g_Config.fGameGridScale);
dc.DrawText(ginfo->id_version, bounds_.x + 5, y + 1, 0xFF000000, ALIGN_TOPLEFT);
dc.DrawText(ginfo->id_version, bounds_.x + 4, y, dc.GetTheme().infoStyle.fgColor, ALIGN_TOPLEFT);
dc.SetFontScale(1.0f, 1.0f);
}
if (imageIcon.isValid()) {
Style style = dc.GetTheme().itemStyle;
@@ -509,13 +516,6 @@ void GameButton::Draw(UIContext &dc) {
}
}
if (gridStyle_ && g_Config.bShowIDOnGameIcon) {
dc.SetFontScale(0.5f*g_Config.fGameGridScale, 0.5f*g_Config.fGameGridScale);
dc.DrawText(ginfo->id_version, bounds_.x+5, y+1, 0xFF000000, ALIGN_TOPLEFT);
dc.DrawText(ginfo->id_version, bounds_.x+4, y, dc.GetTheme().infoStyle.fgColor, ALIGN_TOPLEFT);
dc.SetFontScale(1.0f, 1.0f);
}
if (overlayColor) {
dc.FillRect(Drawable(overlayColor), overlayBounds);
}