mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-31 19:20:26 +00:00
Print record flags in esmtool
This commit is contained in:
parent
86d7f5a988
commit
6c87219ba3
@ -15,6 +15,7 @@
|
|||||||
#include <components/esm/records.hpp>
|
#include <components/esm/records.hpp>
|
||||||
|
|
||||||
#include "record.hpp"
|
#include "record.hpp"
|
||||||
|
#include "labels.hpp"
|
||||||
|
|
||||||
#define ESMTOOL_VERSION 1.2
|
#define ESMTOOL_VERSION 1.2
|
||||||
|
|
||||||
@ -398,7 +399,8 @@ int load(Arguments& info)
|
|||||||
|
|
||||||
if(!quiet && interested)
|
if(!quiet && interested)
|
||||||
{
|
{
|
||||||
std::cout << "\nRecord: " << n.toStringView() << " '" << record->getId() << "'\n";
|
std::cout << "\nRecord: " << n.toStringView() << " '" << record->getId() << "'\n"
|
||||||
|
<< "Record flags: " << recordFlags(record->getFlags()) << '\n';
|
||||||
record->print();
|
record->print();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -902,3 +902,17 @@ std::string weaponFlags(int flags)
|
|||||||
properties += Misc::StringUtils::format("(0x%08X)", flags);
|
properties += Misc::StringUtils::format("(0x%08X)", flags);
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string recordFlags(uint32_t flags)
|
||||||
|
{
|
||||||
|
std::string properties;
|
||||||
|
if (flags == 0) properties += "[None] ";
|
||||||
|
if (flags & ESM::FLAG_Deleted) properties += "Deleted ";
|
||||||
|
if (flags & ESM::FLAG_Persistent) properties += "Persistent ";
|
||||||
|
if (flags & ESM::FLAG_Ignored) properties += "Ignored ";
|
||||||
|
if (flags & ESM::FLAG_Blocked) properties += "Blocked ";
|
||||||
|
int unused = ~(ESM::FLAG_Deleted | ESM::FLAG_Persistent | ESM::FLAG_Ignored | ESM::FLAG_Blocked);
|
||||||
|
if (flags & unused) properties += "Invalid ";
|
||||||
|
properties += Misc::StringUtils::format("(0x%08X)", flags);
|
||||||
|
return properties;
|
||||||
|
}
|
@ -60,6 +60,8 @@ std::string raceFlags(int flags);
|
|||||||
std::string spellFlags(int flags);
|
std::string spellFlags(int flags);
|
||||||
std::string weaponFlags(int flags);
|
std::string weaponFlags(int flags);
|
||||||
|
|
||||||
|
std::string recordFlags(uint32_t flags);
|
||||||
|
|
||||||
// Missing flags functions:
|
// Missing flags functions:
|
||||||
// aiServicesFlags, possibly more
|
// aiServicesFlags, possibly more
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user