mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Removed separate cleaning guide URL field from dirty info data storage.
This commit is contained in:
+24
-24
@@ -411,28 +411,29 @@ namespace boss {
|
||||
}
|
||||
}
|
||||
|
||||
std::set<DirtData> dirtyInfo = it->DirtyInfo();
|
||||
for (std::set<DirtData>::const_iterator jt=dirtyInfo.begin(), endjt=dirtyInfo.end(); jt != endjt; ++jt) {
|
||||
std::set<PluginDirtyInfo> dirtyInfo = it->DirtyInfo();
|
||||
for (std::set<PluginDirtyInfo>::const_iterator jt=dirtyInfo.begin(), endjt=dirtyInfo.end(); jt != endjt; ++jt) {
|
||||
boost::format f;
|
||||
if (jt->ITMs() > -1 && jt->UDRs() > -1 && jt->DeletedNavmeshes() > -1)
|
||||
f = boost::format(boost::locale::translate("Contains %1% ITM records, %2% UDR records and %3% deleted navmeshes. Needs %4% cleaning, a guide is available \"%5% here\".")) % jt->ITMs() % jt->UDRs() % jt->DeletedNavmeshes() % jt->CleaningUtility() % jt->CleaningGuideURL();
|
||||
else if (jt->ITMs() == -1 && jt->UDRs() == -1 && jt->DeletedNavmeshes() == -1)
|
||||
f = boost::format(boost::locale::translate("Needs %1% cleaning, a guide is available \"%2% here\".")) % jt->CleaningUtility() % jt->CleaningGuideURL();
|
||||
if (jt->ITMs() > 0 && jt->UDRs() > 0 && jt->DeletedNavmeshes() > 0)
|
||||
f = boost::format(boost::locale::translate("Contains %1% ITM records, %2% UDR records and %3% deleted navmeshes. Clean with %4%.")) % jt->ITMs() % jt->UDRs() % jt->DeletedNavmeshes() % jt->CleaningUtility();
|
||||
else if (jt->ITMs() == 0 && jt->UDRs() == 0 && jt->DeletedNavmeshes() == 0)
|
||||
f = boost::format(boost::locale::translate("Clean with %1%.")) % jt->CleaningUtility();
|
||||
|
||||
else if (jt->ITMs() == -1 && jt->UDRs() > -1 && jt->DeletedNavmeshes() > -1)
|
||||
f = boost::format(boost::locale::translate("Contains %1% UDR records and %2% deleted navmeshes. Needs %3% cleaning, a guide is available \"%4% here\".")) % jt->UDRs() % jt->DeletedNavmeshes() % jt->CleaningUtility() % jt->CleaningGuideURL();
|
||||
else if (jt->ITMs() == -1 && jt->UDRs() == -1 && jt->DeletedNavmeshes() > -1)
|
||||
f = boost::format(boost::locale::translate("Contains %1% deleted navmeshes. Needs %2% cleaning, a guide is available \"%3% here\".")) % jt->DeletedNavmeshes() % jt->CleaningUtility() % jt->CleaningGuideURL();
|
||||
else if (jt->ITMs() == -1 && jt->UDRs() > -1 && jt->DeletedNavmeshes() == -1)
|
||||
f = boost::format(boost::locale::translate("Contains %1% UDR records. Needs %2% cleaning, a guide is available \"%3% here\".")) % jt->UDRs() % jt->CleaningUtility() % jt->CleaningGuideURL();
|
||||
|
||||
else if (jt->ITMs() > -1 && jt->UDRs() == -1 && jt->DeletedNavmeshes() > -1)
|
||||
f = boost::format(boost::locale::translate("Contains %1% ITM records and %2% deleted navmeshes. Needs %3% cleaning, a guide is available \"%4% here\".")) % jt->ITMs() % jt->DeletedNavmeshes() % jt->CleaningUtility() % jt->CleaningGuideURL();
|
||||
else if (jt->ITMs() > -1 && jt->UDRs() == -1 && jt->DeletedNavmeshes() == -1)
|
||||
f = boost::format(boost::locale::translate("Contains %1% ITM records. Needs %2% cleaning, a guide is available \"%3% here\".")) % jt->ITMs() % jt->CleaningUtility() % jt->CleaningGuideURL();
|
||||
else if (jt->ITMs() == 0 && jt->UDRs() > 0 && jt->DeletedNavmeshes() > 0)
|
||||
f = boost::format(boost::locale::translate("Contains %1% UDR records and %2% deleted navmeshes. Clean with %3%.")) % jt->UDRs() % jt->DeletedNavmeshes() % jt->CleaningUtility();
|
||||
else if (jt->ITMs() == 0 && jt->UDRs() == 0 && jt->DeletedNavmeshes() > 0)
|
||||
f = boost::format(boost::locale::translate("Contains %1% deleted navmeshes. Clean with %2%.")) % jt->DeletedNavmeshes() % jt->CleaningUtility();
|
||||
else if (jt->ITMs() == 0 && jt->UDRs() > 0 && jt->DeletedNavmeshes() == 0)
|
||||
f = boost::format(boost::locale::translate("Contains %1% UDR records. Clean with %2%.")) % jt->UDRs() % jt->CleaningUtility();
|
||||
|
||||
else if (jt->ITMs() > -1 && jt->UDRs() > -1 && jt->DeletedNavmeshes() == -1)
|
||||
f = boost::format(boost::locale::translate("Contains %1% ITM records and %2% UDR records. Needs %3% cleaning, a guide is available \"%4% here\".")) % jt->ITMs() % jt->UDRs() % jt->CleaningUtility() % jt->CleaningGuideURL();
|
||||
else if (jt->ITMs() > 0 && jt->UDRs() == 0 && jt->DeletedNavmeshes() > 0)
|
||||
f = boost::format(boost::locale::translate("Contains %1% ITM records and %2% deleted navmeshes. Clean with %3%.")) % jt->ITMs() % jt->DeletedNavmeshes() % jt->CleaningUtility();
|
||||
else if (jt->ITMs() > 0 && jt->UDRs() == 0 && jt->DeletedNavmeshes() == 0)
|
||||
f = boost::format(boost::locale::translate("Contains %1% ITM records. Clean with %2%.")) % jt->ITMs() % jt->CleaningUtility();
|
||||
|
||||
else if (jt->ITMs() > 0 && jt->UDRs() > 0 && jt->DeletedNavmeshes() == 0)
|
||||
f = boost::format(boost::locale::translate("Contains %1% ITM records and %2% UDR records. Clean with %3%.")) % jt->ITMs() % jt->UDRs() % jt->CleaningUtility();
|
||||
|
||||
messages.push_back(boss::Message(boss::g_message_warn, f.str()));
|
||||
}
|
||||
@@ -677,17 +678,16 @@ namespace YAML {
|
||||
out << EndSeq;
|
||||
}
|
||||
|
||||
inline Emitter& operator << (Emitter& out, const boss::DirtData& rhs) {
|
||||
inline Emitter& operator << (Emitter& out, const boss::PluginDirtyInfo& rhs) {
|
||||
out << BeginMap
|
||||
<< Key << "crc" << Value << rhs.CRC()
|
||||
<< Key << "util" << Value << rhs.CleaningUtility()
|
||||
<< Key << "guide" << Value << rhs.CleaningGuideURL();
|
||||
<< Key << "util" << Value << rhs.CleaningUtility();
|
||||
|
||||
if (rhs.ITMs() > -1)
|
||||
if (rhs.ITMs() > 0)
|
||||
out << Key << "itm" << Value << rhs.ITMs();
|
||||
if (rhs.UDRs() > -1)
|
||||
if (rhs.UDRs() > 0)
|
||||
out << Key << "udr" << Value << rhs.UDRs();
|
||||
if (rhs.DeletedNavmeshes() > -1)
|
||||
if (rhs.DeletedNavmeshes() > 0)
|
||||
out << Key << "nav" << Value << rhs.DeletedNavmeshes();
|
||||
|
||||
out << EndMap;
|
||||
|
||||
+14
-18
@@ -74,38 +74,34 @@ namespace boss {
|
||||
return id;
|
||||
}
|
||||
|
||||
DirtData::DirtData() : _crc(0), _itm(-1), _udr(-1), _nav(-1) {}
|
||||
PluginDirtyInfo::PluginDirtyInfo() : _crc(0), _itm(0), _udr(0), _nav(0) {}
|
||||
|
||||
DirtData::DirtData(uint32_t crc, int itm, int udr, int nav, const std::string& utility, const std::string& guideURL) : _crc(crc), _itm(itm), _udr(udr), _nav(nav), _utility(utility), _guideURL(guideURL) {}
|
||||
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) {}
|
||||
|
||||
bool DirtData::operator < (const DirtData& rhs) const {
|
||||
bool PluginDirtyInfo::operator < (const PluginDirtyInfo& rhs) const {
|
||||
return _crc < rhs.CRC();
|
||||
}
|
||||
|
||||
uint32_t DirtData::CRC() const {
|
||||
uint32_t PluginDirtyInfo::CRC() const {
|
||||
return _crc;
|
||||
}
|
||||
|
||||
int DirtData::ITMs() const {
|
||||
unsigned int PluginDirtyInfo::ITMs() const {
|
||||
return _itm;
|
||||
}
|
||||
|
||||
int DirtData::UDRs() const {
|
||||
unsigned int PluginDirtyInfo::UDRs() const {
|
||||
return _udr;
|
||||
}
|
||||
|
||||
int DirtData::DeletedNavmeshes() const {
|
||||
unsigned int PluginDirtyInfo::DeletedNavmeshes() const {
|
||||
return _nav;
|
||||
}
|
||||
|
||||
std::string DirtData::CleaningUtility() const {
|
||||
std::string PluginDirtyInfo::CleaningUtility() const {
|
||||
return _utility;
|
||||
}
|
||||
|
||||
std::string DirtData::CleaningGuideURL() const {
|
||||
return _guideURL;
|
||||
}
|
||||
|
||||
|
||||
ConditionStruct::ConditionStruct() {}
|
||||
|
||||
@@ -438,7 +434,7 @@ namespace boss {
|
||||
std::list<Message> pMessages = plugin.Messages();
|
||||
messages.insert(messages.end(), pMessages.begin(), pMessages.end());
|
||||
|
||||
set<DirtData> dirtyInfo = plugin.DirtyInfo();
|
||||
set<PluginDirtyInfo> dirtyInfo = plugin.DirtyInfo();
|
||||
_dirtyInfo.insert(dirtyInfo.begin(), dirtyInfo.end());
|
||||
|
||||
return;
|
||||
@@ -477,8 +473,8 @@ namespace boss {
|
||||
set_symmetric_difference(bashTags.begin(), bashTags.end(), tags.begin(), tags.end(), inserter(tagDiff, tagDiff.begin()));
|
||||
p.Tags(tagDiff);
|
||||
|
||||
set<DirtData> dirtyInfo = plugin.DirtyInfo();
|
||||
set<DirtData> dirtDiff;
|
||||
set<PluginDirtyInfo> dirtyInfo = plugin.DirtyInfo();
|
||||
set<PluginDirtyInfo> dirtDiff;
|
||||
set_symmetric_difference(dirtyInfo.begin(), dirtyInfo.end(), _dirtyInfo.begin(), _dirtyInfo.end(), inserter(dirtDiff, dirtDiff.begin()));
|
||||
p.DirtyInfo(dirtDiff);
|
||||
|
||||
@@ -517,7 +513,7 @@ namespace boss {
|
||||
return tags;
|
||||
}
|
||||
|
||||
std::set<DirtData> Plugin::DirtyInfo() const {
|
||||
std::set<PluginDirtyInfo> Plugin::DirtyInfo() const {
|
||||
return _dirtyInfo;
|
||||
}
|
||||
|
||||
@@ -553,7 +549,7 @@ namespace boss {
|
||||
tags = t;
|
||||
}
|
||||
|
||||
void Plugin::DirtyInfo(const std::set<DirtData>& dirtyInfo) {
|
||||
void Plugin::DirtyInfo(const std::set<PluginDirtyInfo>& dirtyInfo) {
|
||||
_dirtyInfo = dirtyInfo;
|
||||
}
|
||||
|
||||
@@ -607,7 +603,7 @@ namespace boss {
|
||||
} else
|
||||
_dirtyInfo.clear();
|
||||
|
||||
for (set<DirtData>::iterator it = _dirtyInfo.begin(); it != _dirtyInfo.end();) {
|
||||
for (set<PluginDirtyInfo>::iterator it = _dirtyInfo.begin(); it != _dirtyInfo.end();) {
|
||||
if (it->CRC() != crc)
|
||||
_dirtyInfo.erase(it++);
|
||||
else
|
||||
|
||||
+13
-15
@@ -52,26 +52,24 @@ namespace boss {
|
||||
uint32_t id;
|
||||
};
|
||||
|
||||
class DirtData {
|
||||
class PluginDirtyInfo {
|
||||
public:
|
||||
DirtData();
|
||||
DirtData(uint32_t crc, int itm, int udr, int nav, const std::string& utility, const std::string& guideURL);
|
||||
PluginDirtyInfo();
|
||||
PluginDirtyInfo(uint32_t crc, unsigned int itm, unsigned int udr, unsigned int nav, const std::string& utility);
|
||||
|
||||
bool operator < (const DirtData& rhs) const;
|
||||
bool operator < (const PluginDirtyInfo& rhs) const;
|
||||
|
||||
uint32_t CRC() const;
|
||||
int ITMs() const;
|
||||
int UDRs() const;
|
||||
int DeletedNavmeshes() const;
|
||||
unsigned int ITMs() const;
|
||||
unsigned int UDRs() const;
|
||||
unsigned int DeletedNavmeshes() const;
|
||||
std::string CleaningUtility() const;
|
||||
std::string CleaningGuideURL() const;
|
||||
private:
|
||||
uint32_t _crc;
|
||||
int _itm;
|
||||
int _udr;
|
||||
int _nav;
|
||||
unsigned int _itm;
|
||||
unsigned int _udr;
|
||||
unsigned int _nav;
|
||||
std::string _utility;
|
||||
std::string _guideURL;
|
||||
};
|
||||
|
||||
class ConditionStruct {
|
||||
@@ -171,7 +169,7 @@ namespace boss {
|
||||
std::set<File> Incs() const;
|
||||
std::list<Message> Messages() const;
|
||||
std::set<Tag> Tags() const;
|
||||
std::set<DirtData> DirtyInfo() const;
|
||||
std::set<PluginDirtyInfo> DirtyInfo() const;
|
||||
|
||||
const std::set<FormID>& FormIDs() const;
|
||||
std::vector<std::string> Masters() const;
|
||||
@@ -187,7 +185,7 @@ namespace boss {
|
||||
void Incs(const std::set<File>& incs);
|
||||
void Messages(const std::list<Message>& messages);
|
||||
void Tags(const std::set<Tag>& tags);
|
||||
void DirtyInfo(const std::set<DirtData>& info);
|
||||
void DirtyInfo(const std::set<PluginDirtyInfo>& info);
|
||||
|
||||
void EvalAllConditions(boss::Game& game, const unsigned int language);
|
||||
bool HasNameOnly() const;
|
||||
@@ -215,7 +213,7 @@ namespace boss {
|
||||
std::set<File> incompatibilities;
|
||||
std::list<Message> messages;
|
||||
std::set<Tag> tags;
|
||||
std::set<DirtData> _dirtyInfo;
|
||||
std::set<PluginDirtyInfo> _dirtyInfo;
|
||||
|
||||
std::vector<std::string> masters;
|
||||
std::set<FormID> formIDs;
|
||||
|
||||
+17
-18
@@ -110,40 +110,39 @@ namespace YAML {
|
||||
};
|
||||
|
||||
template<>
|
||||
struct convert<boss::DirtData> {
|
||||
static Node encode(const boss::DirtData& rhs) {
|
||||
struct convert<boss::PluginDirtyInfo> {
|
||||
static Node encode(const boss::PluginDirtyInfo& rhs) {
|
||||
Node node;
|
||||
node["crc"] = rhs.CRC();
|
||||
if (rhs.ITMs() > -1)
|
||||
node["itm"] = rhs.ITMs();
|
||||
if (rhs.UDRs() > -1)
|
||||
node["udr"] = rhs.UDRs();
|
||||
if (rhs.DeletedNavmeshes() > -1)
|
||||
node["nav"] = rhs.DeletedNavmeshes();
|
||||
node["util"] = rhs.CleaningUtility();
|
||||
node["guide"] = rhs.CleaningGuideURL();
|
||||
|
||||
if (rhs.ITMs() > 0)
|
||||
node["itm"] = rhs.ITMs();
|
||||
if (rhs.UDRs() > 0)
|
||||
node["udr"] = rhs.UDRs();
|
||||
if (rhs.DeletedNavmeshes() > 0)
|
||||
node["nav"] = rhs.DeletedNavmeshes();
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
static bool decode(const Node& node, boss::DirtData& rhs) {
|
||||
if (!node.IsMap() || !node["crc"] || !node["util"] || !node["guide"])
|
||||
static bool decode(const Node& node, boss::PluginDirtyInfo& rhs) {
|
||||
if (!node.IsMap() || !node["crc"] || !node["util"])
|
||||
return false;
|
||||
|
||||
uint32_t crc = node["crc"].as<uint32_t>();
|
||||
int itm = -1, udr = -1, nav = -1;
|
||||
int itm = 0, udr = 0, nav = 0;
|
||||
|
||||
if (node["itm"])
|
||||
itm = node["itm"].as<int>();
|
||||
itm = node["itm"].as<unsigned int>();
|
||||
if (node["udr"])
|
||||
udr = node["udr"].as<int>();
|
||||
udr = node["udr"].as<unsigned int>();
|
||||
if (node["nav"])
|
||||
nav = node["nav"].as<int>();
|
||||
nav = node["nav"].as<unsigned int>();
|
||||
|
||||
std::string util = node["util"].as<std::string>();
|
||||
std::string guide = node["guide"].as<std::string>();
|
||||
std::string utility = node["util"].as<std::string>();
|
||||
|
||||
rhs = boss::DirtData(crc, itm, udr, nav, util, guide);
|
||||
rhs = boss::PluginDirtyInfo(crc, itm, udr, nav, utility);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+21
-53
@@ -172,7 +172,6 @@ Editor::Editor(wxWindow *parent, const wxString& title, const std::string userli
|
||||
dirtyList->AppendColumn(translate("UDR Count"));
|
||||
dirtyList->AppendColumn(translate("Deleted Navmesh Count"));
|
||||
dirtyList->AppendColumn(translate("Cleaning Utility"));
|
||||
dirtyList->AppendColumn(translate("Cleaning Guide URL"));
|
||||
|
||||
//Initialise control states.
|
||||
addBtn->Enable(false);
|
||||
@@ -350,15 +349,14 @@ void Editor::OnPluginSelect(wxListEvent& event) {
|
||||
++i;
|
||||
}
|
||||
|
||||
set<boss::DirtData> dirtyInfo = plugin.DirtyInfo();
|
||||
set<boss::PluginDirtyInfo> dirtyInfo = plugin.DirtyInfo();
|
||||
i=0;
|
||||
for (set<boss::DirtData>::const_iterator it=dirtyInfo.begin(), endit=dirtyInfo.end(); it != endit; ++it) {
|
||||
for (set<boss::PluginDirtyInfo>::const_iterator it=dirtyInfo.begin(), endit=dirtyInfo.end(); it != endit; ++it) {
|
||||
dirtyList->InsertItem(i, FromUTF8(boss::IntToHexString(it->CRC())));
|
||||
dirtyList->SetItem(i, 1, FromUTF8(boss::IntToString(it->ITMs())));
|
||||
dirtyList->SetItem(i, 2, FromUTF8(boss::IntToString(it->UDRs())));
|
||||
dirtyList->SetItem(i, 2, FromUTF8(boss::IntToString(it->DeletedNavmeshes())));
|
||||
dirtyList->SetItem(i, 2, FromUTF8(it->CleaningUtility()));
|
||||
dirtyList->SetItem(i, 2, FromUTF8(it->CleaningGuideURL()));
|
||||
dirtyList->SetItem(i, 3, FromUTF8(boss::IntToString(it->DeletedNavmeshes())));
|
||||
dirtyList->SetItem(i, 4, FromUTF8(it->CleaningUtility()));
|
||||
++i;
|
||||
}
|
||||
|
||||
@@ -511,23 +509,14 @@ void Editor::OnAddRow(wxCommandEvent& event) {
|
||||
wxOK | wxICON_ERROR,
|
||||
this);
|
||||
return;
|
||||
} else if (rowDialog->GetGuideURL().empty()) {
|
||||
BOOST_LOG_TRIVIAL(error) << "No cleaning guide URL specified. Row will not be added.";
|
||||
wxMessageBox(
|
||||
translate("Error: No cleaning guide URL specified. Row will not be added."),
|
||||
translate("BOSS: Error"),
|
||||
wxOK | wxICON_ERROR,
|
||||
this);
|
||||
return;
|
||||
}
|
||||
|
||||
long i = tagsList->GetItemCount();
|
||||
dirtyList->InsertItem(i, rowDialog->GetCRC());
|
||||
dirtyList->SetItem(i, 1, FromUTF8(boss::IntToString(rowDialog->GetITMs())));
|
||||
dirtyList->SetItem(i, 2, FromUTF8(boss::IntToString(rowDialog->GetUDRs())));
|
||||
dirtyList->SetItem(i, 2, FromUTF8(boss::IntToString(rowDialog->GetDeletedNavmeshes())));
|
||||
dirtyList->SetItem(i, 2, rowDialog->GetUtility());
|
||||
dirtyList->SetItem(i, 2, rowDialog->GetGuideURL());
|
||||
dirtyList->SetItem(i, 3, FromUTF8(boss::IntToString(rowDialog->GetDeletedNavmeshes())));
|
||||
dirtyList->SetItem(i, 4, rowDialog->GetUtility());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -632,8 +621,7 @@ void Editor::OnEditRow(wxCommandEvent& event) {
|
||||
atoi(string(tagsList->GetItemText(i, 1)).c_str()),
|
||||
atoi(string(tagsList->GetItemText(i, 2)).c_str()),
|
||||
atoi(string(tagsList->GetItemText(i, 3)).c_str()),
|
||||
tagsList->GetItemText(i, 4),
|
||||
tagsList->GetItemText(i, 5));
|
||||
tagsList->GetItemText(i, 4));
|
||||
|
||||
if (rowDialog->ShowModal() != wxID_OK) {
|
||||
BOOST_LOG_TRIVIAL(debug) << "Cancelled editing tag row.";
|
||||
@@ -656,22 +644,13 @@ void Editor::OnEditRow(wxCommandEvent& event) {
|
||||
wxOK | wxICON_ERROR,
|
||||
this);
|
||||
return;
|
||||
} else if (rowDialog->GetGuideURL().empty()) {
|
||||
BOOST_LOG_TRIVIAL(error) << "No cleaning guide URL specified. Row will not be edited.";
|
||||
wxMessageBox(
|
||||
translate("Error: No cleaning guide URL specified. Row will not be edited."),
|
||||
translate("BOSS: Error"),
|
||||
wxOK | wxICON_ERROR,
|
||||
this);
|
||||
return;
|
||||
}
|
||||
|
||||
dirtyList->SetItem(i, 0, rowDialog->GetCRC());
|
||||
dirtyList->SetItem(i, 1, FromUTF8(boss::IntToString(rowDialog->GetITMs())));
|
||||
dirtyList->SetItem(i, 2, FromUTF8(boss::IntToString(rowDialog->GetUDRs())));
|
||||
dirtyList->SetItem(i, 2, FromUTF8(boss::IntToString(rowDialog->GetDeletedNavmeshes())));
|
||||
dirtyList->SetItem(i, 2, rowDialog->GetUtility());
|
||||
dirtyList->SetItem(i, 2, rowDialog->GetGuideURL());
|
||||
dirtyList->SetItem(i, 3, FromUTF8(boss::IntToString(rowDialog->GetDeletedNavmeshes())));
|
||||
dirtyList->SetItem(i, 4, rowDialog->GetUtility());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -818,7 +797,7 @@ void Editor::OnRowSelect(wxListEvent& event) {
|
||||
}
|
||||
|
||||
} else {
|
||||
boss::DirtData dirtyData = RowToDirtData(dirtyList, event.GetIndex());
|
||||
boss::PluginDirtyInfo dirtyData = RowToPluginDirtyInfo(dirtyList, event.GetIndex());
|
||||
boss::Plugin plugin(string(pluginText->GetLabelText().ToUTF8()));
|
||||
|
||||
vector<boss::Plugin>::const_iterator it = std::find(_basePlugins.begin(), _basePlugins.end(), plugin);
|
||||
@@ -828,7 +807,7 @@ void Editor::OnRowSelect(wxListEvent& event) {
|
||||
else
|
||||
BOOST_LOG_TRIVIAL(warning) << "Could not find plugin in base list: " << plugin.Name();
|
||||
|
||||
set<boss::DirtData> dirtyInfo = plugin.DirtyInfo();
|
||||
set<boss::PluginDirtyInfo> dirtyInfo = plugin.DirtyInfo();
|
||||
|
||||
if (dirtyInfo.find(dirtyData) == dirtyInfo.end()) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "Dirty info for CRC \"" << dirtyData.CRC() << "\" was not found in base plugin metadata. Editing enabled.";
|
||||
@@ -961,11 +940,11 @@ boss::Plugin Editor::GetNewData(const wxString& plugin) const {
|
||||
}
|
||||
p.Tags(tags);
|
||||
|
||||
set<boss::DirtData> dirtyData;
|
||||
set<boss::PluginDirtyInfo> dirtyInfo;
|
||||
for (int i=0,max=dirtyList->GetItemCount(); i < max; ++i) {
|
||||
dirtyData.insert(RowToDirtData(dirtyList, i));
|
||||
dirtyInfo.insert(RowToPluginDirtyInfo(dirtyList, i));
|
||||
}
|
||||
p.DirtyInfo(dirtyData);
|
||||
p.DirtyInfo(dirtyInfo);
|
||||
|
||||
vector<boss::Message> vec = messageList->GetItems();
|
||||
list<boss::Message> messages(vec.begin(), vec.end());
|
||||
@@ -999,20 +978,18 @@ boss::Tag Editor::RowToTag(wxListView * list, long row) const {
|
||||
);
|
||||
}
|
||||
|
||||
boss::DirtData Editor::RowToDirtData(wxListView * list, long row) const {
|
||||
boss::PluginDirtyInfo Editor::RowToPluginDirtyInfo(wxListView * list, long row) const {
|
||||
string text(list->GetItemText(row, 0).ToUTF8());
|
||||
uint32_t crc;
|
||||
std::stringstream ss;
|
||||
ss << std::hex << text;
|
||||
ss >> crc;
|
||||
return boss::DirtData(
|
||||
return boss::PluginDirtyInfo(
|
||||
crc,
|
||||
atoi(string(list->GetItemText(row, 1).ToUTF8()).c_str()),
|
||||
atoi(string(list->GetItemText(row, 2).ToUTF8()).c_str()),
|
||||
atoi(string(list->GetItemText(row, 3).ToUTF8()).c_str()),
|
||||
string(list->GetItemText(row, 4).ToUTF8()),
|
||||
string(list->GetItemText(row, 5).ToUTF8())
|
||||
);
|
||||
string(list->GetItemText(row, 4).ToUTF8()));
|
||||
}
|
||||
|
||||
FileEditDialog::FileEditDialog(wxWindow *parent, const wxString& title) : wxDialog(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER) {
|
||||
@@ -1313,7 +1290,6 @@ DirtInfoEditDialog::DirtInfoEditDialog(wxWindow * parent, const wxString& title)
|
||||
_nav = new wxSpinCtrl(this, wxID_ANY, "0");
|
||||
_crc = new wxTextCtrl(this, wxID_ANY);
|
||||
_utility = new wxTextCtrl(this, wxID_ANY);
|
||||
_guideURL = new wxTextCtrl(this, wxID_ANY);
|
||||
|
||||
wxSizerFlags leftItem(0);
|
||||
leftItem.Left();
|
||||
@@ -1341,9 +1317,6 @@ DirtInfoEditDialog::DirtInfoEditDialog(wxWindow * parent, const wxString& title)
|
||||
GridSizer->Add(new wxStaticText(this, wxID_ANY, translate("Cleaning Utility:")), leftItem);
|
||||
GridSizer->Add(_utility, rightItem);
|
||||
|
||||
GridSizer->Add(new wxStaticText(this, wxID_ANY, translate("Cleaning Guide URL:")), leftItem);
|
||||
GridSizer->Add(_guideURL, rightItem);
|
||||
|
||||
bigBox->Add(GridSizer, 0, wxEXPAND|wxALL, 15);
|
||||
|
||||
bigBox->AddSpacer(10);
|
||||
@@ -1359,35 +1332,30 @@ DirtInfoEditDialog::DirtInfoEditDialog(wxWindow * parent, const wxString& title)
|
||||
SetSizerAndFit(bigBox);
|
||||
}
|
||||
|
||||
void DirtInfoEditDialog::SetValues(const wxString& crc, int itm, int udr, int nav, const wxString& utility, const wxString& guideURL) {
|
||||
void DirtInfoEditDialog::SetValues(const wxString& crc, unsigned int itm, unsigned int udr, unsigned int nav, const wxString& utility) {
|
||||
_crc->SetValue(crc);
|
||||
_itm->SetValue(itm);
|
||||
_udr->SetValue(udr);
|
||||
_nav->SetValue(nav);
|
||||
_utility->SetValue(utility);
|
||||
_guideURL->SetValue(guideURL);
|
||||
}
|
||||
|
||||
wxString DirtInfoEditDialog::GetCRC() const {
|
||||
return _crc->GetValue();
|
||||
}
|
||||
|
||||
int DirtInfoEditDialog::GetITMs() const {
|
||||
unsigned int DirtInfoEditDialog::GetITMs() const {
|
||||
return _itm->GetValue();
|
||||
}
|
||||
|
||||
int DirtInfoEditDialog::GetUDRs() const {
|
||||
unsigned int DirtInfoEditDialog::GetUDRs() const {
|
||||
return _udr->GetValue();
|
||||
}
|
||||
|
||||
int DirtInfoEditDialog::GetDeletedNavmeshes() const {
|
||||
unsigned int DirtInfoEditDialog::GetDeletedNavmeshes() const {
|
||||
return _nav->GetValue();
|
||||
}
|
||||
|
||||
wxString DirtInfoEditDialog::GetUtility() const {
|
||||
return _utility->GetValue();
|
||||
}
|
||||
|
||||
wxString DirtInfoEditDialog::GetGuideURL() const {
|
||||
return _guideURL->GetValue();
|
||||
}
|
||||
|
||||
+5
-7
@@ -100,7 +100,7 @@ private:
|
||||
|
||||
boss::File RowToFile(wxListView * list, long row) const;
|
||||
boss::Tag RowToTag(wxListView * list, long row) const;
|
||||
boss::DirtData RowToDirtData(wxListView * list, long row) const;
|
||||
boss::PluginDirtyInfo RowToPluginDirtyInfo(wxListView * list, long row) const;
|
||||
};
|
||||
|
||||
class FileEditDialog : public wxDialog {
|
||||
@@ -157,20 +157,18 @@ class DirtInfoEditDialog : public wxDialog {
|
||||
public:
|
||||
DirtInfoEditDialog(wxWindow * parent, const wxString& title);
|
||||
|
||||
void SetValues(const wxString& crc, int itm, int udr, int nav, const wxString& utility, const wxString& guideURL);
|
||||
void SetValues(const wxString& crc, unsigned int itm, unsigned int udr, unsigned int nav, const wxString& utility);
|
||||
wxString GetCRC() const;
|
||||
int GetITMs() const;
|
||||
int GetUDRs() const;
|
||||
int GetDeletedNavmeshes() const;
|
||||
wxString GetUtility() const;
|
||||
wxString GetGuideURL() const;
|
||||
unsigned int GetITMs() const;
|
||||
unsigned int GetUDRs() const;
|
||||
unsigned int GetDeletedNavmeshes() const;
|
||||
private:
|
||||
wxTextCtrl * _crc;
|
||||
wxSpinCtrl * _itm;
|
||||
wxSpinCtrl * _udr;
|
||||
wxSpinCtrl * _nav;
|
||||
wxTextCtrl * _utility;
|
||||
wxTextCtrl * _guideURL;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user