mirror of
https://github.com/libretro/RetroArch
synced 2025-02-05 06:40:07 +00:00
Add 'Hide Overlay In Menu' option
This commit is contained in:
parent
46cdc34b9b
commit
4cb5d57ede
@ -485,6 +485,8 @@ static bool config_save_on_exit = true;
|
||||
|
||||
static const bool default_overlay_enable = false;
|
||||
|
||||
static const bool overlay_hide_in_menu = true;
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
static bool default_block_config_read = true;
|
||||
|
||||
|
@ -1566,6 +1566,7 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
config_get_path(conf, "input_overlay", settings->input.overlay, sizeof(settings->input.overlay));
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, input.overlay_enable, "input_overlay_enable");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, input.overlay_enable_autopreferred, "input_overlay_enable_autopreferred");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, input.overlay_hide_in_menu, "input_overlay_hide_in_menu");
|
||||
CONFIG_GET_FLOAT_BASE(conf, settings, input.overlay_opacity, "input_overlay_opacity");
|
||||
CONFIG_GET_FLOAT_BASE(conf, settings, input.overlay_scale, "input_overlay_scale");
|
||||
|
||||
@ -2573,6 +2574,7 @@ bool config_save_file(const char *path)
|
||||
config_set_path(conf, "input_overlay", settings->input.overlay);
|
||||
config_set_bool(conf, "input_overlay_enable", settings->input.overlay_enable);
|
||||
config_set_bool(conf, "input_overlay_enable_autopreferred", settings->input.overlay_enable_autopreferred);
|
||||
config_set_bool(conf, "input_overlay_hide_in_menu", settings->input.overlay_hide_in_menu);
|
||||
config_set_float(conf, "input_overlay_opacity",
|
||||
settings->input.overlay_opacity);
|
||||
config_set_float(conf, "input_overlay_scale",
|
||||
|
@ -231,6 +231,7 @@ typedef struct settings
|
||||
|
||||
bool overlay_enable;
|
||||
bool overlay_enable_autopreferred;
|
||||
bool overlay_hide_in_menu;
|
||||
char overlay[PATH_MAX_LENGTH];
|
||||
float overlay_opacity;
|
||||
float overlay_scale;
|
||||
|
@ -26,6 +26,8 @@ static const char *menu_hash_to_str_us_label(uint32_t hash)
|
||||
{
|
||||
switch (hash)
|
||||
{
|
||||
case MENU_LABEL_INPUT_OVERLAY_HIDE_IN_MENU:
|
||||
return "overlay_hide_in_menu";
|
||||
case MENU_LABEL_NO_PLAYLIST_ENTRIES_AVAILABLE:
|
||||
return "no_playlist_entries_available";
|
||||
case MENU_LABEL_DOWNLOADED_FILE_DETECT_CORE_LIST:
|
||||
@ -614,6 +616,8 @@ const char *menu_hash_to_str_us(uint32_t hash)
|
||||
|
||||
switch (hash)
|
||||
{
|
||||
case MENU_LABEL_VALUE_INPUT_OVERLAY_HIDE_IN_MENU:
|
||||
return "Hide Overlay In Menu";
|
||||
case MENU_VALUE_LANG_POLISH:
|
||||
return "Polish";
|
||||
case MENU_LABEL_VALUE_OVERLAY_AUTOLOAD_PREFERRED:
|
||||
|
@ -22,6 +22,9 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define MENU_LABEL_INPUT_OVERLAY_HIDE_IN_MENU 0xf09e230aU
|
||||
#define MENU_LABEL_VALUE_INPUT_OVERLAY_HIDE_IN_MENU 0x39b5bd0dU
|
||||
|
||||
#define MENU_LABEL_VALUE_DOWNLOADED_FILE_DETECT_CORE_LIST 0x39310fc8U
|
||||
#define MENU_LABEL_DOWNLOADED_FILE_DETECT_CORE_LIST 0xb4f82700U
|
||||
|
||||
|
@ -2474,11 +2474,18 @@ static void settings_data_list_current_add_flags(
|
||||
|
||||
static void overlay_enable_toggle_change_handler(void *data)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
rarch_setting_t *setting = (rarch_setting_t *)data;
|
||||
|
||||
if (!setting)
|
||||
return;
|
||||
|
||||
if (settings && settings->input.overlay_hide_in_menu)
|
||||
{
|
||||
event_command(EVENT_CMD_OVERLAY_DEINIT);
|
||||
return;
|
||||
}
|
||||
|
||||
if (setting->value.boolean)
|
||||
event_command(EVENT_CMD_OVERLAY_INIT);
|
||||
else
|
||||
@ -4542,7 +4549,7 @@ static bool setting_append_list_overlay_options(
|
||||
(*list)[list_info->index - 1].change_handler = overlay_enable_toggle_change_handler;
|
||||
|
||||
CONFIG_BOOL(
|
||||
settings->input.overlay_enable,
|
||||
settings->input.overlay_enable_autopreferred,
|
||||
menu_hash_to_str(MENU_LABEL_OVERLAY_AUTOLOAD_PREFERRED),
|
||||
menu_hash_to_str(MENU_LABEL_VALUE_OVERLAY_AUTOLOAD_PREFERRED),
|
||||
true,
|
||||
@ -4555,6 +4562,20 @@ static bool setting_append_list_overlay_options(
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].change_handler = overlay_enable_toggle_change_handler;
|
||||
|
||||
CONFIG_BOOL(
|
||||
settings->input.overlay_hide_in_menu,
|
||||
menu_hash_to_str(MENU_LABEL_INPUT_OVERLAY_HIDE_IN_MENU),
|
||||
menu_hash_to_str(MENU_LABEL_VALUE_INPUT_OVERLAY_HIDE_IN_MENU),
|
||||
overlay_hide_in_menu,
|
||||
menu_hash_to_str(MENU_VALUE_OFF),
|
||||
menu_hash_to_str(MENU_VALUE_ON),
|
||||
group_info.name,
|
||||
subgroup_info.name,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].change_handler = overlay_enable_toggle_change_handler;
|
||||
|
||||
CONFIG_BOOL(
|
||||
settings->osk.enable,
|
||||
menu_hash_to_str(MENU_LABEL_INPUT_OSK_OVERLAY_ENABLE),
|
||||
|
@ -304,6 +304,8 @@
|
||||
# Enable or disable the current overlay.
|
||||
# input_overlay_enable = true
|
||||
|
||||
# Hide the current overlay from appearing in menu screens.
|
||||
# input_overlay_hide_in_menu = true
|
||||
|
||||
# Path to input overlay
|
||||
# input_overlay =
|
||||
|
16
runloop.c
16
runloop.c
@ -430,23 +430,23 @@ static void check_shader_dir(bool pressed_next, bool pressed_prev)
|
||||
static void do_state_check_menu_toggle(void)
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (menu_driver_alive())
|
||||
{
|
||||
if (global->main_is_init && (global->core_type != CORE_TYPE_DUMMY))
|
||||
{
|
||||
rarch_main_set_state(RARCH_ACTION_STATE_MENU_RUNNING_FINISHED);
|
||||
#if 0
|
||||
event_command(EVENT_CMD_OVERLAY_INIT);
|
||||
#endif
|
||||
if (settings->input.overlay_hide_in_menu)
|
||||
event_command(EVENT_CMD_OVERLAY_INIT);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
rarch_main_set_state(RARCH_ACTION_STATE_MENU_RUNNING);
|
||||
#if 0
|
||||
event_command(EVENT_CMD_OVERLAY_DEINIT);
|
||||
#endif
|
||||
|
||||
if (settings->input.overlay_hide_in_menu)
|
||||
event_command(EVENT_CMD_OVERLAY_DEINIT);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -873,6 +873,7 @@ static void rarch_main_iterate_linefeed_overlay(void)
|
||||
{
|
||||
static char prev_overlay_restore = false;
|
||||
driver_t *driver = driver_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (driver->osk_enable && !driver->keyboard_linefeed_enable)
|
||||
{
|
||||
@ -890,7 +891,8 @@ static void rarch_main_iterate_linefeed_overlay(void)
|
||||
}
|
||||
else if (prev_overlay_restore)
|
||||
{
|
||||
event_command(EVENT_CMD_OVERLAY_INIT);
|
||||
if (!settings->input.overlay_hide_in_menu)
|
||||
event_command(EVENT_CMD_OVERLAY_INIT);
|
||||
prev_overlay_restore = false;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user