Add Ability to Hide OSD Messages
Some checks failed
Crowdin Source Texts Upload / upload_source_file (push) Has been cancelled
Crowdin Translation Integration / create_intl_file (push) Has been cancelled

This commit is contained in:
DarthMew 2024-10-07 00:24:46 +02:00
parent 261e52b7dd
commit 349bc50e55
2 changed files with 48 additions and 19 deletions

View File

@ -86,6 +86,7 @@ static retro_input_state_t input_state_cb;
static unsigned frame_count = 0;
static unsigned internal_frame_count = 0;
static bool display_internal_framerate = false;
static bool display_notifications = true;
static bool allow_frame_duping = false;
static bool failed_init = false;
static unsigned image_offset = 0;
@ -3986,6 +3987,17 @@ static void check_variables(bool startup)
else
display_internal_framerate = false;
var.key = BEETLE_OPT(display_osd);
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
if (strcmp(var.value, "enabled") == 0)
display_notifications = true;
else if (strcmp(var.value, "disabled") == 0)
display_notifications = false;
}
else
display_notifications = true;
var.key = BEETLE_OPT(crop_overscan);
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
@ -5292,6 +5304,8 @@ void MDFND_DispMessage(
enum retro_message_target target, enum retro_message_type type,
const char *str)
{
if (display_notifications)
{
if (libretro_msg_interface_version >= 1)
{
struct retro_message_ext msg = {
@ -5314,6 +5328,7 @@ void MDFND_DispMessage(
};
environ_cb(RETRO_ENVIRONMENT_SET_MESSAGE, &msg);
}
}
}
void MDFN_DispMessage(

View File

@ -352,6 +352,20 @@ struct retro_core_option_v2_definition option_defs_us[] = {
},
"disabled"
},
{
BEETLE_OPT(display_osd),
"Display OSD Messages",
NULL,
"Display OSD messages generated by the core.",
NULL,
"osd",
{
{ "enabled", NULL },
{ "disabled", NULL },
{ NULL, NULL },
},
"enabled"
},
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES) || defined(HAVE_VULKAN)
{
BEETLE_OPT(display_vram),