mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2025-03-28 14:56:24 +01:00
Merge pull request #161 from Detanup01/achievement_images_fallback
Achievement images fallback
This commit is contained in:
commit
25b7066136
1 changed files with 9 additions and 3 deletions
|
@ -98,10 +98,16 @@ int Steam_User_Stats::load_ach_icon(nlohmann::json &defined_ach, bool achieved)
|
||||||
|
|
||||||
std::string file_path(Local_Storage::get_game_settings_path() + icon_filepath);
|
std::string file_path(Local_Storage::get_game_settings_path() + icon_filepath);
|
||||||
unsigned int file_size = file_size_(file_path);
|
unsigned int file_size = file_size_(file_path);
|
||||||
if (!file_size) {
|
if (!file_size)
|
||||||
|
{
|
||||||
|
file_path = (Local_Storage::get_game_settings_path() + "achievement_images" + PATH_SEPARATOR + icon_filepath);
|
||||||
|
file_size = file_size_(file_path);
|
||||||
|
if (!file_size)
|
||||||
|
{
|
||||||
defined_ach[icon_handle_key] = Settings::INVALID_IMAGE_HANDLE;
|
defined_ach[icon_handle_key] = Settings::INVALID_IMAGE_HANDLE;
|
||||||
return Settings::INVALID_IMAGE_HANDLE;
|
return Settings::INVALID_IMAGE_HANDLE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int icon_size = static_cast<int>(settings->overlay_appearance.icon_size);
|
int icon_size = static_cast<int>(settings->overlay_appearance.icon_size);
|
||||||
std::string img(Local_Storage::load_image_resized(file_path, "", icon_size));
|
std::string img(Local_Storage::load_image_resized(file_path, "", icon_size));
|
||||||
|
|
Loading…
Add table
Reference in a new issue