mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-02-14 19:33:02 +00:00
feat: report on unlinking progress
This commit is contained in:
@@ -107,22 +107,22 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
InfoString CreateInfoString(XAssetInfo<WeaponAttachmentUnique>* asset)
|
||||
InfoString CreateInfoString(const XAssetInfo<WeaponAttachmentUnique>& asset)
|
||||
{
|
||||
const auto fullDef = std::make_unique<WeaponAttachmentUniqueFull>();
|
||||
memset(fullDef.get(), 0, sizeof(WeaponAttachmentUniqueFull));
|
||||
CopyToFullDef(asset->Asset(), fullDef.get());
|
||||
CopyToFullDef(asset.Asset(), fullDef.get());
|
||||
|
||||
InfoStringFromWeaponAttachmentUniqueConverter converter(fullDef.get(),
|
||||
attachment_unique_fields,
|
||||
std::extent_v<decltype(attachment_unique_fields)>,
|
||||
[asset](const scr_string_t scrStr) -> std::string
|
||||
{
|
||||
assert(scrStr < asset->m_zone->m_script_strings.Count());
|
||||
if (scrStr >= asset->m_zone->m_script_strings.Count())
|
||||
assert(scrStr < asset.m_zone->m_script_strings.Count());
|
||||
if (scrStr >= asset.m_zone->m_script_strings.Count())
|
||||
return "";
|
||||
|
||||
return asset->m_zone->m_script_strings[scrStr];
|
||||
return asset.m_zone->m_script_strings[scrStr];
|
||||
});
|
||||
|
||||
return converter.Convert();
|
||||
@@ -131,24 +131,19 @@ namespace
|
||||
|
||||
namespace attachment_unique
|
||||
{
|
||||
bool DumperT6::ShouldDump(XAssetInfo<WeaponAttachmentUnique>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void DumperT6::DumpAsset(AssetDumpingContext& context, XAssetInfo<WeaponAttachmentUnique>* asset)
|
||||
void DumperT6::DumpAsset(AssetDumpingContext& context, const XAssetInfo<WeaponAttachmentUnique>& asset)
|
||||
{
|
||||
// Only dump raw when no gdt available
|
||||
if (context.m_gdt)
|
||||
{
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
GdtEntry gdtEntry(asset->m_name, ObjConstants::GDF_FILENAME_WEAPON_ATTACHMENT_UNIQUE);
|
||||
GdtEntry gdtEntry(asset.m_name, ObjConstants::GDF_FILENAME_WEAPON_ATTACHMENT_UNIQUE);
|
||||
infoString.ToGdtProperties(ObjConstants::INFO_STRING_PREFIX_WEAPON_ATTACHMENT_UNIQUE, gdtEntry);
|
||||
context.m_gdt->WriteEntry(gdtEntry);
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto assetFile = context.OpenAssetFile(GetFileNameForAssetName(asset->m_name));
|
||||
const auto assetFile = context.OpenAssetFile(GetFileNameForAssetName(asset.m_name));
|
||||
|
||||
if (!assetFile)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user