2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-02-14 19:33:02 +00:00

refactor: move iw3,iw4,iw5,t5 dumpers into seperate folders

This commit is contained in:
Jan Laupetin
2025-07-25 21:23:49 +01:00
parent 64bd89dc46
commit 39fe9965d1
143 changed files with 70 additions and 69 deletions

View File

@@ -0,0 +1,28 @@
#include "AssetDumperLeaderboardDef.h"
#include "Game/T6/Leaderboard/JsonLeaderboardDefWriter.h"
#include <format>
#include <ranges>
using namespace T6;
std::string AssetDumperLeaderboardDef::GetFileNameForAsset(const std::string& assetName)
{
return std::format("leaderboards/{}.json", assetName);
}
bool AssetDumperLeaderboardDef::ShouldDump(XAssetInfo<LeaderboardDef>* asset)
{
return true;
}
void AssetDumperLeaderboardDef::DumpAsset(AssetDumpingContext& context, XAssetInfo<LeaderboardDef>* asset)
{
const auto assetFile = context.OpenAssetFile(GetFileNameForAsset(asset->m_name));
if (!assetFile)
return;
DumpLeaderboardDefAsJson(*assetFile, asset->Asset());
}

View File

@@ -0,0 +1,16 @@
#pragma once
#include "Dumping/AbstractAssetDumper.h"
#include "Game/T6/T6.h"
namespace T6
{
class AssetDumperLeaderboardDef final : public AbstractAssetDumper<LeaderboardDef>
{
static std::string GetFileNameForAsset(const std::string& assetName);
protected:
_NODISCARD bool ShouldDump(XAssetInfo<LeaderboardDef>* asset) override;
void DumpAsset(AssetDumpingContext& context, XAssetInfo<LeaderboardDef>* asset) override;
};
} // namespace T6