Skip to content

Commit

Permalink
Add visibility option for disc control notifications (#16292)
Browse files Browse the repository at this point in the history
  • Loading branch information
sonninnos authored Feb 26, 2024
1 parent fa3c685 commit 59381b7
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config.def.h
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,9 @@
* at launch the last used disk of multi-disk content */
#define DEFAULT_NOTIFICATION_SHOW_SET_INITIAL_DISK true

/* Display disc control notifications */
#define DEFAULT_NOTIFICATION_SHOW_DISK_CONTROL true

/* Display save state notifications */
#define DEFAULT_NOTIFICATION_SHOW_SAVE_STATE true

Expand Down
1 change: 1 addition & 0 deletions configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -1851,6 +1851,7 @@ static struct config_bool_setting *populate_settings_bool(
SETTING_BOOL("notification_show_remap_load", &settings->bools.notification_show_remap_load, true, DEFAULT_NOTIFICATION_SHOW_REMAP_LOAD, false);
SETTING_BOOL("notification_show_config_override_load", &settings->bools.notification_show_config_override_load, true, DEFAULT_NOTIFICATION_SHOW_CONFIG_OVERRIDE_LOAD, false);
SETTING_BOOL("notification_show_set_initial_disk", &settings->bools.notification_show_set_initial_disk, true, DEFAULT_NOTIFICATION_SHOW_SET_INITIAL_DISK, false);
SETTING_BOOL("notification_show_disk_control", &settings->bools.notification_show_disk_control, true, DEFAULT_NOTIFICATION_SHOW_DISK_CONTROL, false);
SETTING_BOOL("notification_show_save_state", &settings->bools.notification_show_save_state, true, DEFAULT_NOTIFICATION_SHOW_SAVE_STATE, false);
SETTING_BOOL("notification_show_fast_forward", &settings->bools.notification_show_fast_forward, true, DEFAULT_NOTIFICATION_SHOW_FAST_FORWARD, false);
#ifdef HAVE_SCREENSHOTS
Expand Down
1 change: 1 addition & 0 deletions configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,7 @@ typedef struct settings
bool notification_show_remap_load;
bool notification_show_config_override_load;
bool notification_show_set_initial_disk;
bool notification_show_disk_control;
bool notification_show_save_state;
bool notification_show_fast_forward;
#ifdef HAVE_SCREENSHOTS
Expand Down
4 changes: 4 additions & 0 deletions intl/msg_hash_lbl.h
Original file line number Diff line number Diff line change
Expand Up @@ -6065,6 +6065,10 @@ MSG_HASH(
MENU_ENUM_LABEL_NOTIFICATION_SHOW_SET_INITIAL_DISK,
"notification_show_set_initial_disk"
)
MSG_HASH(
MENU_ENUM_LABEL_NOTIFICATION_SHOW_DISK_CONTROL,
"notification_show_disk_control"
)
MSG_HASH(
MENU_ENUM_LABEL_NOTIFICATION_SHOW_SAVE_STATE,
"notification_show_save_state"
Expand Down
8 changes: 8 additions & 0 deletions intl/msg_hash_us.h
Original file line number Diff line number Diff line change
Expand Up @@ -5603,6 +5603,14 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_NOTIFICATION_SHOW_SET_INITIAL_DISK,
"Display an on-screen message when automatically restoring at launch the last used disc of multi-disc content loaded via M3U playlists."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_NOTIFICATION_SHOW_DISK_CONTROL,
"Disc Control Notifications"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_NOTIFICATION_SHOW_DISK_CONTROL,
"Display an on-screen message when inserting and ejecting discs."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_NOTIFICATION_SHOW_SAVE_STATE,
"Save State Notifications"
Expand Down
4 changes: 4 additions & 0 deletions menu/cbs/menu_cbs_sublabel.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_notification_show_patch_applied, M
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_notification_show_remap_load, MENU_ENUM_SUBLABEL_NOTIFICATION_SHOW_REMAP_LOAD)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_notification_show_config_override_load, MENU_ENUM_SUBLABEL_NOTIFICATION_SHOW_CONFIG_OVERRIDE_LOAD)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_notification_show_set_initial_disk, MENU_ENUM_SUBLABEL_NOTIFICATION_SHOW_SET_INITIAL_DISK)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_notification_show_disk_control, MENU_ENUM_SUBLABEL_NOTIFICATION_SHOW_DISK_CONTROL)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_notification_show_save_state, MENU_ENUM_SUBLABEL_NOTIFICATION_SHOW_SAVE_STATE)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_notification_show_fast_forward, MENU_ENUM_SUBLABEL_NOTIFICATION_SHOW_FAST_FORWARD)
#ifdef HAVE_SCREENSHOTS
Expand Down Expand Up @@ -4282,6 +4283,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_NOTIFICATION_SHOW_SET_INITIAL_DISK:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_notification_show_set_initial_disk);
break;
case MENU_ENUM_LABEL_NOTIFICATION_SHOW_DISK_CONTROL:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_notification_show_disk_control);
break;
case MENU_ENUM_LABEL_NOTIFICATION_SHOW_SAVE_STATE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_notification_show_save_state);
break;
Expand Down
1 change: 1 addition & 0 deletions menu/menu_displaylist.c
Original file line number Diff line number Diff line change
Expand Up @@ -10160,6 +10160,7 @@ unsigned menu_displaylist_build_list(
{MENU_ENUM_LABEL_NOTIFICATION_SHOW_REMAP_LOAD, PARSE_ONLY_BOOL, false },
{MENU_ENUM_LABEL_NOTIFICATION_SHOW_CONFIG_OVERRIDE_LOAD, PARSE_ONLY_BOOL, false },
{MENU_ENUM_LABEL_NOTIFICATION_SHOW_SET_INITIAL_DISK, PARSE_ONLY_BOOL, false },
{MENU_ENUM_LABEL_NOTIFICATION_SHOW_DISK_CONTROL, PARSE_ONLY_BOOL, false },
{MENU_ENUM_LABEL_NOTIFICATION_SHOW_SAVE_STATE, PARSE_ONLY_BOOL, false },
{MENU_ENUM_LABEL_NOTIFICATION_SHOW_FAST_FORWARD, PARSE_ONLY_BOOL, false },
{MENU_ENUM_LABEL_NOTIFICATION_SHOW_REFRESH_RATE, PARSE_ONLY_BOOL, false },
Expand Down
15 changes: 15 additions & 0 deletions menu/menu_setting.c
Original file line number Diff line number Diff line change
Expand Up @@ -16555,6 +16555,21 @@ static bool setting_append_list(
general_read_handler,
SD_FLAG_NONE);

CONFIG_BOOL(
list, list_info,
&settings->bools.notification_show_disk_control,
MENU_ENUM_LABEL_NOTIFICATION_SHOW_DISK_CONTROL,
MENU_ENUM_LABEL_VALUE_NOTIFICATION_SHOW_DISK_CONTROL,
DEFAULT_NOTIFICATION_SHOW_DISK_CONTROL,
MENU_ENUM_LABEL_VALUE_OFF,
MENU_ENUM_LABEL_VALUE_ON,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler,
SD_FLAG_NONE);

CONFIG_BOOL(
list, list_info,
&settings->bools.notification_show_save_state,
Expand Down
1 change: 1 addition & 0 deletions msg_hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -3735,6 +3735,7 @@ enum msg_hash_enums
MENU_LABEL(NOTIFICATION_SHOW_REMAP_LOAD),
MENU_LABEL(NOTIFICATION_SHOW_CONFIG_OVERRIDE_LOAD),
MENU_LABEL(NOTIFICATION_SHOW_SET_INITIAL_DISK),
MENU_LABEL(NOTIFICATION_SHOW_DISK_CONTROL),
MENU_LABEL(NOTIFICATION_SHOW_SAVE_STATE),
MENU_LABEL(NOTIFICATION_SHOW_FAST_FORWARD),
MENU_LABEL(NOTIFICATION_SHOW_SCREENSHOT),
Expand Down
9 changes: 9 additions & 0 deletions retroarch.c
Original file line number Diff line number Diff line change
Expand Up @@ -4981,6 +4981,9 @@ bool command_event(enum event_command cmd, void *data)
if (show_msg)
verbose = *show_msg;

if (!settings->bools.notification_show_disk_control)
verbose = false;

disk_control_set_eject_state(
&sys_info->disk_control, eject, verbose);

Expand Down Expand Up @@ -5013,6 +5016,9 @@ bool command_event(enum event_command cmd, void *data)
if (show_msg)
verbose = *show_msg;

if (!settings->bools.notification_show_disk_control)
verbose = false;

disk_control_set_index_next(&sys_info->disk_control, verbose);
}
else
Expand All @@ -5037,6 +5043,9 @@ bool command_event(enum event_command cmd, void *data)
if (show_msg)
verbose = *show_msg;

if (!settings->bools.notification_show_disk_control)
verbose = false;

disk_control_set_index_prev(&sys_info->disk_control, verbose);
}
else
Expand Down

0 comments on commit 59381b7

Please sign in to comment.