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:
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user