mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-11 07:18:11 -05:00
chore: dump iw5 weapon notetrack overrides
This commit is contained in:
@ -233,6 +233,10 @@ namespace IW5
|
||||
FillFromReloadOverrides(std::string(field.szName));
|
||||
break;
|
||||
|
||||
case WFT_NOTETRACK_OVERRIDES:
|
||||
FillFromNoteTrackOverrides(std::string(field.szName));
|
||||
break;
|
||||
|
||||
case WFT_NUM_FIELD_TYPES:
|
||||
default:
|
||||
assert(false);
|
||||
@ -492,6 +496,40 @@ namespace IW5
|
||||
m_info_string.SetValueForKey(key, ss.str());
|
||||
}
|
||||
|
||||
void FillFromNoteTrackOverrides(const std::string& key)
|
||||
{
|
||||
std::stringstream ss;
|
||||
bool first = true;
|
||||
|
||||
for (auto i = 0u; i < m_weapon->weapCompleteDef.numNotetrackOverrides; i++)
|
||||
{
|
||||
const auto& noteTrackOverrides = m_weapon->weapCompleteDef.notetrackOverrides[i];
|
||||
|
||||
assert(noteTrackOverrides.notetrackSoundMapKeys || noteTrackOverrides.notetrackSoundMapValues);
|
||||
if (!noteTrackOverrides.notetrackSoundMapKeys || !noteTrackOverrides.notetrackSoundMapValues)
|
||||
continue;
|
||||
|
||||
const auto attachmentName = noteTrackOverrides.attachment.fields ? GetNameForSingleWeaponAttachment(noteTrackOverrides.attachment) : "none";
|
||||
for (auto j = 0u; j < 24u; j++)
|
||||
{
|
||||
const auto& noteTrackKey = m_get_scr_string(noteTrackOverrides.notetrackSoundMapKeys[j]);
|
||||
const auto& noteTrackValue = m_get_scr_string(noteTrackOverrides.notetrackSoundMapValues[j]);
|
||||
|
||||
if (noteTrackKey.empty() || noteTrackValue.empty())
|
||||
continue;
|
||||
|
||||
if (!first)
|
||||
ss << "\n";
|
||||
else
|
||||
first = false;
|
||||
|
||||
ss << attachmentName << ' ' << noteTrackKey << ' ' << noteTrackValue;
|
||||
}
|
||||
}
|
||||
|
||||
m_info_string.SetValueForKey(key, ss.str());
|
||||
}
|
||||
|
||||
const WeaponFullDef* m_weapon;
|
||||
};
|
||||
} // namespace IW5
|
||||
|
Reference in New Issue
Block a user