2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-07-11 13:41:50 +00:00

Merge pull request #471 from Laupetin/fix/show-json-errors

fix: show asset that failed when not being able to parse jsons
This commit is contained in:
Jan
2025-07-09 18:22:22 +02:00
committed by GitHub
7 changed files with 101 additions and 101 deletions

View File

@ -22,6 +22,8 @@ namespace
}
bool Load(LeaderboardDef& leaderboardDef) const
{
try
{
const auto jRoot = json::parse(m_stream);
std::string type;
@ -36,8 +38,6 @@ namespace
return false;
}
try
{
const auto jLeaderboard = jRoot.get<JsonLeaderboardDef>();
return CreateLeaderboardFromJson(jLeaderboard, leaderboardDef);
}

View File

@ -22,6 +22,8 @@ namespace
}
bool Load(LeaderboardDef& leaderboardDef) const
{
try
{
const auto jRoot = json::parse(m_stream);
std::string type;
@ -36,8 +38,6 @@ namespace
return false;
}
try
{
const auto jLeaderboard = jRoot.get<JsonLeaderboardDef>();
return CreateLeaderboardFromJson(jLeaderboard, leaderboardDef);
}

View File

@ -25,6 +25,8 @@ namespace
}
bool Load(WeaponAttachment& attachment) const
{
try
{
const auto jRoot = json::parse(m_stream);
std::string type;
@ -39,8 +41,6 @@ namespace
return false;
}
try
{
const auto jAttachment = jRoot.get<JsonWeaponAttachment>();
return CreateWeaponAttachmentFromJson(jAttachment, attachment);
}

View File

@ -22,6 +22,8 @@ namespace
}
bool Load(LeaderboardDef& leaderboardDef) const
{
try
{
const auto jRoot = json::parse(m_stream);
std::string type;
@ -36,8 +38,6 @@ namespace
return false;
}
try
{
const auto jLeaderboard = jRoot.get<JsonLeaderboardDef>();
return CreateLeaderboardFromJson(jLeaderboard, leaderboardDef);
}

View File

@ -25,6 +25,8 @@ namespace
}
bool Load(WeaponCamo& weaponCamo) const
{
try
{
const auto jRoot = json::parse(m_stream);
std::string type;
@ -39,8 +41,6 @@ namespace
return false;
}
try
{
const auto jWeaponCamo = jRoot.get<JsonWeaponCamo>();
return CreateWeaponCamoFromJson(jWeaponCamo, weaponCamo);
}

View File

@ -60,6 +60,8 @@ namespace
}
bool Load(Material& material) const
{
try
{
const auto jRoot = json::parse(m_stream);
std::string type;
@ -84,8 +86,6 @@ namespace
}
#endif
try
{
const auto jMaterial = jRoot.get<JsonMaterial>();
return CreateMaterialFromJson(jMaterial, material);
}

View File

@ -80,6 +80,8 @@ namespace
private:
bool LoadFromFile(std::istream& jsonStream, XModel& xmodel, AssetCreationContext& context, AssetRegistration<AssetXModel>& registration)
{
try
{
const auto jRoot = nlohmann::json::parse(jsonStream);
std::string type;
@ -94,8 +96,6 @@ namespace
return false;
}
try
{
const auto jXModel = jRoot.get<JsonXModel>();
return CreateXModelFromJson(jXModel, xmodel, context, registration);
}