From a9826342b278d85e00e9f0bf81aa80308ca6c801 Mon Sep 17 00:00:00 2001 From: elsid Date: Mon, 12 Sep 2022 01:33:13 +0200 Subject: [PATCH] Print ESM4 EditorId and Model by esmtool dump --- apps/esmtool/tes4.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/apps/esmtool/tes4.cpp b/apps/esmtool/tes4.cpp index 815eb6dd34..2959b8145a 100644 --- a/apps/esmtool/tes4.cpp +++ b/apps/esmtool/tes4.cpp @@ -62,6 +62,24 @@ namespace EsmTool template constexpr bool hasFlags = HasFlags::value; + template > + struct HasEditorId : std::false_type {}; + + template + struct HasEditorId> : std::true_type {}; + + template + constexpr bool hasEditorId = HasEditorId::value; + + template > + struct HasModel : std::false_type {}; + + template + struct HasModel> : std::true_type {}; + + template + constexpr bool hasModel = HasModel::value; + template 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) - std::cout << ' ' << value.mFormId; + std::cout << "\n FormId: " << value.mFormId; if constexpr (hasFlags) std::cout << "\n Record flags: " << recordFlags(value.mFlags); + if constexpr (hasEditorId) + std::cout << "\n EditorId: " << value.mEditorId; + if constexpr (hasModel) + std::cout << "\n Model: " << value.mModel; std::cout << '\n'; }