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

Implement Steam_User_Stats::GetAchievementIcon() #9

Merged
merged 15 commits into from
Aug 18, 2024

Conversation

otavepto
Copy link

  • Implement Steam_User_Stats::GetAchievementIcon()
  • Load all achievements icons in memory when loading the achievements schema in the interface ISteamUserStats rather than in the overlay, this is done in the periodic callback which is run on a separate thread
  • new option lazy_load_achievements_icons in configs.main.ini which is enabled by default, to lazy load achievements icons in memory when they're requested, rather than loading them on the next call to the periodic callback of the ISteamUserStats interface
  • Move all stats options in configs.main.ini to a new separate section [main::stats]
  • Fix a deadlock scenario in the overlay which could be triggered by the new lazy_load_achievements_icons option
  • In the overlay use the achievement icon handle from ISteamUserStats rather than manually loading the image from disk
  • In the overlay deprecate searching for achievements icons in achievement_images folder when loading icons, makes programming easier + it is no longer valid since the user stats interface is taking care of icons loading now
  • In the overlay don't check for the ready flag in networking callback, save the chat message and exit, when
    the overlay is ready it will display it on next frame render, this avoids a scenario where a chat message might be missed if the overlay took too long to initialize
  • Fix a bug in the overlay when displaying progress notifications, where the achieved icon was shown instead of the gray/locked one
  • Make the test achievement in the overlay load either a locked or unlocked icon randomly
  • In the overlay don't attempt to load the icon more than once, with the new icon loading method it is enough to try once for each icon
  • Ensure generated schema from generate_emu_config tool contains name and description
  • Encapsulate image load/get functions + don't add new image resource if current one exists
  • Remove unused Vulkan headers
  • Generate random number for each debug log file, workaround a scenario where a game launcher exists in the same folder as the game, making both share the same file resulting in combined/confusing output
  • Split steam_user_stats class into multiple files for readability

Some games like appid 2242420 (free game) need this API, otherwise the launcher will crash.

The lazy loading option is enabled by default because some games like appid 218620 (payday 2) have a huge number of achievements, loading the icons all at once in the constructor would take ~2 mins.

When this option is disabled, the background thread will trigger the periodic callback which will then load the icons, that way the constructor won't be affected.

a added 15 commits August 18, 2024 04:59
* don't add new image resource if current one exists
* load all achievements icons in memory when loading the achievements schema
…he icon filepath to load the icon resource
…equested, rather than loading them on the next call to the run callback

* move stats options in the ini to a separate section [main::stats]
…s, instead wait for the next call to the run callback

* fix a bug where loaded image handle wasn't being saved
…age and exit, when the ovrlay is ready it will display it
… icon was shown instead of the gray/locked one

* don't save/cache the achievement icon handle to allow lazy loading
* make the test achievement load either locked or unlocked icon randomly
* don't attempt to load the icon more than once
@Detanup01 Detanup01 merged commit f1d4ba6 into Detanup01:dev Aug 18, 2024
64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants