mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2025-01-13 10:53:57 +08: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
@ -645,7 +645,10 @@ std::string get_achievement_icon_name( const char *pchName, bool pbAchieved )
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (pbAchieved) return it.value()["icon"].get<std::string>();
|
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 (...) {}
|
} catch (...) {}
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user