Unlinker: Do not list localized strings one by one in the zone file and do not include keyvaluepairs at all because they should be in the meta data

This commit is contained in:
Jan
2020-02-19 14:45:55 +01:00
parent f0b66f0a35
commit 14593b4799
3 changed files with 31 additions and 12 deletions

View File

@ -5,6 +5,7 @@
#include <sstream>
#include <iomanip>
#include <cassert>
using namespace T6;
@ -47,6 +48,35 @@ class ZoneDefWriterT6Impl final : public AbstractZoneDefWriter
WriteMetaData(str.str(), kvp->value);
}
void WriteContent() const
{
const auto* pools = dynamic_cast<GameAssetPoolT6*>(m_zone->GetPools());
assert(pools);
if (!pools)
return;
// Localized strings are all collected in one string file. So only add this to the zone file.
if(!pools->m_localize->m_asset_lookup.empty())
{
WriteEntry(pools->GetAssetTypeName(ASSET_TYPE_LOCALIZE_ENTRY), m_zone->m_name);
}
for (const auto& asset : *pools)
{
switch (asset->m_type)
{
case ASSET_TYPE_LOCALIZE_ENTRY:
case ASSET_TYPE_KEYVALUEPAIRS: // KeyValuePairs should be included as zone file metadata and not as content
break;
default:
WriteEntry(pools->GetAssetTypeName(asset->m_type), asset->m_name);
break;
}
}
}
public:
ZoneDefWriterT6Impl(Zone* zone, FileAPI::IFile* file)
: AbstractZoneDefWriter(zone, file)