mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-18 13:12:50 +00:00
Print ESM4 EditorId and Model by esmtool dump
This commit is contained in:
parent
4f7dcd5ae5
commit
a9826342b2
@ -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…
x
Reference in New Issue
Block a user