mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-12 07:48:16 -05:00
feat: dump t6 WeaponCamo asset as json
This commit is contained in:
55
src/ObjCommon/Game/T6/Json/JsonWeaponCamo.h
Normal file
55
src/ObjCommon/Game/T6/Json/JsonWeaponCamo.h
Normal file
@ -0,0 +1,55 @@
|
||||
#pragma once
|
||||
|
||||
#include "Game/T6/T6.h"
|
||||
|
||||
#include "Json/JsonCommon.h"
|
||||
#include "Json/JsonOptional.h"
|
||||
#include <memory>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace T6
|
||||
{
|
||||
class JsonWeaponCamoSet
|
||||
{
|
||||
public:
|
||||
std::optional<std::string> solidCamoImage;
|
||||
std::optional<std::string> patternCamoImage;
|
||||
JsonVec2 patternOffset;
|
||||
float patternScale;
|
||||
};
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(JsonWeaponCamoSet, solidCamoImage, patternCamoImage, patternOffset, patternScale);
|
||||
|
||||
class JsonWeaponCamoMaterial
|
||||
{
|
||||
public:
|
||||
unsigned replaceFlags;
|
||||
std::vector<std::string> baseMaterials;
|
||||
std::vector<std::string> camoMaterials;
|
||||
std::array<float, 8> shaderConsts;
|
||||
};
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(JsonWeaponCamoMaterial, replaceFlags, baseMaterials, camoMaterials, shaderConsts);
|
||||
|
||||
class JsonWeaponCamoMaterialSet
|
||||
{
|
||||
public:
|
||||
std::vector<JsonWeaponCamoMaterial> materials;
|
||||
};
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(JsonWeaponCamoMaterialSet, materials);
|
||||
|
||||
class JsonWeaponCamo
|
||||
{
|
||||
public:
|
||||
std::optional<std::string> solidBaseImage;
|
||||
std::optional<std::string> patternBaseImage;
|
||||
std::vector<JsonWeaponCamoSet> camoSets;
|
||||
std::vector<JsonWeaponCamoMaterialSet> camoMaterials;
|
||||
};
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(JsonWeaponCamo, solidBaseImage, patternBaseImage, camoSets, camoMaterials);
|
||||
} // namespace T6
|
33
src/ObjCommon/Json/JsonCommon.h
Normal file
33
src/ObjCommon/Json/JsonCommon.h
Normal file
@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
class JsonVec2
|
||||
{
|
||||
public:
|
||||
float x;
|
||||
float y;
|
||||
};
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(JsonVec2, x, y);
|
||||
|
||||
class JsonVec3
|
||||
{
|
||||
public:
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
};
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(JsonVec3, x, y, z);
|
||||
|
||||
class JsonVec4
|
||||
{
|
||||
public:
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
float w;
|
||||
};
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(JsonVec4, x, y, z, w);
|
Reference in New Issue
Block a user