mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-09-04 15:57:26 +00:00
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
|
bool Load(LeaderboardDef& leaderboardDef) const
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
const auto jRoot = json::parse(m_stream);
|
const auto jRoot = json::parse(m_stream);
|
||||||
std::string type;
|
std::string type;
|
||||||
@@ -36,8 +38,6 @@ namespace
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
const auto jLeaderboard = jRoot.get<JsonLeaderboardDef>();
|
const auto jLeaderboard = jRoot.get<JsonLeaderboardDef>();
|
||||||
return CreateLeaderboardFromJson(jLeaderboard, leaderboardDef);
|
return CreateLeaderboardFromJson(jLeaderboard, leaderboardDef);
|
||||||
}
|
}
|
||||||
|
@@ -22,6 +22,8 @@ namespace
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Load(LeaderboardDef& leaderboardDef) const
|
bool Load(LeaderboardDef& leaderboardDef) const
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
const auto jRoot = json::parse(m_stream);
|
const auto jRoot = json::parse(m_stream);
|
||||||
std::string type;
|
std::string type;
|
||||||
@@ -36,8 +38,6 @@ namespace
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
const auto jLeaderboard = jRoot.get<JsonLeaderboardDef>();
|
const auto jLeaderboard = jRoot.get<JsonLeaderboardDef>();
|
||||||
return CreateLeaderboardFromJson(jLeaderboard, leaderboardDef);
|
return CreateLeaderboardFromJson(jLeaderboard, leaderboardDef);
|
||||||
}
|
}
|
||||||
|
@@ -25,6 +25,8 @@ namespace
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Load(WeaponAttachment& attachment) const
|
bool Load(WeaponAttachment& attachment) const
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
const auto jRoot = json::parse(m_stream);
|
const auto jRoot = json::parse(m_stream);
|
||||||
std::string type;
|
std::string type;
|
||||||
@@ -39,8 +41,6 @@ namespace
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
const auto jAttachment = jRoot.get<JsonWeaponAttachment>();
|
const auto jAttachment = jRoot.get<JsonWeaponAttachment>();
|
||||||
return CreateWeaponAttachmentFromJson(jAttachment, attachment);
|
return CreateWeaponAttachmentFromJson(jAttachment, attachment);
|
||||||
}
|
}
|
||||||
|
@@ -22,6 +22,8 @@ namespace
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Load(LeaderboardDef& leaderboardDef) const
|
bool Load(LeaderboardDef& leaderboardDef) const
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
const auto jRoot = json::parse(m_stream);
|
const auto jRoot = json::parse(m_stream);
|
||||||
std::string type;
|
std::string type;
|
||||||
@@ -36,8 +38,6 @@ namespace
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
const auto jLeaderboard = jRoot.get<JsonLeaderboardDef>();
|
const auto jLeaderboard = jRoot.get<JsonLeaderboardDef>();
|
||||||
return CreateLeaderboardFromJson(jLeaderboard, leaderboardDef);
|
return CreateLeaderboardFromJson(jLeaderboard, leaderboardDef);
|
||||||
}
|
}
|
||||||
|
@@ -25,6 +25,8 @@ namespace
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Load(WeaponCamo& weaponCamo) const
|
bool Load(WeaponCamo& weaponCamo) const
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
const auto jRoot = json::parse(m_stream);
|
const auto jRoot = json::parse(m_stream);
|
||||||
std::string type;
|
std::string type;
|
||||||
@@ -39,8 +41,6 @@ namespace
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
const auto jWeaponCamo = jRoot.get<JsonWeaponCamo>();
|
const auto jWeaponCamo = jRoot.get<JsonWeaponCamo>();
|
||||||
return CreateWeaponCamoFromJson(jWeaponCamo, weaponCamo);
|
return CreateWeaponCamoFromJson(jWeaponCamo, weaponCamo);
|
||||||
}
|
}
|
||||||
|
@@ -60,6 +60,8 @@ namespace
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Load(Material& material) const
|
bool Load(Material& material) const
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
const auto jRoot = json::parse(m_stream);
|
const auto jRoot = json::parse(m_stream);
|
||||||
std::string type;
|
std::string type;
|
||||||
@@ -84,8 +86,6 @@ namespace
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
const auto jMaterial = jRoot.get<JsonMaterial>();
|
const auto jMaterial = jRoot.get<JsonMaterial>();
|
||||||
return CreateMaterialFromJson(jMaterial, material);
|
return CreateMaterialFromJson(jMaterial, material);
|
||||||
}
|
}
|
||||||
|
@@ -80,6 +80,8 @@ namespace
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool LoadFromFile(std::istream& jsonStream, XModel& xmodel, AssetCreationContext& context, AssetRegistration<AssetXModel>& registration)
|
bool LoadFromFile(std::istream& jsonStream, XModel& xmodel, AssetCreationContext& context, AssetRegistration<AssetXModel>& registration)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
const auto jRoot = nlohmann::json::parse(jsonStream);
|
const auto jRoot = nlohmann::json::parse(jsonStream);
|
||||||
std::string type;
|
std::string type;
|
||||||
@@ -94,8 +96,6 @@ namespace
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
const auto jXModel = jRoot.get<JsonXModel>();
|
const auto jXModel = jRoot.get<JsonXModel>();
|
||||||
return CreateXModelFromJson(jXModel, xmodel, context, registration);
|
return CreateXModelFromJson(jXModel, xmodel, context, registration);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user