mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
UDR -> Deleted Reference, except in syntax.
Replaced all usage of UDR when actually referring to deleted references, as this was bugging me. The metadata syntax has not been changed, because `udr` is a nice short key and I don't want to break backwards compatibility.
This commit is contained in:
@@ -41,8 +41,8 @@ namespace YAML {
|
||||
|
||||
if (rhs.ITMs() > 0)
|
||||
out << Key << "itm" << Value << rhs.ITMs();
|
||||
if (rhs.UDRs() > 0)
|
||||
out << Key << "udr" << Value << rhs.UDRs();
|
||||
if (rhs.DeletedRefs() > 0)
|
||||
out << Key << "udr" << Value << rhs.DeletedRefs();
|
||||
if (rhs.DeletedNavmeshes() > 0)
|
||||
out << Key << "nav" << Value << rhs.DeletedNavmeshes();
|
||||
|
||||
|
||||
+16
-16
@@ -79,9 +79,9 @@ namespace loot {
|
||||
return id;
|
||||
}
|
||||
|
||||
PluginDirtyInfo::PluginDirtyInfo() : _crc(0), _itm(0), _udr(0), _nav(0) {}
|
||||
PluginDirtyInfo::PluginDirtyInfo() : _crc(0), _itm(0), _ref(0), _nav(0) {}
|
||||
|
||||
PluginDirtyInfo::PluginDirtyInfo(uint32_t crc, unsigned int itm, unsigned int udr, unsigned int nav, const std::string& utility) : _crc(crc), _itm(itm), _udr(udr), _nav(nav), _utility(utility) {}
|
||||
PluginDirtyInfo::PluginDirtyInfo(uint32_t crc, unsigned int itm, unsigned int ref, unsigned int nav, const std::string& utility) : _crc(crc), _itm(itm), _ref(ref), _nav(nav), _utility(utility) {}
|
||||
|
||||
bool PluginDirtyInfo::operator < (const PluginDirtyInfo& rhs) const {
|
||||
return _crc < rhs.CRC();
|
||||
@@ -95,8 +95,8 @@ namespace loot {
|
||||
return _itm;
|
||||
}
|
||||
|
||||
unsigned int PluginDirtyInfo::UDRs() const {
|
||||
return _udr;
|
||||
unsigned int PluginDirtyInfo::DeletedRefs() const {
|
||||
return _ref;
|
||||
}
|
||||
|
||||
unsigned int PluginDirtyInfo::DeletedNavmeshes() const {
|
||||
@@ -880,25 +880,25 @@ namespace loot {
|
||||
bool isDirty = false;
|
||||
for (const auto &element : _dirtyInfo) {
|
||||
boost::format f;
|
||||
if (element.ITMs() > 0 && element.UDRs() > 0 && element.DeletedNavmeshes() > 0)
|
||||
f = boost::format(boost::locale::translate("Contains %1% ITM records, %2% UDR records and %3% deleted navmeshes. Clean with %4%.")) % element.ITMs() % element.UDRs() % element.DeletedNavmeshes() % element.CleaningUtility();
|
||||
else if (element.ITMs() == 0 && element.UDRs() == 0 && element.DeletedNavmeshes() == 0)
|
||||
if (element.ITMs() > 0 && element.DeletedRefs() > 0 && element.DeletedNavmeshes() > 0)
|
||||
f = boost::format(boost::locale::translate("Contains %1% ITM records, %2% deleted references and %3% deleted navmeshes. Clean with %4%.")) % element.ITMs() % element.DeletedRefs() % element.DeletedNavmeshes() % element.CleaningUtility();
|
||||
else if (element.ITMs() == 0 && element.DeletedRefs() == 0 && element.DeletedNavmeshes() == 0)
|
||||
f = boost::format(boost::locale::translate("Clean with %1%.")) % element.CleaningUtility();
|
||||
|
||||
else if (element.ITMs() == 0 && element.UDRs() > 0 && element.DeletedNavmeshes() > 0)
|
||||
f = boost::format(boost::locale::translate("Contains %1% UDR records and %2% deleted navmeshes. Clean with %3%.")) % element.UDRs() % element.DeletedNavmeshes() % element.CleaningUtility();
|
||||
else if (element.ITMs() == 0 && element.UDRs() == 0 && element.DeletedNavmeshes() > 0)
|
||||
else if (element.ITMs() == 0 && element.DeletedRefs() > 0 && element.DeletedNavmeshes() > 0)
|
||||
f = boost::format(boost::locale::translate("Contains %1% deleted references and %2% deleted navmeshes. Clean with %3%.")) % element.DeletedRefs() % element.DeletedNavmeshes() % element.CleaningUtility();
|
||||
else if (element.ITMs() == 0 && element.DeletedRefs() == 0 && element.DeletedNavmeshes() > 0)
|
||||
f = boost::format(boost::locale::translate("Contains %1% deleted navmeshes. Clean with %2%.")) % element.DeletedNavmeshes() % element.CleaningUtility();
|
||||
else if (element.ITMs() == 0 && element.UDRs() > 0 && element.DeletedNavmeshes() == 0)
|
||||
f = boost::format(boost::locale::translate("Contains %1% UDR records. Clean with %2%.")) % element.UDRs() % element.CleaningUtility();
|
||||
else if (element.ITMs() == 0 && element.DeletedRefs() > 0 && element.DeletedNavmeshes() == 0)
|
||||
f = boost::format(boost::locale::translate("Contains %1% deleted references. Clean with %2%.")) % element.DeletedRefs() % element.CleaningUtility();
|
||||
|
||||
else if (element.ITMs() > 0 && element.UDRs() == 0 && element.DeletedNavmeshes() > 0)
|
||||
else if (element.ITMs() > 0 && element.DeletedRefs() == 0 && element.DeletedNavmeshes() > 0)
|
||||
f = boost::format(boost::locale::translate("Contains %1% ITM records and %2% deleted navmeshes. Clean with %3%.")) % element.ITMs() % element.DeletedNavmeshes() % element.CleaningUtility();
|
||||
else if (element.ITMs() > 0 && element.UDRs() == 0 && element.DeletedNavmeshes() == 0)
|
||||
else if (element.ITMs() > 0 && element.DeletedRefs() == 0 && element.DeletedNavmeshes() == 0)
|
||||
f = boost::format(boost::locale::translate("Contains %1% ITM records. Clean with %2%.")) % element.ITMs() % element.CleaningUtility();
|
||||
|
||||
else if (element.ITMs() > 0 && element.UDRs() > 0 && element.DeletedNavmeshes() == 0)
|
||||
f = boost::format(boost::locale::translate("Contains %1% ITM records and %2% UDR records. Clean with %3%.")) % element.ITMs() % element.UDRs() % element.CleaningUtility();
|
||||
else if (element.ITMs() > 0 && element.DeletedRefs() > 0 && element.DeletedNavmeshes() == 0)
|
||||
f = boost::format(boost::locale::translate("Contains %1% ITM records and %2% deleted references. Clean with %3%.")) % element.ITMs() % element.DeletedRefs() % element.CleaningUtility();
|
||||
|
||||
messages.push_back(loot::Message(loot::Message::warn, f.str()));
|
||||
isDirty = true;
|
||||
|
||||
@@ -59,19 +59,19 @@ namespace loot {
|
||||
class PluginDirtyInfo {
|
||||
public:
|
||||
PluginDirtyInfo();
|
||||
PluginDirtyInfo(uint32_t crc, unsigned int itm, unsigned int udr, unsigned int nav, const std::string& utility);
|
||||
PluginDirtyInfo(uint32_t crc, unsigned int itm, unsigned int ref, unsigned int nav, const std::string& utility);
|
||||
|
||||
bool operator < (const PluginDirtyInfo& rhs) const;
|
||||
|
||||
uint32_t CRC() const;
|
||||
unsigned int ITMs() const;
|
||||
unsigned int UDRs() const;
|
||||
unsigned int DeletedRefs() const;
|
||||
unsigned int DeletedNavmeshes() const;
|
||||
std::string CleaningUtility() const;
|
||||
private:
|
||||
uint32_t _crc;
|
||||
unsigned int _itm;
|
||||
unsigned int _udr;
|
||||
unsigned int _ref;
|
||||
unsigned int _nav;
|
||||
std::string _utility;
|
||||
};
|
||||
|
||||
@@ -120,8 +120,8 @@ namespace YAML {
|
||||
|
||||
if (rhs.ITMs() > 0)
|
||||
node["itm"] = rhs.ITMs();
|
||||
if (rhs.UDRs() > 0)
|
||||
node["udr"] = rhs.UDRs();
|
||||
if (rhs.DeletedRefs() > 0)
|
||||
node["udr"] = rhs.DeletedRefs();
|
||||
if (rhs.DeletedNavmeshes() > 0)
|
||||
node["nav"] = rhs.DeletedNavmeshes();
|
||||
|
||||
@@ -133,18 +133,18 @@ namespace YAML {
|
||||
return false;
|
||||
|
||||
uint32_t crc = node["crc"].as<uint32_t>();
|
||||
int itm = 0, udr = 0, nav = 0;
|
||||
int itm = 0, ref = 0, nav = 0;
|
||||
|
||||
if (node["itm"])
|
||||
itm = node["itm"].as<unsigned int>();
|
||||
if (node["udr"])
|
||||
udr = node["udr"].as<unsigned int>();
|
||||
ref = node["udr"].as<unsigned int>();
|
||||
if (node["nav"])
|
||||
nav = node["nav"].as<unsigned int>();
|
||||
|
||||
std::string utility = node["util"].as<std::string>();
|
||||
|
||||
rhs = loot::PluginDirtyInfo(crc, itm, udr, nav, utility);
|
||||
rhs = loot::PluginDirtyInfo(crc, itm, ref, nav, utility);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user