Some game config button cleanup on pause screen

This commit is contained in:
Henrik Rydgård
2025-12-25 13:32:38 +01:00
parent ae856c5d45
commit 2d39a88253
4 changed files with 29 additions and 15 deletions
+6
View File
@@ -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);
+19 -15
View File
@@ -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();
}
}
+2
View File
@@ -61,6 +61,8 @@ private:
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;
+2
View File
@@ -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++) {