Merge pull request #10637 from meleu/patch-11

cheevos: option to start a session with all achievements active
This commit is contained in:
Autechre 2020-05-15 22:31:09 +02:00 committed by GitHub
commit d3a55ef732
10 changed files with 102 additions and 43 deletions

View File

@ -1991,7 +1991,8 @@ found:
* Inputs: CHEEVOS_VAR_GAMEID
* Outputs:
*/
CORO_GOSUB(RCHEEVOS_DEACTIVATE);
if (!coro->settings->bools.cheevos_start_active)
CORO_GOSUB(RCHEEVOS_DEACTIVATE);
/*
* Inputs: CHEEVOS_VAR_GAMEID
@ -2021,15 +2022,33 @@ found:
if (!number_of_unsupported)
{
snprintf(msg, sizeof(msg),
"You have %d of %d achievements unlocked.",
number_of_unlocked, rcheevos_locals.patchdata.core_count);
if (coro->settings->bools.cheevos_start_active) {
snprintf(msg, sizeof(msg),
"All %d achievements activated for this session.",
rcheevos_locals.patchdata.core_count);
}
else
{
snprintf(msg, sizeof(msg),
"You have %d of %d achievements unlocked.",
number_of_unlocked, rcheevos_locals.patchdata.core_count);
}
}
else
{
snprintf(msg, sizeof(msg),
"You have %d of %d achievements unlocked (%d unsupported).",
number_of_unlocked - number_of_unsupported, rcheevos_locals.patchdata.core_count, number_of_unsupported);
if (coro->settings->bools.cheevos_start_active) {
snprintf(msg, sizeof(msg),
"All %d achievements activated for this session (%d unsupported).",
rcheevos_locals.patchdata.core_count,
number_of_unsupported);
}
else{
snprintf(msg, sizeof(msg),
"You have %d of %d achievements unlocked (%d unsupported).",
number_of_unlocked - number_of_unsupported,
rcheevos_locals.patchdata.core_count,
number_of_unsupported);
}
}
msg[sizeof(msg) - 1] = 0;

View File

@ -1588,6 +1588,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
SETTING_BOOL("cheevos_verbose_enable", &settings->bools.cheevos_verbose_enable, true, false, false);
SETTING_BOOL("cheevos_auto_screenshot", &settings->bools.cheevos_auto_screenshot, true, false, false);
SETTING_BOOL("cheevos_badges_enable", &settings->bools.cheevos_badges_enable, true, false, false);
SETTING_BOOL("cheevos_start_active", &settings->bools.cheevos_start_active, true, false, false);
#endif
#ifdef HAVE_OVERLAY
SETTING_BOOL("input_overlay_enable", &settings->bools.input_overlay_enable, true, config_overlay_enable_default(), false);

View File

@ -304,6 +304,7 @@ typedef struct settings
bool cheevos_badges_enable;
bool cheevos_verbose_enable;
bool cheevos_auto_screenshot;
bool cheevos_start_active;
/* Camera */
bool camera_allow;

View File

@ -368,6 +368,10 @@ MSG_HASH(
MENU_ENUM_LABEL_CHEEVOS_AUTO_SCREENSHOT,
"cheevos_auto_screenshot"
)
MSG_HASH(
MENU_ENUM_LABEL_CHEEVOS_START_ACTIVE,
"cheevos_start_active"
)
MSG_HASH(
MENU_ENUM_LABEL_CLOSE_CONTENT,
"unload_core"

View File

@ -4155,6 +4155,14 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_CHEEVOS_AUTO_SCREENSHOT,
"Automatically take a screenshot when an achievement is triggered."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CHEEVOS_START_ACTIVE,
"Start Active"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_CHEEVOS_START_ACTIVE,
"Start the session with all achievements active (even the ones you previously unlocked)."
)
/* Settings > Network */

View File

@ -169,6 +169,7 @@ default_sublabel_macro(action_bind_sublabel_cheevos_richpresence_enable, MENU_
default_sublabel_macro(action_bind_sublabel_cheevos_badges_enable, MENU_ENUM_SUBLABEL_CHEEVOS_BADGES_ENABLE)
default_sublabel_macro(action_bind_sublabel_cheevos_verbose_enable, MENU_ENUM_SUBLABEL_CHEEVOS_VERBOSE_ENABLE)
default_sublabel_macro(action_bind_sublabel_cheevos_auto_screenshot, MENU_ENUM_SUBLABEL_CHEEVOS_AUTO_SCREENSHOT)
default_sublabel_macro(action_bind_sublabel_cheevos_start_active, MENU_ENUM_SUBLABEL_CHEEVOS_START_ACTIVE)
default_sublabel_macro(action_bind_sublabel_menu_views_settings_list, MENU_ENUM_SUBLABEL_MENU_VIEWS_SETTINGS)
default_sublabel_macro(action_bind_sublabel_quick_menu_views_settings_list, MENU_ENUM_SUBLABEL_QUICK_MENU_VIEWS_SETTINGS)
default_sublabel_macro(action_bind_sublabel_settings_views_settings_list, MENU_ENUM_SUBLABEL_SETTINGS_VIEWS_SETTINGS)
@ -2746,6 +2747,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_CHEEVOS_AUTO_SCREENSHOT:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_cheevos_auto_screenshot);
break;
case MENU_ENUM_LABEL_CHEEVOS_START_ACTIVE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_cheevos_start_active);
break;
case MENU_ENUM_LABEL_SETTINGS:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_settings);
break;

View File

@ -6075,6 +6075,7 @@ unsigned menu_displaylist_build_list(
{MENU_ENUM_LABEL_CHEEVOS_TEST_UNOFFICIAL, PARSE_ONLY_BOOL, false },
{MENU_ENUM_LABEL_CHEEVOS_VERBOSE_ENABLE, PARSE_ONLY_BOOL, false },
{MENU_ENUM_LABEL_CHEEVOS_AUTO_SCREENSHOT, PARSE_ONLY_BOOL, false },
{MENU_ENUM_LABEL_CHEEVOS_START_ACTIVE, PARSE_ONLY_BOOL, false },
};
for (i = 0; i < ARRAY_SIZE(build_list); i++)

View File

@ -15936,6 +15936,22 @@ static bool setting_append_list(
SD_FLAG_NONE
);
CONFIG_BOOL(
list, list_info,
&settings->bools.cheevos_start_active,
MENU_ENUM_LABEL_CHEEVOS_START_ACTIVE,
MENU_ENUM_LABEL_VALUE_CHEEVOS_START_ACTIVE,
false,
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_hardcore_mode_enable,

View File

@ -1238,6 +1238,7 @@ enum msg_hash_enums
MENU_LABEL(CHEEVOS_TEST_UNOFFICIAL),
MENU_LABEL(CHEEVOS_VERBOSE_ENABLE),
MENU_LABEL(CHEEVOS_AUTO_SCREENSHOT),
MENU_LABEL(CHEEVOS_START_ACTIVE),
MENU_LABEL(CHEEVOS_ENABLE),
MENU_LABEL(CHEEVOS_DESCRIPTION),
MENU_LABEL(ACCOUNTS_RETRO_ACHIEVEMENTS),

View File

@ -875,7 +875,11 @@
# Send some messages to the RetroAchievements.org saying, for example,
# where you are in the game, how many lives you have, your score, etc.
# cheevos_richpresence_enable = false
# cheevos_richpresence_enable = true
# Even after unlocking achievements in previous sessions, you may still want
# to see them triggering in the current session.
# cheevos_start_active = false
# Unnoficial achievements are used only for achievement creators and testers.
# cheevos_test_unofficial = false