diff --git a/Core/Config.cpp b/Core/Config.cpp index 8825c19fee..bda012a46f 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -1284,6 +1284,15 @@ void Config::ReadAllSettings(const IniFile &iniFile) { } } +std::string Config::GetConfigAsString() { + Config::Save("beforecopy"); + std::string temp; + if (File::ReadTextFileToString(iniFilename_, &temp)) { + return temp; + } + return ""; +} + void Config::Load(const char *iniFileName, const char *controllerIniFilename) { double startTime = time_now_d(); diff --git a/Core/Config.h b/Core/Config.h index 5d6c20261d..74e31bee01 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -685,6 +685,9 @@ public: void Reload(); void RestoreDefaults(RestoreSettingsBits whatToRestore, bool log = false); + // For bug reporting + std::string GetConfigAsString(); + // Note: This doesn't switch to the config, just creates it. bool CreateGameConfig(std::string_view gameId); bool DeleteGameConfig(std::string_view gameId); diff --git a/Core/RetroAchievements.cpp b/Core/RetroAchievements.cpp index 9b3e76a41e..09c1a628a7 100644 --- a/Core/RetroAchievements.cpp +++ b/Core/RetroAchievements.cpp @@ -623,8 +623,14 @@ static void load_integration_callback(int result, const char *error_message, rc_ void Initialize() { if (!g_Config.bAchievementsEnable) { - _dbg_assert_(!g_rcClient); INFO_LOG(Log::Achievements, "Achievements are disabled, not initializing."); + if (g_rcClient) { +#ifdef RC_CLIENT_SUPPORTS_RAINTEGRATION + rc_client_unload_raintegration(g_rcClient); +#endif + rc_client_destroy(g_rcClient); + g_rcClient = nullptr; + } return; } if (g_rcClient) { diff --git a/UI/DeveloperToolsScreen.cpp b/UI/DeveloperToolsScreen.cpp index edfc395307..34e5c06b20 100644 --- a/UI/DeveloperToolsScreen.cpp +++ b/UI/DeveloperToolsScreen.cpp @@ -206,6 +206,17 @@ void DeveloperToolsScreen::CreateGeneralTab(UI::LinearLayout *list) { #if PPSSPP_PLATFORM(IOS) list->Add(new Choice(dev->T("Copy savestates to memstick root")))->OnClick.Handle(this, &DeveloperToolsScreen::OnCopyStatesToRoot); #endif + + auto di = GetI18NCategory(I18NCat::DIALOG); + // Reuse strings to the max, heh. + list->Add(new Choice(ApplySafeSubstitutions("%1: ppsspp.ini", di->T("Copy to clipboard"))))->OnClick.Add([=](UI::EventParams &) { + auto di = GetI18NCategory(I18NCat::DIALOG); + std::string configStr = g_Config.GetConfigAsString(); + if (!configStr.empty()) { + System_CopyStringToClipboard(configStr); + g_OSD.Show(OSDType::MESSAGE_INFO, ApplySafeSubstitutions(di->T("Copied to clipboard: %1"), "ppsspp.ini"), 1.0f); + } + }); } void DeveloperToolsScreen::CreateTestsTab(UI::LinearLayout *list) {