Add option to show/hide 'last used disc restored' notifications

This commit is contained in:
jdgleaver 2020-07-17 12:50:28 +01:00
parent 501f737249
commit 230c1cdde2
13 changed files with 61 additions and 10 deletions

View File

@ -795,6 +795,10 @@ static const bool audio_enable_menu_bgm = false;
* configuration override file */
#define DEFAULT_NOTIFICATION_SHOW_CONFIG_OVERRIDE_LOAD true
/* Display a notification when automatically restoring
* at launch the last used disk of multi-disk content */
#define DEFAULT_NOTIFICATION_SHOW_SET_INITIAL_DISK true
/* Display a notification when fast forwarding
* content */
#define DEFAULT_NOTIFICATION_SHOW_FAST_FORWARD true

View File

@ -1477,6 +1477,7 @@ static struct config_bool_setting *populate_settings_bool(
SETTING_BOOL("notification_show_cheats_applied", &settings->bools.notification_show_cheats_applied, true, DEFAULT_NOTIFICATION_SHOW_CHEATS_APPLIED, false);
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_fast_forward", &settings->bools.notification_show_fast_forward, true, DEFAULT_NOTIFICATION_SHOW_FAST_FORWARD, false);
SETTING_BOOL("menu_widget_scale_auto", &settings->bools.menu_widget_scale_auto, true, DEFAULT_MENU_WIDGET_SCALE_AUTO, false);
SETTING_BOOL("audio_enable_menu", &settings->bools.audio_enable_menu, true, audio_enable_menu, false);

View File

@ -163,6 +163,7 @@ typedef struct settings
bool notification_show_cheats_applied;
bool notification_show_remap_load;
bool notification_show_config_override_load;
bool notification_show_set_initial_disk;
bool notification_show_fast_forward;
bool menu_widget_scale_auto;
bool menu_show_start_screen;

View File

@ -665,7 +665,9 @@ error:
* if functionality is supported by core
* NOTE: Must be called immediately after
* loading content */
bool disk_control_verify_initial_index(disk_control_interface_t *disk_control)
bool disk_control_verify_initial_index(
disk_control_interface_t *disk_control,
bool verbosity)
{
bool success = false;
unsigned image_index = 0;
@ -723,6 +725,8 @@ bool disk_control_verify_initial_index(disk_control_interface_t *disk_control)
image_index + 1,
image_path);
/* Ignore 'verbosity' setting - errors should
* always be displayed */
runloop_msg_queue_push(
msg_hash_to_str(MSG_FAILED_TO_SET_INITIAL_DISK),
0, 60,
@ -765,11 +769,12 @@ bool disk_control_verify_initial_index(disk_control_interface_t *disk_control)
* it is likely other notifications will be
* generated before setting the disk index, and
* we do not want to 'overwrite' them */
runloop_msg_queue_push(
msg,
0, msg_duration,
false, NULL,
MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
if (verbosity)
runloop_msg_queue_push(
msg,
0, msg_duration,
false, NULL,
MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
}
return success;
@ -777,7 +782,8 @@ bool disk_control_verify_initial_index(disk_control_interface_t *disk_control)
/* Saves current disk index to file, if supported
* by current core */
bool disk_control_save_image_index(disk_control_interface_t *disk_control)
bool disk_control_save_image_index(
disk_control_interface_t *disk_control)
{
if (!disk_control)
return false;

View File

@ -167,11 +167,14 @@ bool disk_control_set_initial_index(
* if functionality is supported by core
* NOTE: Must be called immediately after
* loading content */
bool disk_control_verify_initial_index(disk_control_interface_t *disk_control);
bool disk_control_verify_initial_index(
disk_control_interface_t *disk_control,
bool verbosity);
/* Saves current disk index to file, if supported
* by current core */
bool disk_control_save_image_index(disk_control_interface_t *disk_control);
bool disk_control_save_image_index(
disk_control_interface_t *disk_control);
RETRO_END_DECLS

View File

@ -4332,6 +4332,10 @@ MSG_HASH(
MENU_ENUM_LABEL_NOTIFICATION_SHOW_CONFIG_OVERRIDE_LOAD,
"notification_show_config_override_load"
)
MSG_HASH(
MENU_ENUM_LABEL_NOTIFICATION_SHOW_SET_INITIAL_DISK,
"notification_show_set_initial_disk"
)
MSG_HASH(
MENU_ENUM_LABEL_NOTIFICATION_SHOW_FAST_FORWARD,
"notification_show_fast_forward"

View File

@ -3428,6 +3428,14 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_NOTIFICATION_SHOW_CONFIG_OVERRIDE_LOAD,
"Display an on-screen message when loading configuration override files."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_NOTIFICATION_SHOW_SET_INITIAL_DISK,
"Initial Disc Restored Notifications"
)
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_FAST_FORWARD,
"Fast-Forward Notifications"

View File

@ -385,6 +385,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_notification_show_cheats_applied, M
#endif
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_fast_forward, MENU_ENUM_SUBLABEL_NOTIFICATION_SHOW_FAST_FORWARD)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_video_window_width, MENU_ENUM_SUBLABEL_VIDEO_WINDOW_WIDTH)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_video_window_height, MENU_ENUM_SUBLABEL_VIDEO_WINDOW_HEIGHT)
@ -3000,6 +3001,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_NOTIFICATION_SHOW_CONFIG_OVERRIDE_LOAD:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_notification_show_config_override_load);
break;
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_FAST_FORWARD:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_notification_show_fast_forward);
break;

View File

@ -7564,6 +7564,7 @@ unsigned menu_displaylist_build_list(
{MENU_ENUM_LABEL_NOTIFICATION_SHOW_CHEATS_APPLIED, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_NOTIFICATION_SHOW_REMAP_LOAD, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_NOTIFICATION_SHOW_CONFIG_OVERRIDE_LOAD, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_NOTIFICATION_SHOW_SET_INITIAL_DISK, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_NOTIFICATION_SHOW_FAST_FORWARD, PARSE_ONLY_BOOL, true },
};

View File

@ -12634,6 +12634,21 @@ static bool setting_append_list(
general_read_handler,
SD_FLAG_NONE);
CONFIG_BOOL(
list, list_info,
&settings->bools.notification_show_set_initial_disk,
MENU_ENUM_LABEL_NOTIFICATION_SHOW_SET_INITIAL_DISK,
MENU_ENUM_LABEL_VALUE_NOTIFICATION_SHOW_SET_INITIAL_DISK,
DEFAULT_NOTIFICATION_SHOW_SET_INITIAL_DISK,
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_fast_forward,

View File

@ -2567,6 +2567,7 @@ enum msg_hash_enums
MENU_LABEL(NOTIFICATION_SHOW_CHEATS_APPLIED),
MENU_LABEL(NOTIFICATION_SHOW_REMAP_LOAD),
MENU_LABEL(NOTIFICATION_SHOW_CONFIG_OVERRIDE_LOAD),
MENU_LABEL(NOTIFICATION_SHOW_SET_INITIAL_DISK),
MENU_LABEL(NOTIFICATION_SHOW_FAST_FORWARD),
MENU_LABEL(SELECT_FILE),

View File

@ -14737,6 +14737,7 @@ static bool command_event_init_core(
bool auto_remaps_enable = settings->bools.auto_remaps_enable;
const char *dir_input_remapping = settings->paths.directory_input_remapping;
#endif
bool show_set_initial_disk_msg = settings->bools.notification_show_set_initial_disk;
unsigned poll_type_behavior = settings->uints.input_poll_type_behavior;
float fastforward_ratio = settings->floats.fastforward_ratio;
rarch_system_info_t *sys_info = &p_rarch->runloop_system;
@ -14813,7 +14814,8 @@ static bool command_event_init_core(
return false;
/* Verify that initial disk index was set correctly */
disk_control_verify_initial_index(&sys_info->disk_control);
disk_control_verify_initial_index(&sys_info->disk_control,
show_set_initial_disk_msg);
if (!core_load(p_rarch, poll_type_behavior))
return false;

View File

@ -62,6 +62,7 @@ QWidget *NotificationsPage::widget()
notificationsGroup->add(MENU_ENUM_LABEL_NOTIFICATION_SHOW_AUTOCONFIG);
notificationsGroup->add(MENU_ENUM_LABEL_NOTIFICATION_SHOW_REMAP_LOAD);
notificationsGroup->add(MENU_ENUM_LABEL_NOTIFICATION_SHOW_CONFIG_OVERRIDE_LOAD);
notificationsGroup->add(MENU_ENUM_LABEL_NOTIFICATION_SHOW_SET_INITIAL_DISK);
notificationsGroup->add(MENU_ENUM_LABEL_NOTIFICATION_SHOW_FAST_FORWARD);
layout->addWidget(notificationsGroup);