diff --git a/config.def.h b/config.def.h index adfcd591fc..c6cab11e5f 100644 --- a/config.def.h +++ b/config.def.h @@ -783,6 +783,10 @@ static const bool audio_enable_menu_bgm = false; #define DEFAULT_NOTIFICATION_SHOW_AUTOCONFIG true #endif +/* Display a notification when cheats are being + * applied */ +#define DEFAULT_NOTIFICATION_SHOW_CHEATS_APPLIED true + /* Display a notification when loading an * input remap file */ #define DEFAULT_NOTIFICATION_SHOW_REMAP_LOAD true diff --git a/configuration.c b/configuration.c index 6fbfa0da8e..33002e4188 100644 --- a/configuration.c +++ b/configuration.c @@ -1474,6 +1474,7 @@ static struct config_bool_setting *populate_settings_bool( SETTING_BOOL("menu_enable_widgets", &settings->bools.menu_enable_widgets, true, DEFAULT_MENU_ENABLE_WIDGETS, false); SETTING_BOOL("menu_show_load_content_animation", &settings->bools.menu_show_load_content_animation, true, DEFAULT_MENU_SHOW_LOAD_CONTENT_ANIMATION, false); SETTING_BOOL("notification_show_autoconfig", &settings->bools.notification_show_autoconfig, true, DEFAULT_NOTIFICATION_SHOW_AUTOCONFIG, false); + 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_fast_forward", &settings->bools.notification_show_fast_forward, true, DEFAULT_NOTIFICATION_SHOW_FAST_FORWARD, false); diff --git a/configuration.h b/configuration.h index 8773df7fe5..21d5ba0f72 100644 --- a/configuration.h +++ b/configuration.h @@ -160,6 +160,7 @@ typedef struct settings bool menu_enable_widgets; bool menu_show_load_content_animation; bool notification_show_autoconfig; + bool notification_show_cheats_applied; bool notification_show_remap_load; bool notification_show_config_override_load; bool notification_show_fast_forward; diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index 1eb45e69bb..96f38a9db2 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -4320,6 +4320,10 @@ MSG_HASH( MENU_ENUM_LABEL_NOTIFICATION_SHOW_AUTOCONFIG, "notification_show_autoconfig" ) +MSG_HASH( + MENU_ENUM_LABEL_NOTIFICATION_SHOW_CHEATS_APPLIED, + "notification_show_cheats_applied" + ) MSG_HASH( MENU_ENUM_LABEL_NOTIFICATION_SHOW_REMAP_LOAD, "notification_show_remap_load" diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 5507e42d5b..7c71719a46 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -3400,6 +3400,14 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_NOTIFICATION_SHOW_AUTOCONFIG, "Input (Autoconfig) Connection Notifications" ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_NOTIFICATION_SHOW_CHEATS_APPLIED, + "Cheat Code Notifications" + ) +MSG_HASH( + MENU_ENUM_SUBLABEL_NOTIFICATION_SHOW_CHEATS_APPLIED, + "Display an on-screen message when cheat codes are applied" + ) MSG_HASH( MENU_ENUM_SUBLABEL_NOTIFICATION_SHOW_AUTOCONFIG, "Display an on-screen message when connecting/disconnecting input devices." diff --git a/managers/cheat_manager.c b/managers/cheat_manager.c index 2f0ed050ba..4489e741d9 100644 --- a/managers/cheat_manager.c +++ b/managers/cheat_manager.c @@ -43,6 +43,7 @@ #include "cheat_manager.h" #include "../msg_hash.h" +#include "../configuration.h" #include "../retroarch.h" #include "../dynamic.h" #include "../core.h" @@ -75,7 +76,8 @@ static void cheat_manager_pause_cheevos(void) void cheat_manager_apply_cheats(void) { - unsigned i, idx = 0; + unsigned i, idx = 0; + settings_t *settings = config_get_ptr(); cheat_manager_t *cheat_st = &cheat_manager_state; if (!cheat_st->cheats) @@ -99,7 +101,7 @@ void cheat_manager_apply_cheats(void) } } - if (cheat_st->size > 0) + if (cheat_st->size > 0 && settings->bools.notification_show_cheats_applied) { runloop_msg_queue_push(msg_hash_to_str(MSG_APPLYING_CHEAT), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO); RARCH_LOG("%s\n", msg_hash_to_str(MSG_APPLYING_CHEAT)); diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index 267bf67a2c..dbba7f8858 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -380,6 +380,9 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_restart_retroarch, MENU_ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_widgets, MENU_ENUM_SUBLABEL_MENU_WIDGETS_ENABLE) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_show_load_content_animation, MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT_ANIMATION) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_notification_show_autoconfig, MENU_ENUM_SUBLABEL_NOTIFICATION_SHOW_AUTOCONFIG) +#ifdef HAVE_CHEATS +DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_notification_show_cheats_applied, MENU_ENUM_SUBLABEL_NOTIFICATION_SHOW_CHEATS_APPLIED) +#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_fast_forward, MENU_ENUM_SUBLABEL_NOTIFICATION_SHOW_FAST_FORWARD) @@ -2986,6 +2989,11 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_NOTIFICATION_SHOW_AUTOCONFIG: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_notification_show_autoconfig); break; + case MENU_ENUM_LABEL_NOTIFICATION_SHOW_CHEATS_APPLIED: +#ifdef HAVE_CHEATS + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_notification_show_cheats_applied); +#endif + break; case MENU_ENUM_LABEL_NOTIFICATION_SHOW_REMAP_LOAD: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_notification_show_remap_load); break; diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 6ae74af3e0..8adef02a3d 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -7561,6 +7561,7 @@ unsigned menu_displaylist_build_list( {MENU_ENUM_LABEL_MEMORY_SHOW, PARSE_ONLY_BOOL, true }, {MENU_ENUM_LABEL_MENU_SHOW_LOAD_CONTENT_ANIMATION, PARSE_ONLY_BOOL, false }, {MENU_ENUM_LABEL_NOTIFICATION_SHOW_AUTOCONFIG, PARSE_ONLY_BOOL, true }, + {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_FAST_FORWARD, PARSE_ONLY_BOOL, true }, diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 8baa28806a..1b11b0687a 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -12589,6 +12589,21 @@ static bool setting_append_list( general_read_handler, SD_FLAG_NONE); + CONFIG_BOOL( + list, list_info, + &settings->bools.notification_show_cheats_applied, + MENU_ENUM_LABEL_NOTIFICATION_SHOW_CHEATS_APPLIED, + MENU_ENUM_LABEL_VALUE_NOTIFICATION_SHOW_CHEATS_APPLIED, + DEFAULT_NOTIFICATION_SHOW_CHEATS_APPLIED, + 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_remap_load, diff --git a/msg_hash.h b/msg_hash.h index 9134e73ef3..e498cd09ea 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -2564,6 +2564,7 @@ enum msg_hash_enums MENU_LABEL(MENU_SHOW_LOAD_CONTENT_ANIMATION), MENU_LABEL(NOTIFICATION_SHOW_AUTOCONFIG), + MENU_LABEL(NOTIFICATION_SHOW_CHEATS_APPLIED), MENU_LABEL(NOTIFICATION_SHOW_REMAP_LOAD), MENU_LABEL(NOTIFICATION_SHOW_CONFIG_OVERRIDE_LOAD), MENU_LABEL(NOTIFICATION_SHOW_FAST_FORWARD), diff --git a/retroarch.c b/retroarch.c index 091e3a41de..c7123c2d4b 100644 --- a/retroarch.c +++ b/retroarch.c @@ -3313,8 +3313,9 @@ static int menu_dialog_iterate( break; case MENU_DIALOG_HELP_EXTRACT: { - settings_t *settings = config_get_ptr(); - bool bundle_finished = settings->bools.bundle_finished; + struct rarch_state *p_rarch = &rarch_st; + settings_t *settings = p_rarch->configuration_settings; + bool bundle_finished = settings->bools.bundle_finished; msg_hash_get_help_enum( MENU_ENUM_LABEL_VALUE_EXTRACTING_PLEASE_WAIT,