Add 'Show Cheats Applied' onscreen notification visibility setting

This commit is contained in:
twinaphex 2020-07-17 03:32:22 +02:00
parent baa349f2ec
commit 36b581c733
11 changed files with 50 additions and 4 deletions

View File

@ -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

View File

@ -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);

View File

@ -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;

View File

@ -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"

View File

@ -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."

View File

@ -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));

View File

@ -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;

View File

@ -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 },

View File

@ -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,

View File

@ -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),

View File

@ -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,