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..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))); @@ -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..49f17ac6c5a0 100644 --- a/UI/SystemInfoScreen.cpp +++ b/UI/SystemInfoScreen.cpp @@ -410,17 +410,19 @@ 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++) { 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"), "")); } }