mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2025-04-21 21:52:06 +02:00
attempt to load the locked achievement icon from the json key icongray
if the normal one failed, adding compatibility with older format
This commit is contained in:
parent
4d23a859f3
commit
5df75be04b
1 changed files with 4 additions and 1 deletions
|
@ -645,7 +645,10 @@ std::string get_achievement_icon_name( const char *pchName, bool pbAchieved )
|
|||
|
||||
try {
|
||||
if (pbAchieved) return it.value()["icon"].get<std::string>();
|
||||
else return it.value()["icon_gray"].get<std::string>();
|
||||
|
||||
std::string locked_icon = it.value().value("icon_gray", std::string());
|
||||
if (locked_icon.size()) return locked_icon;
|
||||
else return it.value().value("icongray", std::string()); // old format
|
||||
} catch (...) {}
|
||||
|
||||
return "";
|
||||
|
|
Loading…
Add table
Reference in a new issue