diff --git a/Common/System/OSD.cpp b/Common/System/OSD.cpp index f293a61849..6ce7500f9b 100644 --- a/Common/System/OSD.cpp +++ b/Common/System/OSD.cpp @@ -129,6 +129,16 @@ void OnScreenDisplay::Show(OSDType type, std::string_view text, std::string_view entries_.insert(entries_.begin(), msg); } +void OnScreenDisplay::CancelById(std::string_view id) { + for (auto iter = entries_.begin(); iter != entries_.end();) { + if (iter->id == id) { + iter = entries_.erase(iter); + } else { + iter++; + } + } +} + void OnScreenDisplay::ShowOnOff(std::string_view message, bool on, float duration_s) { std::string msg(message); msg += ": "; diff --git a/Common/System/OSD.h b/Common/System/OSD.h index 36e871c373..dd520a9949 100644 --- a/Common/System/OSD.h +++ b/Common/System/OSD.h @@ -61,6 +61,7 @@ public: void Show(OSDType type, std::string_view text, std::string_view text2, std::string_view icon, float duration_s = 0.0f, const char *id = nullptr); void ShowOnOff(std::string_view message, bool on, float duration_s = 0.0f); + void CancelById(std::string_view id); bool IsEmpty() const { return entries_.empty(); } // Shortcut to skip rendering. diff --git a/Core/System.cpp b/Core/System.cpp index 58be4adb24..f120df9d9c 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -252,17 +252,23 @@ static void ShowCompatWarnings(const Compatibility &compat) { // UI changes are best done after PSP_InitStart. if (compat.flags().RequireBufferedRendering && g_Config.bSkipBufferEffects && !g_Config.bSoftwareRendering) { auto gr = GetI18NCategory(I18NCat::GRAPHICS); - g_OSD.Show(OSDType::MESSAGE_WARNING, gr->T("BufferedRenderingRequired", "Warning: This game requires Rendering Mode to be set to Buffered."), 10.0f); + g_OSD.Show(OSDType::MESSAGE_WARNING, gr->T("BufferedRenderingRequired", "Warning: This game requires Rendering Mode to be set to Buffered."), 10.0f, "bufreq"); + } else { + g_OSD.CancelById("bufreq"); } if (compat.flags().RequireBlockTransfer && g_Config.iSkipGPUReadbackMode != (int)SkipGPUReadbackMode::NO_SKIP && !PSP_CoreParameter().compat.flags().ForceEnableGPUReadback) { auto gr = GetI18NCategory(I18NCat::GRAPHICS); - g_OSD.Show(OSDType::MESSAGE_WARNING, gr->T("BlockTransferRequired", "Warning: This game requires Skip GPU Readbacks be set to No."), 10.0f); + g_OSD.Show(OSDType::MESSAGE_WARNING, gr->T("BlockTransferRequired", "Warning: This game requires Skip GPU Readbacks be set to No."), 10.0f, "blockxfer"); + } else { + g_OSD.CancelById("blockxfer"); } if (compat.flags().RequireDefaultCPUClock && g_Config.iLockedCPUSpeed != 0) { auto gr = GetI18NCategory(I18NCat::GRAPHICS); - g_OSD.Show(OSDType::MESSAGE_WARNING, gr->T("DefaultCPUClockRequired", "Warning: This game requires the CPU clock to be set to default."), 10.0f); + g_OSD.Show(OSDType::MESSAGE_WARNING, gr->T("DefaultCPUClockRequired", "Warning: This game requires the CPU clock to be set to default."), 10.0f, "defaultclock"); + } else { + g_OSD.CancelById("defaultclock"); } } diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 305aff1001..09f9e54167 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -286,7 +286,7 @@ void EmuScreen::ProcessGameBoot(const Path &filename) { g_OSD.Show(OSDType::MESSAGE_WARNING, "Shader cache is disabled (developer)"); } - if (g_Config.bTiltInputEnabled && g_Config.iTiltInputType != 0) { + if (g_Config.bTiltInputEnabled && g_Config.iTiltInputType != 0 && System_GetPropertyBool(SYSPROP_HAS_ACCELEROMETER)) { auto co = GetI18NCategory(I18NCat::CONTROLS); auto di = GetI18NCategory(I18NCat::DIALOG); g_OSD.Show(OSDType::MESSAGE_INFO, ApplySafeSubstitutions("%1: %2", co->T("Tilt control"), di->T("Enabled")), "", "I_CONTROLLER", 2.5f, "tilt");