diff --git a/dll/dll/settings.h b/dll/dll/settings.h index eaf33228..71f56a8a 100644 --- a/dll/dll/settings.h +++ b/dll/dll/settings.h @@ -257,6 +257,9 @@ public: // 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; + // the emulator loads the achievements icons is memory mainly for `ISteamUserStats::GetAchievementIcon()` + // true means load icons lazily when they are requested, otherwise load icons as soon as the interface ISteamUserStats is initialized + bool lazy_load_achievements_icons = true; // bypass to make SetAchievement() always return true, prevent some games from breaking bool achievement_bypass = false; diff --git a/dll/settings_parser.cpp b/dll/settings_parser.cpp index 772b7c13..2dfcf71f 100644 --- a/dll/settings_parser.cpp +++ b/dll/settings_parser.cpp @@ -1364,18 +1364,6 @@ static void parse_simple_features(class Settings *settings_client, class Setting settings_client->steam_deck = ini.GetBoolValue("main::general", "steam_deck", settings_client->steam_deck); settings_server->steam_deck = ini.GetBoolValue("main::general", "steam_deck", settings_server->steam_deck); - settings_client->disable_leaderboards_create_unknown = ini.GetBoolValue("main::general", "disable_leaderboards_create_unknown", settings_client->disable_leaderboards_create_unknown); - settings_server->disable_leaderboards_create_unknown = ini.GetBoolValue("main::general", "disable_leaderboards_create_unknown", settings_server->disable_leaderboards_create_unknown); - - 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); - settings_client->immediate_gameserver_stats = ini.GetBoolValue("main::general", "immediate_gameserver_stats", settings_client->immediate_gameserver_stats); settings_server->immediate_gameserver_stats = ini.GetBoolValue("main::general", "immediate_gameserver_stats", settings_server->immediate_gameserver_stats); @@ -1420,6 +1408,25 @@ static void parse_simple_features(class Settings *settings_client, class Setting settings_server->enable_builtin_preowned_ids = ini.GetBoolValue("main::misc", "enable_steam_preowned_ids", settings_server->enable_builtin_preowned_ids); } +// [main::stats] +static void parse_stats_features(class Settings *settings_client, class Settings *settings_server) +{ + settings_client->disable_leaderboards_create_unknown = ini.GetBoolValue("main::stats", "disable_leaderboards_create_unknown", settings_client->disable_leaderboards_create_unknown); + settings_server->disable_leaderboards_create_unknown = ini.GetBoolValue("main::stats", "disable_leaderboards_create_unknown", settings_server->disable_leaderboards_create_unknown); + + settings_client->allow_unknown_stats = ini.GetBoolValue("main::stats", "allow_unknown_stats", settings_client->allow_unknown_stats); + settings_server->allow_unknown_stats = ini.GetBoolValue("main::stats", "allow_unknown_stats", settings_server->allow_unknown_stats); + + settings_client->stat_achievement_progress_functionality = ini.GetBoolValue("main::stats", "stat_achievement_progress_functionality", settings_client->stat_achievement_progress_functionality); + settings_server->stat_achievement_progress_functionality = ini.GetBoolValue("main::stats", "stat_achievement_progress_functionality", settings_server->stat_achievement_progress_functionality); + + settings_client->save_only_higher_stat_achievement_progress = ini.GetBoolValue("main::stats", "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::stats", "save_only_higher_stat_achievement_progress", settings_server->save_only_higher_stat_achievement_progress); + + settings_client->lazy_load_achievements_icons = ini.GetBoolValue("main::stats", "lazy_load_achievements_icons", settings_client->lazy_load_achievements_icons); + settings_server->lazy_load_achievements_icons = ini.GetBoolValue("main::stats", "lazy_load_achievements_icons", settings_server->lazy_load_achievements_icons); +} + static std::map old_itfs_map{}; @@ -1673,6 +1680,7 @@ uint32 create_localstorage_settings(Settings **settings_client_out, Settings **s settings_server->set_supported_languages(supported_languages); parse_simple_features(settings_client, settings_server); + parse_stats_features(settings_client, settings_server); parse_dlc(settings_client, settings_server); parse_installed_app_Ids(settings_client, settings_server); diff --git a/post_build/steam_settings.EXAMPLE/configs.main.EXAMPLE.ini b/post_build/steam_settings.EXAMPLE/configs.main.EXAMPLE.ini index c3a3290b..4f4799ca 100644 --- a/post_build/steam_settings.EXAMPLE/configs.main.EXAMPLE.ini +++ b/post_build/steam_settings.EXAMPLE/configs.main.EXAMPLE.ini @@ -15,6 +15,26 @@ steam_deck=0 # 1=enable avatar functionality # default=0 enable_account_avatar=0 +# 1=synchronize user stats/achievements with game servers as soon as possible instead of caching them until the next call to `Steam_RunCallbacks()` +# not recommended to enable this +# default=0 +immediate_gameserver_stats=0 +# 1=use the proper type of the server list (internet, friends, etc...) when requested by the game +# 0=always return the type of the server list as "LAN server" +# not recommended to enable this +# default=0 +matchmaking_server_list_actual_type=0 +# 1=grab the server details for match making using an actual server query +# 0=use the info from the local network messages shared between client/server +# not recommended to enable this, currently breaks some games +# default=0 +matchmaking_server_details_via_source_query=0 +# very basic crash logger/printer +# this is intended to debug some annoying scenarios, and best used with the debug build of the emu +# default= +crash_printer_location=./path/relative/to/dll/crashes.txt + +[main::stats] # 1=prevent `Steam_User_Stats::FindLeaderboard()` from always succeeding and creating the unknown leaderboard # not recommended to enable this # default=0 @@ -39,24 +59,13 @@ stat_achievement_progress_functionality=1 # also has no impact on the functions which directly change stats, achievements, or achievements progress # default=1 save_only_higher_stat_achievement_progress=1 -# 1=synchronize user stats/achievements with game servers as soon as possible instead of caching them until the next call to `Steam_RunCallbacks()` -# not recommended to enable this -# default=0 -immediate_gameserver_stats=0 -# 1=use the proper type of the server list (internet, friends, etc...) when requested by the game -# 0=always return the type of the server list as "LAN server" -# not recommended to enable this -# default=0 -matchmaking_server_list_actual_type=0 -# 1=grab the server details for match making using an actual server query -# 0=use the info from the local network messages shared between client/server -# not recommended to enable this, currently breaks some games -# default=0 -matchmaking_server_details_via_source_query=0 -# very basic crash logger/printer -# this is intended to debug some annoying scenarios, and best used with the debug build of the emu -# default= -crash_printer_location=./path/relative/to/dll/crashes.txt +# the emulator loads the achievements icons is memory +# this is needed for APIs like `ISteamUserStats::GetAchievementIcon()` +# the loaded icon size is controlled by [overlay::appearance] -> Icon_Size, in configs.overlay.ini +# 1=load icons lazily when they are requested +# 0=load icons as soon as the interface ISteamUserStats is initialized +# default=1 +lazy_load_achievements_icons=1 [main::connectivity] # 1=prevent hooking OS networking APIs and allow any external requests