mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-12 07:48:16 -05:00
Add ZoneScriptString class to store zone script strings
This commit is contained in:
@ -218,8 +218,8 @@ InfoString AssetDumperVehicle::CreateInfoString(XAssetInfo<VehicleDef>* asset)
|
||||
{
|
||||
InfoStringFromVehicleConverter converter(asset->Asset(), vehicle_fields, std::extent<decltype(vehicle_fields)>::value, [asset](const scr_string_t scrStr) -> std::string
|
||||
{
|
||||
assert(scrStr < asset->m_zone->m_script_strings.size());
|
||||
if (scrStr >= asset->m_zone->m_script_strings.size())
|
||||
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];
|
||||
|
@ -998,8 +998,8 @@ InfoString AssetDumperWeapon::CreateInfoString(XAssetInfo<WeaponCompleteDef>* as
|
||||
|
||||
InfoStringFromWeaponConverter converter(fullDef.get(), weapon_fields, std::extent<decltype(weapon_fields)>::value, [asset](const scr_string_t scrStr) -> std::string
|
||||
{
|
||||
assert(scrStr < asset->m_zone->m_script_strings.size());
|
||||
if (scrStr >= asset->m_zone->m_script_strings.size())
|
||||
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];
|
||||
|
@ -122,8 +122,8 @@ InfoString AssetDumperPhysConstraints::CreateInfoString(XAssetInfo<PhysConstrain
|
||||
|
||||
InfoStringFromPhysConstraintsConverter converter(asset->Asset(), phys_constraints_fields, std::extent<decltype(phys_constraints_fields)>::value, [asset](const scr_string_t scrStr) -> std::string
|
||||
{
|
||||
assert(scrStr < asset->m_zone->m_script_strings.size());
|
||||
if (scrStr >= asset->m_zone->m_script_strings.size())
|
||||
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];
|
||||
|
@ -84,8 +84,8 @@ InfoString AssetDumperPhysPreset::CreateInfoString(XAssetInfo<PhysPreset>* asset
|
||||
|
||||
InfoStringFromPhysPresetConverter converter(physPresetInfo, physpreset_fields, std::extent<decltype(physpreset_fields)>::value, [asset](const scr_string_t scrStr) -> std::string
|
||||
{
|
||||
assert(scrStr < asset->m_zone->m_script_strings.size());
|
||||
if (scrStr >= asset->m_zone->m_script_strings.size())
|
||||
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];
|
||||
|
@ -10,37 +10,37 @@ using namespace T6;
|
||||
|
||||
cspField_t AssetDumperTracer::tracer_fields[]
|
||||
{
|
||||
{ "type", offsetof(TracerDef, type), TFT_TRACERTYPE },
|
||||
{ "material", offsetof(TracerDef, material), CSPFT_MATERIAL },
|
||||
{ "drawInterval", offsetof(TracerDef, drawInterval), CSPFT_INT },
|
||||
{ "speed", offsetof(TracerDef, speed), CSPFT_FLOAT },
|
||||
{ "beamLength", offsetof(TracerDef, beamLength), CSPFT_FLOAT },
|
||||
{ "beamWidth", offsetof(TracerDef, beamWidth), CSPFT_FLOAT },
|
||||
{ "screwRadius", offsetof(TracerDef, screwRadius), CSPFT_FLOAT },
|
||||
{ "screwDist", offsetof(TracerDef, screwDist), CSPFT_FLOAT },
|
||||
{ "fadeTime", offsetof(TracerDef, fadeTime), CSPFT_FLOAT },
|
||||
{ "fadeScale", offsetof(TracerDef, fadeScale), CSPFT_FLOAT },
|
||||
{ "texRepeatRate", offsetof(TracerDef, texRepeatRate), CSPFT_FLOAT },
|
||||
{ "colorR0", offsetof(TracerDef, colors[0].r), CSPFT_FLOAT },
|
||||
{ "colorG0", offsetof(TracerDef, colors[0].g), CSPFT_FLOAT },
|
||||
{ "colorB0", offsetof(TracerDef, colors[0].b), CSPFT_FLOAT },
|
||||
{ "colorA0", offsetof(TracerDef, colors[0].a), CSPFT_FLOAT },
|
||||
{ "colorR1", offsetof(TracerDef, colors[1].r), CSPFT_FLOAT },
|
||||
{ "colorG1", offsetof(TracerDef, colors[1].g), CSPFT_FLOAT },
|
||||
{ "colorB1", offsetof(TracerDef, colors[1].b), CSPFT_FLOAT },
|
||||
{ "colorA1", offsetof(TracerDef, colors[1].a), CSPFT_FLOAT },
|
||||
{ "colorR2", offsetof(TracerDef, colors[2].r), CSPFT_FLOAT },
|
||||
{ "colorG2", offsetof(TracerDef, colors[2].g), CSPFT_FLOAT },
|
||||
{ "colorB2", offsetof(TracerDef, colors[2].b), CSPFT_FLOAT },
|
||||
{ "colorA2", offsetof(TracerDef, colors[2].a), CSPFT_FLOAT },
|
||||
{ "colorR3", offsetof(TracerDef, colors[3].r), CSPFT_FLOAT },
|
||||
{ "colorG3", offsetof(TracerDef, colors[3].g), CSPFT_FLOAT },
|
||||
{ "colorB3", offsetof(TracerDef, colors[3].b), CSPFT_FLOAT },
|
||||
{ "colorA3", offsetof(TracerDef, colors[3].a), CSPFT_FLOAT },
|
||||
{ "colorR4", offsetof(TracerDef, colors[4].r), CSPFT_FLOAT },
|
||||
{ "colorG4", offsetof(TracerDef, colors[4].g), CSPFT_FLOAT },
|
||||
{ "colorB4", offsetof(TracerDef, colors[4].b), CSPFT_FLOAT },
|
||||
{ "colorA4", offsetof(TracerDef, colors[4].a), CSPFT_FLOAT }
|
||||
{"type", offsetof(TracerDef, type), TFT_TRACERTYPE},
|
||||
{"material", offsetof(TracerDef, material), CSPFT_MATERIAL},
|
||||
{"drawInterval", offsetof(TracerDef, drawInterval), CSPFT_INT},
|
||||
{"speed", offsetof(TracerDef, speed), CSPFT_FLOAT},
|
||||
{"beamLength", offsetof(TracerDef, beamLength), CSPFT_FLOAT},
|
||||
{"beamWidth", offsetof(TracerDef, beamWidth), CSPFT_FLOAT},
|
||||
{"screwRadius", offsetof(TracerDef, screwRadius), CSPFT_FLOAT},
|
||||
{"screwDist", offsetof(TracerDef, screwDist), CSPFT_FLOAT},
|
||||
{"fadeTime", offsetof(TracerDef, fadeTime), CSPFT_FLOAT},
|
||||
{"fadeScale", offsetof(TracerDef, fadeScale), CSPFT_FLOAT},
|
||||
{"texRepeatRate", offsetof(TracerDef, texRepeatRate), CSPFT_FLOAT},
|
||||
{"colorR0", offsetof(TracerDef, colors[0].r), CSPFT_FLOAT},
|
||||
{"colorG0", offsetof(TracerDef, colors[0].g), CSPFT_FLOAT},
|
||||
{"colorB0", offsetof(TracerDef, colors[0].b), CSPFT_FLOAT},
|
||||
{"colorA0", offsetof(TracerDef, colors[0].a), CSPFT_FLOAT},
|
||||
{"colorR1", offsetof(TracerDef, colors[1].r), CSPFT_FLOAT},
|
||||
{"colorG1", offsetof(TracerDef, colors[1].g), CSPFT_FLOAT},
|
||||
{"colorB1", offsetof(TracerDef, colors[1].b), CSPFT_FLOAT},
|
||||
{"colorA1", offsetof(TracerDef, colors[1].a), CSPFT_FLOAT},
|
||||
{"colorR2", offsetof(TracerDef, colors[2].r), CSPFT_FLOAT},
|
||||
{"colorG2", offsetof(TracerDef, colors[2].g), CSPFT_FLOAT},
|
||||
{"colorB2", offsetof(TracerDef, colors[2].b), CSPFT_FLOAT},
|
||||
{"colorA2", offsetof(TracerDef, colors[2].a), CSPFT_FLOAT},
|
||||
{"colorR3", offsetof(TracerDef, colors[3].r), CSPFT_FLOAT},
|
||||
{"colorG3", offsetof(TracerDef, colors[3].g), CSPFT_FLOAT},
|
||||
{"colorB3", offsetof(TracerDef, colors[3].b), CSPFT_FLOAT},
|
||||
{"colorA3", offsetof(TracerDef, colors[3].a), CSPFT_FLOAT},
|
||||
{"colorR4", offsetof(TracerDef, colors[4].r), CSPFT_FLOAT},
|
||||
{"colorG4", offsetof(TracerDef, colors[4].g), CSPFT_FLOAT},
|
||||
{"colorB4", offsetof(TracerDef, colors[4].b), CSPFT_FLOAT},
|
||||
{"colorA4", offsetof(TracerDef, colors[4].a), CSPFT_FLOAT}
|
||||
};
|
||||
|
||||
namespace T6
|
||||
@ -74,13 +74,13 @@ namespace T6
|
||||
InfoString AssetDumperTracer::CreateInfoString(XAssetInfo<TracerDef>* asset)
|
||||
{
|
||||
InfoStringFromTracerConverter converter(asset->Asset(), tracer_fields, std::extent<decltype(tracer_fields)>::value, [asset](const scr_string_t scrStr) -> std::string
|
||||
{
|
||||
assert(scrStr < asset->m_zone->m_script_strings.size());
|
||||
if (scrStr >= asset->m_zone->m_script_strings.size())
|
||||
return "";
|
||||
{
|
||||
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();
|
||||
}
|
||||
@ -119,4 +119,4 @@ void AssetDumperTracer::DumpRaw(AssetDumpingContext& context, XAssetInfo<TracerD
|
||||
const auto infoString = CreateInfoString(asset);
|
||||
const auto stringValue = infoString.ToString("TRACER");
|
||||
stream.write(stringValue.c_str(), stringValue.size());
|
||||
}
|
||||
}
|
||||
|
@ -646,13 +646,13 @@ namespace T6
|
||||
InfoString AssetDumperVehicle::CreateInfoString(XAssetInfo<VehicleDef>* asset)
|
||||
{
|
||||
InfoStringFromVehicleConverter converter(asset->Asset(), vehicle_fields, std::extent<decltype(vehicle_fields)>::value, [asset](const scr_string_t scrStr) -> std::string
|
||||
{
|
||||
assert(scrStr < asset->m_zone->m_script_strings.size());
|
||||
if (scrStr >= asset->m_zone->m_script_strings.size())
|
||||
return "";
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
@ -1385,13 +1385,13 @@ InfoString AssetDumperWeapon::CreateInfoString(XAssetInfo<WeaponVariantDef>* ass
|
||||
CopyToFullDef(asset->Asset(), fullDef.get());
|
||||
|
||||
InfoStringFromWeaponConverter converter(fullDef.get(), weapon_fields, std::extent<decltype(weapon_fields)>::value, [asset](const scr_string_t scrStr) -> std::string
|
||||
{
|
||||
assert(scrStr < asset->m_zone->m_script_strings.size());
|
||||
if (scrStr >= asset->m_zone->m_script_strings.size())
|
||||
return "";
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
@ -128,8 +128,8 @@ InfoString AssetDumperWeaponAttachment::CreateInfoString(XAssetInfo<WeaponAttach
|
||||
{
|
||||
InfoStringFromAttachmentConverter converter(asset->Asset(), attachment_fields, std::extent<decltype(attachment_fields)>::value, [asset](const scr_string_t scrStr) -> std::string
|
||||
{
|
||||
assert(scrStr < asset->m_zone->m_script_strings.size());
|
||||
if (scrStr >= asset->m_zone->m_script_strings.size())
|
||||
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];
|
||||
|
@ -319,8 +319,8 @@ InfoString AssetDumperWeaponAttachmentUnique::CreateInfoString(XAssetInfo<Weapon
|
||||
fullDef.get(), attachment_unique_fields, std::extent<decltype(attachment_unique_fields)>::value,
|
||||
[asset](const scr_string_t scrStr) -> std::string
|
||||
{
|
||||
assert(scrStr < asset->m_zone->m_script_strings.size());
|
||||
if (scrStr >= asset->m_zone->m_script_strings.size())
|
||||
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];
|
||||
|
@ -178,8 +178,8 @@ InfoString AssetDumperZBarrier::CreateInfoString(XAssetInfo<ZBarrierDef>* asset)
|
||||
{
|
||||
InfoStringFromZBarrierConverter converter(asset->Asset(), zbarrier_fields, std::extent<decltype(zbarrier_fields)>::value, [asset](const scr_string_t scrStr) -> std::string
|
||||
{
|
||||
assert(scrStr < asset->m_zone->m_script_strings.size());
|
||||
if (scrStr >= asset->m_zone->m_script_strings.size())
|
||||
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];
|
||||
|
Reference in New Issue
Block a user