Achievement Visibility Submenu - Additional changes

- 'Unlocks/Mastery' split into two options
- 'Account/Login Messages' split off from 'Verbose', gated all login success/error messages
- menu_cbs_sublabel.c - Now in same order as menu options
- menu_setting.c - VISIBILITY_UNLOCK default value now uses define
- All suggested text/cleanup changes from Jamiras
This commit is contained in:
retroNUC 2023-01-05 14:24:50 +00:00 committed by LibretroAdmin
parent 1bf31d84db
commit 31addc0a61
11 changed files with 94 additions and 18 deletions

View File

@ -1480,7 +1480,7 @@ void rcheevos_show_mastery_placard(void)
title[sizeof(title) - 1] = '\0'; title[sizeof(title) - 1] = '\0';
CHEEVOS_LOG(RCHEEVOS_TAG "%s\n", title); CHEEVOS_LOG(RCHEEVOS_TAG "%s\n", title);
if (settings->bools.cheevos_visibility_unlock) if (settings->bools.cheevos_visibility_mastery)
{ {
#if defined (HAVE_GFX_WIDGETS) #if defined (HAVE_GFX_WIDGETS)
if (gfx_widgets_ready()) if (gfx_widgets_ready())
@ -1736,7 +1736,7 @@ static void rcheevos_fetch_game_data(void)
const settings_t* settings = config_get_ptr(); const settings_t* settings = config_get_ptr();
if (settings->bools.cheevos_verbose_enable) if (settings->bools.cheevos_verbose_enable)
runloop_msg_queue_push( runloop_msg_queue_push(
"This game has no achievements.", "RetroAchivements: Game could not be identified.",
0, 3 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO); 0, 3 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
CHEEVOS_LOG(RCHEEVOS_TAG "Game could not be identified\n"); CHEEVOS_LOG(RCHEEVOS_TAG "Game could not be identified\n");
@ -1946,7 +1946,7 @@ static void rcheevos_login_callback(void* userdata)
if (rcheevos_locals.token[0]) if (rcheevos_locals.token[0])
{ {
const settings_t* settings = config_get_ptr(); const settings_t* settings = config_get_ptr();
if (settings->bools.cheevos_verbose_enable) if (settings->bools.cheevos_visibility_account)
{ {
char msg[256]; char msg[256];
msg[0] = '\0'; msg[0] = '\0';
@ -2044,8 +2044,9 @@ bool rcheevos_load(const void *data)
if (string_is_empty(settings->arrays.cheevos_username)) if (string_is_empty(settings->arrays.cheevos_username))
{ {
CHEEVOS_LOG(RCHEEVOS_TAG "Cannot login (no username)\n"); CHEEVOS_LOG(RCHEEVOS_TAG "Cannot login (no username)\n");
runloop_msg_queue_push("Missing RetroAchievements account information.", 0, 5 * 60, false, NULL, if (settings->bools.cheevos_visibility_account)
MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_ERROR); runloop_msg_queue_push("Missing RetroAchievements account information.", 0, 5 * 60, false, NULL,
MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_ERROR);
rcheevos_locals.game.id = 0; rcheevos_locals.game.id = 0;
rcheevos_pause_hardcore(); rcheevos_pause_hardcore();
return false; return false;
@ -2133,7 +2134,8 @@ bool rcheevos_load(const void *data)
{ {
CHEEVOS_LOG(RCHEEVOS_TAG "Cannot login %s (no password or token)\n", CHEEVOS_LOG(RCHEEVOS_TAG "Cannot login %s (no password or token)\n",
settings->arrays.cheevos_username); settings->arrays.cheevos_username);
runloop_msg_queue_push("No password provided for RetroAchievements account", 0, 5 * 60, false, NULL, if (settings->bools.cheevos_visibility_account)
runloop_msg_queue_push("No password provided for RetroAchievements account", 0, 5 * 60, false, NULL,
MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_ERROR); MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_ERROR);
rcheevos_unload(); rcheevos_unload();
return false; return false;

View File

@ -116,7 +116,6 @@ enum rcheevos_summary_notif
RCHEEVOS_SUMMARY_HASCHEEVOS, RCHEEVOS_SUMMARY_HASCHEEVOS,
RCHEEVOS_SUMMARY_OFF, RCHEEVOS_SUMMARY_OFF,
RCHEEVOS_SUMMARY_LAST RCHEEVOS_SUMMARY_LAST
}; };
typedef struct rcheevos_load_info_t typedef struct rcheevos_load_info_t

View File

@ -191,6 +191,8 @@
#define DEFAULT_CHEEVOS_APPEARANCE_PADDING_V 0.0f #define DEFAULT_CHEEVOS_APPEARANCE_PADDING_V 0.0f
#define DEFAULT_CHEEVOS_VISIBILITY_SUMMARY 1 /* RCHEEVOS_SUMMARY_HASCHEEVOS */ #define DEFAULT_CHEEVOS_VISIBILITY_SUMMARY 1 /* RCHEEVOS_SUMMARY_HASCHEEVOS */
#define DEFAULT_CHEEVOS_VISIBILITY_UNLOCK true #define DEFAULT_CHEEVOS_VISIBILITY_UNLOCK true
#define DEFAULT_CHEEVOS_VISIBILITY_MASTERY true
#define DEFAULT_CHEEVOS_VISIBILITY_ACCOUNT true
#endif #endif
/* VIDEO */ /* VIDEO */

View File

@ -1953,6 +1953,8 @@ static struct config_bool_setting *populate_settings_bool(
SETTING_BOOL("cheevos_start_active", &settings->bools.cheevos_start_active, true, false, false); SETTING_BOOL("cheevos_start_active", &settings->bools.cheevos_start_active, true, false, false);
SETTING_BOOL("cheevos_appearance_padding_auto", &settings->bools.cheevos_appearance_padding_auto, true, DEFAULT_CHEEVOS_APPEARANCE_PADDING_AUTO, false); SETTING_BOOL("cheevos_appearance_padding_auto", &settings->bools.cheevos_appearance_padding_auto, true, DEFAULT_CHEEVOS_APPEARANCE_PADDING_AUTO, false);
SETTING_BOOL("cheevos_visibility_unlock", &settings->bools.cheevos_visibility_unlock, true, DEFAULT_CHEEVOS_VISIBILITY_UNLOCK, false); SETTING_BOOL("cheevos_visibility_unlock", &settings->bools.cheevos_visibility_unlock, true, DEFAULT_CHEEVOS_VISIBILITY_UNLOCK, false);
SETTING_BOOL("cheevos_visibility_mastery", &settings->bools.cheevos_visibility_mastery, true, DEFAULT_CHEEVOS_VISIBILITY_MASTERY, false);
SETTING_BOOL("cheevos_visibility_account", &settings->bools.cheevos_visibility_account, true, DEFAULT_CHEEVOS_VISIBILITY_ACCOUNT, false);
#endif #endif
#ifdef HAVE_OVERLAY #ifdef HAVE_OVERLAY
SETTING_BOOL("input_overlay_enable", &settings->bools.input_overlay_enable, true, config_overlay_enable_default(), false); SETTING_BOOL("input_overlay_enable", &settings->bools.input_overlay_enable, true, config_overlay_enable_default(), false);

View File

@ -838,6 +838,8 @@ typedef struct settings
bool cheevos_challenge_indicators; bool cheevos_challenge_indicators;
bool cheevos_appearance_padding_auto; bool cheevos_appearance_padding_auto;
bool cheevos_visibility_unlock; bool cheevos_visibility_unlock;
bool cheevos_visibility_mastery;
bool cheevos_visibility_account;
/* Camera */ /* Camera */
bool camera_allow; bool camera_allow;

View File

@ -464,6 +464,14 @@ MSG_HASH(
MENU_ENUM_LABEL_CHEEVOS_VISIBILITY_UNLOCK, MENU_ENUM_LABEL_CHEEVOS_VISIBILITY_UNLOCK,
"cheevos_visibility_unlock" "cheevos_visibility_unlock"
) )
MSG_HASH(
MENU_ENUM_LABEL_CHEEVOS_VISIBILITY_MASTERY,
"cheevos_visibility_mastery"
)
MSG_HASH(
MENU_ENUM_LABEL_CHEEVOS_VISIBILITY_ACCOUNT,
"cheevos_visibility_account"
)
MSG_HASH( MSG_HASH(
MENU_ENUM_LABEL_CLOSE_CONTENT, MENU_ENUM_LABEL_CLOSE_CONTENT,
"unload_core" "unload_core"

View File

@ -6127,11 +6127,11 @@ MSG_HASH(
) )
MSG_HASH( MSG_HASH(
MENU_ENUM_SUBLABEL_CHEEVOS_VISIBILITY_SUMMARY, MENU_ENUM_SUBLABEL_CHEEVOS_VISIBILITY_SUMMARY,
"Shows information about the game being loaded and the user's current progress.\n'All Games in Database' will show summary for games with no published achievements." "Shows information about the game being loaded and the user's current progress.\n'All Identified Games' will show summary for games with no published achievements."
) )
MSG_HASH( MSG_HASH(
MENU_ENUM_LABEL_VALUE_CHEEVOS_VISIBILITY_SUMMARY_ALLGAMES, MENU_ENUM_LABEL_VALUE_CHEEVOS_VISIBILITY_SUMMARY_ALLGAMES,
"All Games in Database" "All Identified Games"
) )
MSG_HASH( MSG_HASH(
MENU_ENUM_LABEL_VALUE_CHEEVOS_VISIBILITY_SUMMARY_HASCHEEVOS, MENU_ENUM_LABEL_VALUE_CHEEVOS_VISIBILITY_SUMMARY_HASCHEEVOS,
@ -6139,11 +6139,19 @@ MSG_HASH(
) )
MSG_HASH( MSG_HASH(
MENU_ENUM_LABEL_VALUE_CHEEVOS_VISIBILITY_UNLOCK, MENU_ENUM_LABEL_VALUE_CHEEVOS_VISIBILITY_UNLOCK,
"New Unlocks/Mastery" "Unlock Notifications"
) )
MSG_HASH( MSG_HASH(
MENU_ENUM_SUBLABEL_CHEEVOS_VISIBILITY_UNLOCK, MENU_ENUM_SUBLABEL_CHEEVOS_VISIBILITY_UNLOCK,
"Shows when a new achievement is unlocked or a game is mastered." "Shows a notification when an achievement is unlocked."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CHEEVOS_VISIBILITY_MASTERY,
"Mastery Notifications"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_CHEEVOS_VISIBILITY_MASTERY,
"Shows a notification when a game is mastered (all achievements unlocked)."
) )
MSG_HASH( MSG_HASH(
MENU_ENUM_LABEL_VALUE_CHEEVOS_CHALLENGE_INDICATORS, MENU_ENUM_LABEL_VALUE_CHEEVOS_CHALLENGE_INDICATORS,
@ -6151,15 +6159,23 @@ MSG_HASH(
) )
MSG_HASH( MSG_HASH(
MENU_ENUM_SUBLABEL_CHEEVOS_CHALLENGE_INDICATORS, MENU_ENUM_SUBLABEL_CHEEVOS_CHALLENGE_INDICATORS,
"Shows on-screen indicators while some conditional achievements can be earned." "Shows on-screen indicators while certain achievements can be earned."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CHEEVOS_VISIBILITY_ACCOUNT,
"Account/Login Messages"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_CHEEVOS_VISIBILITY_ACCOUNT,
"Shows messages related to RetroAchievements account login."
) )
MSG_HASH( MSG_HASH(
MENU_ENUM_LABEL_VALUE_CHEEVOS_VERBOSE_ENABLE, MENU_ENUM_LABEL_VALUE_CHEEVOS_VERBOSE_ENABLE,
"Verbose Mode" "Verbose Messages"
) )
MSG_HASH( MSG_HASH(
MENU_ENUM_SUBLABEL_CHEEVOS_VERBOSE_ENABLE, MENU_ENUM_SUBLABEL_CHEEVOS_VERBOSE_ENABLE,
"Shows additional messages for accounts and other internal errors/problems." "Shows additional diagnostic and error messages."
) )
/* Settings > Network */ /* Settings > Network */

View File

@ -312,8 +312,10 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_cheevos_appearance_padding_auto, MEN
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_cheevos_appearance_padding_h, MENU_ENUM_SUBLABEL_CHEEVOS_APPEARANCE_PADDING_H) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_cheevos_appearance_padding_h, MENU_ENUM_SUBLABEL_CHEEVOS_APPEARANCE_PADDING_H)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_cheevos_appearance_padding_v, MENU_ENUM_SUBLABEL_CHEEVOS_APPEARANCE_PADDING_V) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_cheevos_appearance_padding_v, MENU_ENUM_SUBLABEL_CHEEVOS_APPEARANCE_PADDING_V)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_cheevos_visibility_settings, MENU_ENUM_SUBLABEL_CHEEVOS_VISIBILITY_SETTINGS) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_cheevos_visibility_settings, MENU_ENUM_SUBLABEL_CHEEVOS_VISIBILITY_SETTINGS)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_cheevos_visibility_unlock, MENU_ENUM_SUBLABEL_CHEEVOS_VISIBILITY_UNLOCK)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_cheevos_visibility_summary, MENU_ENUM_SUBLABEL_CHEEVOS_VISIBILITY_SUMMARY) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_cheevos_visibility_summary, MENU_ENUM_SUBLABEL_CHEEVOS_VISIBILITY_SUMMARY)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_cheevos_visibility_unlock, MENU_ENUM_SUBLABEL_CHEEVOS_VISIBILITY_UNLOCK)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_cheevos_visibility_mastery, MENU_ENUM_SUBLABEL_CHEEVOS_VISIBILITY_MASTERY)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_cheevos_visibility_account, MENU_ENUM_SUBLABEL_CHEEVOS_VISIBILITY_ACCOUNT)
#endif #endif
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_views_settings_list, MENU_ENUM_SUBLABEL_MENU_VIEWS_SETTINGS) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_views_settings_list, MENU_ENUM_SUBLABEL_MENU_VIEWS_SETTINGS)
@ -4318,11 +4320,17 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_CHEEVOS_VISIBILITY_SETTINGS: case MENU_ENUM_LABEL_CHEEVOS_VISIBILITY_SETTINGS:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_cheevos_visibility_settings); BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_cheevos_visibility_settings);
break; break;
case MENU_ENUM_LABEL_CHEEVOS_VISIBILITY_SUMMARY:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_cheevos_visibility_summary);
break;
case MENU_ENUM_LABEL_CHEEVOS_VISIBILITY_UNLOCK: case MENU_ENUM_LABEL_CHEEVOS_VISIBILITY_UNLOCK:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_cheevos_visibility_unlock); BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_cheevos_visibility_unlock);
break; break;
case MENU_ENUM_LABEL_CHEEVOS_VISIBILITY_SUMMARY: case MENU_ENUM_LABEL_CHEEVOS_VISIBILITY_MASTERY:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_cheevos_visibility_summary); BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_cheevos_visibility_mastery);
break;
case MENU_ENUM_LABEL_CHEEVOS_VISIBILITY_ACCOUNT:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_cheevos_visibility_account);
break; break;
#endif #endif
case MENU_ENUM_LABEL_SETTINGS: case MENU_ENUM_LABEL_SETTINGS:

View File

@ -8423,7 +8423,9 @@ unsigned menu_displaylist_build_list(
menu_displaylist_build_info_selective_t build_list[] = { menu_displaylist_build_info_selective_t build_list[] = {
{MENU_ENUM_LABEL_CHEEVOS_VISIBILITY_SUMMARY, PARSE_ONLY_UINT, true}, {MENU_ENUM_LABEL_CHEEVOS_VISIBILITY_SUMMARY, PARSE_ONLY_UINT, true},
{MENU_ENUM_LABEL_CHEEVOS_VISIBILITY_UNLOCK, PARSE_ONLY_BOOL, true}, {MENU_ENUM_LABEL_CHEEVOS_VISIBILITY_UNLOCK, PARSE_ONLY_BOOL, true},
{MENU_ENUM_LABEL_CHEEVOS_VISIBILITY_MASTERY, PARSE_ONLY_BOOL, true},
{MENU_ENUM_LABEL_CHEEVOS_CHALLENGE_INDICATORS, PARSE_ONLY_BOOL, true}, {MENU_ENUM_LABEL_CHEEVOS_CHALLENGE_INDICATORS, PARSE_ONLY_BOOL, true},
{MENU_ENUM_LABEL_CHEEVOS_VISIBILITY_ACCOUNT, PARSE_ONLY_BOOL, true},
{MENU_ENUM_LABEL_CHEEVOS_VERBOSE_ENABLE, PARSE_ONLY_BOOL, true}, {MENU_ENUM_LABEL_CHEEVOS_VERBOSE_ENABLE, PARSE_ONLY_BOOL, true},
}; };

View File

@ -20251,7 +20251,23 @@ static bool setting_append_list(
&settings->bools.cheevos_visibility_unlock, &settings->bools.cheevos_visibility_unlock,
MENU_ENUM_LABEL_CHEEVOS_VISIBILITY_UNLOCK, MENU_ENUM_LABEL_CHEEVOS_VISIBILITY_UNLOCK,
MENU_ENUM_LABEL_VALUE_CHEEVOS_VISIBILITY_UNLOCK, MENU_ENUM_LABEL_VALUE_CHEEVOS_VISIBILITY_UNLOCK,
true, DEFAULT_CHEEVOS_VISIBILITY_UNLOCK,
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.cheevos_visibility_mastery,
MENU_ENUM_LABEL_CHEEVOS_VISIBILITY_MASTERY,
MENU_ENUM_LABEL_VALUE_CHEEVOS_VISIBILITY_MASTERY,
DEFAULT_CHEEVOS_VISIBILITY_MASTERY,
MENU_ENUM_LABEL_VALUE_OFF, MENU_ENUM_LABEL_VALUE_OFF,
MENU_ENUM_LABEL_VALUE_ON, MENU_ENUM_LABEL_VALUE_ON,
&group_info, &group_info,
@ -20294,6 +20310,23 @@ static bool setting_append_list(
SD_FLAG_ADVANCED SD_FLAG_ADVANCED
); );
CONFIG_BOOL(
list, list_info,
&settings->bools.cheevos_visibility_account,
MENU_ENUM_LABEL_CHEEVOS_VISIBILITY_ACCOUNT,
MENU_ENUM_LABEL_VALUE_CHEEVOS_VISIBILITY_ACCOUNT,
DEFAULT_CHEEVOS_VISIBILITY_ACCOUNT,
MENU_ENUM_LABEL_VALUE_OFF,
MENU_ENUM_LABEL_VALUE_ON,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler,
SD_FLAG_ADVANCED
);
END_SUB_GROUP(list, list_info, parent_group); END_SUB_GROUP(list, list_info, parent_group);
END_GROUP(list, list_info, parent_group); END_GROUP(list, list_info, parent_group);
#endif #endif

View File

@ -1666,6 +1666,8 @@ enum msg_hash_enums
MENU_LABEL(CHEEVOS_VISIBILITY_SETTINGS), MENU_LABEL(CHEEVOS_VISIBILITY_SETTINGS),
MENU_LABEL(CHEEVOS_VISIBILITY_SUMMARY), MENU_LABEL(CHEEVOS_VISIBILITY_SUMMARY),
MENU_LABEL(CHEEVOS_VISIBILITY_UNLOCK), MENU_LABEL(CHEEVOS_VISIBILITY_UNLOCK),
MENU_LABEL(CHEEVOS_VISIBILITY_MASTERY),
MENU_LABEL(CHEEVOS_VISIBILITY_ACCOUNT),
MENU_ENUM_LABEL_VALUE_CHEEVOS_VISIBILITY_SUMMARY_ALLGAMES, MENU_ENUM_LABEL_VALUE_CHEEVOS_VISIBILITY_SUMMARY_ALLGAMES,
MENU_ENUM_LABEL_VALUE_CHEEVOS_VISIBILITY_SUMMARY_HASCHEEVOS, MENU_ENUM_LABEL_VALUE_CHEEVOS_VISIBILITY_SUMMARY_HASCHEEVOS,