Started to implement issue #79.

Plugins that contain only a TES4 record will show up in the load order
confirmation dialog with grey text. Plugins with more than just a TES4
record that have accompanying BSAs will show up with light blue text.
This commit is contained in:
WrinklyNinja
2014-01-26 21:48:40 +00:00
parent 0c1d443fee
commit 475ed2961f
4 changed files with 14 additions and 3 deletions
+4
View File
@@ -720,6 +720,10 @@ namespace boss {
return issues;
}
bool Plugin::HasBSA(const Game& game) const {
return boost::filesystem::exists(game.DataPath() / (name.substr(0, name.length() - 4) + ".bsa"));
}
bool operator == (const File& lhs, const Plugin& rhs) {
return boost::iequals(lhs.Name(), rhs.Name());
}
+1
View File
@@ -190,6 +190,7 @@ namespace boss {
void EvalAllConditions(boss::Game& game, const unsigned int language);
bool HasNameOnly() const;
bool IsRegexPlugin() const;
bool HasBSA(const Game& game) const;
//Compare name strings.
bool operator == (const Plugin& rhs) const;
+7 -2
View File
@@ -687,7 +687,7 @@ void Launcher::OnSortPlugins(wxCommandEvent& event) {
progDia = NULL;
BOOST_LOG_TRIVIAL(debug) << "Displaying load order preview.";
LoadOrderPreview preview(this, translate("BOSS: Calculated Load Order"), plugins);
LoadOrderPreview preview(this, translate("BOSS: Calculated Load Order"), plugins, _game);
if (preview.ShowModal() == wxID_OK) {
BOOST_LOG_TRIVIAL(debug) << "Load order accepted.";
@@ -1102,7 +1102,7 @@ void Launcher::OnAbout(wxCommandEvent& event) {
wxAboutBox(aboutInfo);
}
LoadOrderPreview::LoadOrderPreview(wxWindow *parent, const wxString title, const std::list<boss::Plugin>& plugins) : wxDialog(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER), _plugins(plugins) {
LoadOrderPreview::LoadOrderPreview(wxWindow *parent, const wxString title, const std::list<boss::Plugin>& plugins, const boss::Game& game) : wxDialog(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER), _plugins(plugins), _game(game) {
//Init controls.
_loadOrder = new wxListView(this, LIST_LoadOrder, wxDefaultPosition, wxDefaultSize, wxLC_REPORT);
@@ -1115,6 +1115,11 @@ LoadOrderPreview::LoadOrderPreview(wxWindow *parent, const wxString title, const
size_t i=0;
for (list<boss::Plugin>::const_iterator it=plugins.begin(), endit=plugins.end(); it != endit; ++it, ++i) {
_loadOrder->InsertItem(i, FromUTF8(it->Name()));
if (it->FormIDs().empty()) {
_loadOrder->SetItemTextColour(i, wxColour(122, 122, 122));
} else if (it->HasBSA(_game)) {
_loadOrder->SetItemTextColour(i, wxColour(0, 142, 219));
}
}
_loadOrder->SetColumnWidth(0, wxLIST_AUTOSIZE);
+2 -1
View File
@@ -72,7 +72,7 @@ private:
class LoadOrderPreview : public wxDialog {
public:
LoadOrderPreview(wxWindow *parent, const wxString title, const std::list<boss::Plugin>& plugins);
LoadOrderPreview(wxWindow *parent, const wxString title, const std::list<boss::Plugin>& plugins, const boss::Game& game);
void OnPluginSelect(wxListEvent& event);
void OnMoveUp(wxCommandEvent& event);
@@ -86,6 +86,7 @@ private:
const std::list<boss::Plugin> _plugins;
std::set<std::string> _movedPlugins;
const boss::Game& _game;
};
#endif