Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow disabling the internal functionality which reports an achievement progress for stats that are tied to achievements #4

Merged
merged 1 commit into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions dll/dll/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ class Settings {
// allow stats not defined by the user?
bool allow_unknown_stats = false;

// whether to enable the functionality which reports an achievement progress for stats that are tied to achievements
// only used internally for a stat that's tied to an achievement, the normal achievement progress requests made by the game are not impacted
bool stat_achievement_progress_functionality = true;
// when a stat that's tied to an achievement gets a new value, should the emu save that progress only if it's higher?
// the stat itself is always saved regardless of that flag, only affects the achievement progress
bool save_only_higher_stat_achievement_progress = true;
Expand Down
3 changes: 3 additions & 0 deletions dll/settings_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1370,6 +1370,9 @@ static void parse_simple_features(class Settings *settings_client, class Setting
settings_client->allow_unknown_stats = ini.GetBoolValue("main::general", "allow_unknown_stats", settings_client->allow_unknown_stats);
settings_server->allow_unknown_stats = ini.GetBoolValue("main::general", "allow_unknown_stats", settings_server->allow_unknown_stats);

settings_client->stat_achievement_progress_functionality = ini.GetBoolValue("main::general", "stat_achievement_progress_functionality", settings_client->stat_achievement_progress_functionality);
settings_server->stat_achievement_progress_functionality = ini.GetBoolValue("main::general", "stat_achievement_progress_functionality", settings_server->stat_achievement_progress_functionality);

settings_client->save_only_higher_stat_achievement_progress = ini.GetBoolValue("main::general", "save_only_higher_stat_achievement_progress", settings_client->save_only_higher_stat_achievement_progress);
settings_server->save_only_higher_stat_achievement_progress = ini.GetBoolValue("main::general", "save_only_higher_stat_achievement_progress", settings_server->save_only_higher_stat_achievement_progress);

Expand Down
4 changes: 2 additions & 2 deletions dll/steam_user_stats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ Steam_User_Stats::InternalSetResult<int32> Steam_User_Stats::set_stat_internal(
if (t.should_unlock_ach(nData)) {
set_achievement_internal(t.name.c_str());
}
if (t.should_indicate_progress(nData)) {
if (settings->stat_achievement_progress_functionality && t.should_indicate_progress(nData)) {
bool indicate_progress = true;
// appid 1482380 needs that otherwise it will spam progress indications while driving
if (settings->save_only_higher_stat_achievement_progress) {
Expand Down Expand Up @@ -539,7 +539,7 @@ Steam_User_Stats::InternalSetResult<std::pair<GameServerStats_Messages::StatInfo
if (t.should_unlock_ach(fData)) {
set_achievement_internal(t.name.c_str());
}
if (t.should_indicate_progress(fData)) {
if (settings->stat_achievement_progress_functionality && t.should_indicate_progress(fData)) {
bool indicate_progress = true;
// appid 1482380 needs that otherwise it will spam progress indications while driving
if (settings->save_only_higher_stat_achievement_progress) {
Expand Down
8 changes: 8 additions & 0 deletions post_build/steam_settings.EXAMPLE/configs.main.EXAMPLE.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ disable_leaderboards_create_unknown=0
# set this to 1 to allow unknown stats
# default=0
allow_unknown_stats=0
# the emu has an internal extra functionality which reports an achievement progress when a stat that's tied to an ahcievement is updated
# also the progress is saved to disk (usual local storage folder for the current appid) so that external applications can watch these updates
# 1=enable this functionality
# only used internally for a stat that's tied to an achievement, the normal achievement progress requests made by the game are not impacted
# some applications tie many stats to achievements, and update these stats very frequently, causing a spam of disk writes and overlay popups
# in that case you can disable this functionality (set the value to 0), but the stat progress won't be saved or displayed in the overlay
# default=1
stat_achievement_progress_functionality=1
# whenever a game updates a stat which is tied to an achievement progress, the emu will save that progress immediately
# but some games will update the stat very frequently (with lower & higher values) resulting in a spam of disk writes or overlay notifications
# set this to 0 to save any stat achievement progress value (higher or lower)
Expand Down