2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-09-01 06:27:26 +00:00
Files
OpenAssetTools/src/ObjWriting/Game/IW5/Weapon/AssetDumperWeaponAttachment.cpp

23 lines
566 B
C++

#include "AssetDumperWeaponAttachment.h"
#include "Game/IW5/Weapon/JsonWeaponAttachmentWriter.h"
#include <format>
using namespace IW5;
bool AssetDumperWeaponAttachment::ShouldDump(XAssetInfo<WeaponAttachment>* asset)
{
return true;
}
void AssetDumperWeaponAttachment::DumpAsset(AssetDumpingContext& context, XAssetInfo<WeaponAttachment>* asset)
{
const auto assetFile = context.OpenAssetFile(std::format("attachment/{}.json", asset->m_name));
if (!assetFile)
return;
DumpWeaponAttachmentAsJson(*assetFile, asset->Asset(), context);
}