Print ESM4 EditorId and Model by esmtool dump

crashfix_debugdraw
elsid 2 years ago
parent 4f7dcd5ae5
commit a9826342b2
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -62,6 +62,24 @@ namespace EsmTool
template <class T>
constexpr bool hasFlags = HasFlags<T>::value;
template <class T, class = std::void_t<>>
struct HasEditorId : std::false_type {};
template <class T>
struct HasEditorId<T, std::void_t<decltype(T::mEditorId)>> : std::true_type {};
template <class T>
constexpr bool hasEditorId = HasEditorId<T>::value;
template <class T, class = std::void_t<>>
struct HasModel : std::false_type {};
template <class T>
struct HasModel<T, std::void_t<decltype(T::mModel)>> : std::true_type {};
template <class T>
constexpr bool hasModel = HasModel<T>::value;
template <class T>
void readTypedRecord(const Params& params, ESM4::Reader& reader)
{
@ -75,9 +93,13 @@ namespace EsmTool
std::cout << "\n Record: " << ESM::NAME(reader.hdr().record.typeId).toStringView();
if constexpr (hasFormId<T>)
std::cout << ' ' << value.mFormId;
std::cout << "\n FormId: " << value.mFormId;
if constexpr (hasFlags<T>)
std::cout << "\n Record flags: " << recordFlags(value.mFlags);
if constexpr (hasEditorId<T>)
std::cout << "\n EditorId: " << value.mEditorId;
if constexpr (hasModel<T>)
std::cout << "\n Model: " << value.mModel;
std::cout << '\n';
}

Loading…
Cancel
Save