From 2d39a882533df8e366d16e826bccb68fecbdc41a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 25 Dec 2025 13:32:38 +0100 Subject: [PATCH 1/3] Some game config button cleanup on pause screen --- Core/Config.cpp | 6 ++++++ UI/PauseScreen.cpp | 34 +++++++++++++++++++--------------- UI/PauseScreen.h | 2 ++ UI/SystemInfoScreen.cpp | 2 ++ 4 files changed, 29 insertions(+), 15 deletions(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index 6dc513aa8c5c..3461b3156e24 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -1580,12 +1580,18 @@ void Config::RestoreDefaults(RestoreSettingsBits whatToRestore, bool log) { } bool Config::HasGameConfig(std::string_view gameId) { + if (gameId.empty()) { + return false; + } bool exists = false; Path fullIniFilePath = GetGameConfigFilePath(searchPath_, gameId, &exists); return exists; } bool Config::CreateGameConfig(std::string_view gameId) { + if (gameId.empty()) { + return false; + } bool exists; Path fullIniFilePath = GetGameConfigFilePath(searchPath_, gameId, &exists); diff --git a/UI/PauseScreen.cpp b/UI/PauseScreen.cpp index 736c7882d3d1..3c9dfad6fcd3 100644 --- a/UI/PauseScreen.cpp +++ b/UI/PauseScreen.cpp @@ -571,6 +571,12 @@ void GamePauseScreen::CreateViews() { if (g_paramSFO.IsValid() && g_Config.HasGameConfig(g_paramSFO.GetDiscID())) { rightColumnItems->Add(new Choice(pa->T("Game Settings"), ImageID("I_GEAR")))->OnClick.Handle(this, &GamePauseScreen::OnGameSettings); + auto pa = GetI18NCategory(I18NCat::PAUSE); + if (g_Config.HasGameConfig(g_paramSFO.GetValueString("DISC_ID"))) { + Choice *delGameConfig = rightColumnItems->Add(new Choice(pa->T("Delete Game Config"))); + delGameConfig->OnClick.Handle(this, &GamePauseScreen::OnDeleteConfig); + delGameConfig->SetEnabled(!bootPending_); + } } else if (PSP_CoreParameter().fileType != IdentifiedFileType::PPSSPP_GE_DUMP) { rightColumnItems->Add(new Choice(pa->T("Settings"), ImageID("I_GEAR")))->OnClick.Handle(this, &GamePauseScreen::OnGameSettings); Choice *createGameConfig = rightColumnItems->Add(new Choice(pa->T("Create Game Config"), ImageID("I_GEAR_STAR"))); @@ -601,9 +607,8 @@ void GamePauseScreen::CreateViews() { // TODO, also might be nice to show overall compat rating here? // Based on their platform or even cpu/gpu/config. Would add an API for it. - if (!portrait && Reporting::IsSupported() && g_paramSFO.GetValueString("DISC_ID").size()) { - auto rp = GetI18NCategory(I18NCat::REPORTING); - rightColumnItems->Add(new Choice(rp->T("ReportButton", "Report Feedback")))->OnClick.Handle(this, &GamePauseScreen::OnReportFeedback); + if (!portrait) { + AddExtraOptions(rightColumnItems); } rightColumnItems->Add(new Spacer(20.0)); Choice *exit; @@ -680,23 +685,22 @@ void GamePauseScreen::ShowContextMenu(UI::View *menuButton, bool portrait) { } }); - auto pa = GetI18NCategory(I18NCat::PAUSE); - - Choice *delGameConfig = parent->Add(new Choice(pa->T("Delete Game Config"))); - delGameConfig->OnClick.Handle(this, &GamePauseScreen::OnDeleteConfig); - delGameConfig->SetEnabled(!bootPending_); - if (portrait) { - // Add some other options that are removed from the main screen in portrait mode. - if (Reporting::IsSupported() && g_paramSFO.GetValueString("DISC_ID").size()) { - auto rp = GetI18NCategory(I18NCat::REPORTING); - parent->Add(new Choice(rp->T("ReportButton", "Report Feedback")))->OnClick.Handle(this, &GamePauseScreen::OnReportFeedback); - } + AddExtraOptions(parent); } }, menuButton); screenManager()->push(contextMenu); } +void GamePauseScreen::AddExtraOptions(UI::ViewGroup *parent) { + using namespace UI; + // Add some other options that are removed from the main screen in portrait mode. + if (Reporting::IsSupported() && g_paramSFO.GetValueString("DISC_ID").size()) { + auto rp = GetI18NCategory(I18NCat::REPORTING); + parent->Add(new Choice(rp->T("ReportButton", "Report Feedback")))->OnClick.Handle(this, &GamePauseScreen::OnReportFeedback); + } +} + void GamePauseScreen::OnGameSettings(UI::EventParams &e) { screenManager()->push(new GameSettingsScreen(gamePath_)); } @@ -829,7 +833,7 @@ void GamePauseScreen::OnCreateConfig(UI::EventParams &e) { if (info) { info->hasConfig = true; } - screenManager()->topScreen()->RecreateViews(); + RecreateViews(); } } diff --git a/UI/PauseScreen.h b/UI/PauseScreen.h index ebcb992dfdc0..27039c059685 100644 --- a/UI/PauseScreen.h +++ b/UI/PauseScreen.h @@ -61,6 +61,8 @@ class GamePauseScreen : public UIBaseDialogScreen { void OnState(UI::EventParams &e); void ShowContextMenu(UI::View *menuButton, bool portrait); + void AddExtraOptions(UI::ViewGroup *parent); + // hack bool finishNextFrame_ = false; DialogResult finishNextFrameResult_ = DR_CANCEL; diff --git a/UI/SystemInfoScreen.cpp b/UI/SystemInfoScreen.cpp index 50c8080b4de2..211023497bda 100644 --- a/UI/SystemInfoScreen.cpp +++ b/UI/SystemInfoScreen.cpp @@ -410,6 +410,8 @@ void SystemInfoScreen::CreateDriverBugsTab(UI::LinearLayout *driverBugs) { auto si = GetI18NCategory(I18NCat::SYSINFO); + driverBugs->Add(new ItemHeader(si->T("Driver bugs"))); + bool anyDriverBugs = false; Draw::DrawContext *draw = screenManager()->getDrawContext(); for (int i = 0; i < (int)draw->GetBugs().MaxBugIndex(); i++) { From 09523ba7b76ea55dc34277b4d16120ca9a9b7a05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 29 Dec 2025 11:51:20 +0100 Subject: [PATCH 2/3] Fix UI layout issue on driver bugs list --- UI/SystemInfoScreen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UI/SystemInfoScreen.cpp b/UI/SystemInfoScreen.cpp index 211023497bda..49f17ac6c5a0 100644 --- a/UI/SystemInfoScreen.cpp +++ b/UI/SystemInfoScreen.cpp @@ -417,12 +417,12 @@ void SystemInfoScreen::CreateDriverBugsTab(UI::LinearLayout *driverBugs) { for (int i = 0; i < (int)draw->GetBugs().MaxBugIndex(); i++) { if (draw->GetBugs().Has(i)) { anyDriverBugs = true; - driverBugs->Add(new InfoItem(draw->GetBugs().GetBugName(i), "", new LayoutParams(FILL_PARENT, WRAP_CONTENT))); + driverBugs->Add(new InfoItem(draw->GetBugs().GetBugName(i), "")); } } if (!anyDriverBugs) { - driverBugs->Add(new InfoItem(si->T("No GPU driver bugs detected"), "", new LayoutParams(FILL_PARENT, WRAP_CONTENT))); + driverBugs->Add(new InfoItem(si->T("No GPU driver bugs detected"), "")); } } From 5756a5bc874cd939b156f9e81157d53c05b93ac8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 29 Dec 2025 12:03:04 +0100 Subject: [PATCH 3/3] Fix layout issue that will happen when we increase the number of save state slots. See issue #21082 --- UI/PauseScreen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UI/PauseScreen.cpp b/UI/PauseScreen.cpp index 3c9dfad6fcd3..714eb3f5e851 100644 --- a/UI/PauseScreen.cpp +++ b/UI/PauseScreen.cpp @@ -232,7 +232,7 @@ SaveSlotView::SaveSlotView(const Path &gameFilename, int slot, UI::LayoutParams std::string number = StringFromFormat("%d", slot + 1); Add(new Spacer(5)); - Add(new TextView(number, new LinearLayoutParams(WRAP_CONTENT, WRAP_CONTENT, 0.0f, Gravity::G_VCENTER)))->SetBig(true); + Add(new TextView(number, new LinearLayoutParams(40.0f, WRAP_CONTENT, 0.0f, Gravity::G_VCENTER)))->SetBig(true); AsyncImageFileView *fv = Add(new AsyncImageFileView(screenshotFilename_, IS_DEFAULT, new UI::LayoutParams(82 * 2, 47 * 2)));