From 339283979508505fe56a9bb0de1d122073f135b3 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Mon, 26 Oct 2020 01:02:09 +1000 Subject: [PATCH] libretro: Add option to hide OSD messages --- src/duckstation-libretro/libretro_host_interface.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/duckstation-libretro/libretro_host_interface.cpp b/src/duckstation-libretro/libretro_host_interface.cpp index 57ad9a4b1..5d956de70 100644 --- a/src/duckstation-libretro/libretro_host_interface.cpp +++ b/src/duckstation-libretro/libretro_host_interface.cpp @@ -200,6 +200,9 @@ std::string LibretroHostInterface::GetStringSettingValue(const char* section, co void LibretroHostInterface::AddOSDMessage(std::string message, float duration /*= 2.0f*/) { + if (!g_settings.display_show_osd_messages) + return; + retro_message msg = {}; msg.msg = message.c_str(); msg.frames = static_cast(duration * (System::IsShutdown() ? 60.0f : System::GetThrottleFrequency())); @@ -445,7 +448,7 @@ void LibretroHostInterface::OnSystemDestroyed() m_using_hardware_renderer = false; } -static std::array s_option_definitions = {{ +static std::array s_option_definitions = {{ {"duckstation_Console.Region", "Console Region", "Determines which region/hardware to emulate. Auto-Detect will use the region of the disc inserted.", @@ -690,6 +693,11 @@ static std::array s_option_definitions = {{ "Automatically enables analog mode in supported controllers at start/reset.", {{"true", "Enabled"}, {"false", "Disabled"}}, "false"}, + {"duckstation_Display.ShowOSDMessages", + "Display OSD Messages", + "Shows on-screen messages generated by the core.", + {{"true", "Enabled"}, {"false", "Disabled"}}, + "true"}, {"duckstation_Logging.LogLevel", "Log Level", "Sets the level of information logged by the core.",