mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-01 11:09:42 +00:00
Support parent, type and value fields in esmtool for ESM4
This commit is contained in:
parent
e7acced5e9
commit
d541436b15
5 changed files with 63 additions and 2 deletions
|
@ -97,6 +97,10 @@ namespace EsmTool
|
||||||
std::cout << "\n Id: " << value.mId;
|
std::cout << "\n Id: " << value.mId;
|
||||||
if constexpr (ESM4::hasFlags<T>)
|
if constexpr (ESM4::hasFlags<T>)
|
||||||
std::cout << "\n Record flags: " << recordFlags(value.mFlags);
|
std::cout << "\n Record flags: " << recordFlags(value.mFlags);
|
||||||
|
if constexpr (ESM4::hasParentFormId<T>)
|
||||||
|
std::cout << "\n ParentFormId: " << value.mParentFormId;
|
||||||
|
if constexpr (ESM4::hasParent<T>)
|
||||||
|
std::cout << "\n Parent: " << value.mParent;
|
||||||
if constexpr (ESM4::hasEditorId<T>)
|
if constexpr (ESM4::hasEditorId<T>)
|
||||||
std::cout << "\n EditorId: " << value.mEditorId;
|
std::cout << "\n EditorId: " << value.mEditorId;
|
||||||
if constexpr (ESM4::hasModel<T>)
|
if constexpr (ESM4::hasModel<T>)
|
||||||
|
@ -105,6 +109,10 @@ namespace EsmTool
|
||||||
std::cout << "\n Nif:" << WriteArray("\n - ", value.mNif);
|
std::cout << "\n Nif:" << WriteArray("\n - ", value.mNif);
|
||||||
if constexpr (ESM4::hasKf<T>)
|
if constexpr (ESM4::hasKf<T>)
|
||||||
std::cout << "\n Kf:" << WriteArray("\n - ", value.mKf);
|
std::cout << "\n Kf:" << WriteArray("\n - ", value.mKf);
|
||||||
|
if constexpr (ESM4::hasType<T>)
|
||||||
|
std::cout << "\n Type: " << value.mType;
|
||||||
|
if constexpr (ESM4::hasValue<T>)
|
||||||
|
std::cout << "\n Value: " << value.mValue;
|
||||||
std::cout << '\n';
|
std::cout << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -194,6 +194,7 @@ add_component_dir (esm4
|
||||||
reference
|
reference
|
||||||
script
|
script
|
||||||
readerutils
|
readerutils
|
||||||
|
typetraits
|
||||||
)
|
)
|
||||||
|
|
||||||
add_component_dir (misc
|
add_component_dir (misc
|
||||||
|
|
|
@ -81,4 +81,4 @@ namespace ESM4
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // !OPENMW_COMPONENTS_ESM4_READERUTILS
|
#endif // OPENMW_COMPONENTS_ESM4_READERUTILS
|
||||||
|
|
|
@ -31,6 +31,32 @@ namespace ESM4
|
||||||
template <class T>
|
template <class T>
|
||||||
inline constexpr bool hasId = HasId<T>::value;
|
inline constexpr bool hasId = HasId<T>::value;
|
||||||
|
|
||||||
|
template <class T, class = std::void_t<>>
|
||||||
|
struct HasParentFormId : std::false_type
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
struct HasParentFormId<T, std::void_t<decltype(T::mParentFormId)>> : std::true_type
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
inline constexpr bool hasParentFormId = HasParentFormId<T>::value;
|
||||||
|
|
||||||
|
template <class T, class = std::void_t<>>
|
||||||
|
struct HasParent : std::false_type
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
struct HasParent<T, std::void_t<decltype(T::mParent)>> : std::true_type
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
inline constexpr bool hasParent = HasParent<T>::value;
|
||||||
|
|
||||||
template <class T, class = std::void_t<>>
|
template <class T, class = std::void_t<>>
|
||||||
struct HasFlags : std::false_type
|
struct HasFlags : std::false_type
|
||||||
{
|
{
|
||||||
|
@ -95,6 +121,32 @@ namespace ESM4
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
inline constexpr bool hasKf = HasKf<T>::value;
|
inline constexpr bool hasKf = HasKf<T>::value;
|
||||||
|
|
||||||
|
template <class T, class = std::void_t<>>
|
||||||
|
struct HasType : std::false_type
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
struct HasType<T, std::void_t<decltype(T::mType)>> : std::true_type
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
inline constexpr bool hasType = HasType<T>::value;
|
||||||
|
|
||||||
|
template <class T, class = std::void_t<>>
|
||||||
|
struct HasValue : std::false_type
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
struct HasValue<T, std::void_t<decltype(T::mValue)>> : std::true_type
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
inline constexpr bool hasValue = HasValue<T>::value;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // OPENMW_COMPONENTS_ESM4_TYPETRAITS
|
#endif // OPENMW_COMPONENTS_ESM4_TYPETRAITS
|
||||||
|
|
Loading…
Reference in a new issue