Issue #79 work.

This should complete it, I can't think of any other plugin lists that
need colours added. The plugin list in the Editor now displays plugins
with accompanying BSAs in light blue. The grey text for empty plugins is
not used here because record parsing is skipped for the Editor, so they
all appear empty.
This commit is contained in:
WrinklyNinja
2014-01-26 23:36:13 +00:00
parent 22b128014a
commit e16906f49c
3 changed files with 8 additions and 4 deletions
+4 -1
View File
@@ -106,7 +106,7 @@ wxString MessageList::OnGetItemText(long item, long column) const {
}
}
Editor::Editor(wxWindow *parent, const wxString& title, const std::string userlistPath, const std::vector<boss::Plugin>& basePlugins, std::vector<boss::Plugin>& editedPlugins, const unsigned int language) : wxFrame(parent, wxID_ANY, title), _userlistPath(userlistPath), _basePlugins(basePlugins), _editedPlugins(editedPlugins) {
Editor::Editor(wxWindow *parent, const wxString& title, const std::string userlistPath, const std::vector<boss::Plugin>& basePlugins, std::vector<boss::Plugin>& editedPlugins, const unsigned int language, const boss::Game& game) : wxFrame(parent, wxID_ANY, title), _userlistPath(userlistPath), _basePlugins(basePlugins), _editedPlugins(editedPlugins), _game(game) {
//Initialise child windows.
listBook = new wxNotebook(this, BOOK_Lists);
@@ -265,6 +265,9 @@ Editor::Editor(wxWindow *parent, const wxString& title, const std::string userli
//Fill pluginList with the contents of basePlugins.
for (int i=0, max=_basePlugins.size(); i < max; ++i) {
pluginList->InsertItem(i, FromUTF8(_basePlugins[i].Name()));
if (_basePlugins[i].HasBSA(_game)) {
pluginList->SetItemTextColour(i, wxColour(0, 142, 219));
}
}
pluginList->SetColumnWidth(0, wxLIST_AUTOSIZE);
+2 -1
View File
@@ -54,7 +54,7 @@ private:
class Editor : public wxFrame {
public:
Editor(wxWindow *parent, const wxString& title, const std::string userlistPath, const std::vector<boss::Plugin>& basePlugins, std::vector<boss::Plugin>& editedPlugins, const unsigned int language);
Editor(wxWindow *parent, const wxString& title, const std::string userlistPath, const std::vector<boss::Plugin>& basePlugins, std::vector<boss::Plugin>& editedPlugins, const unsigned int language, const boss::Game& game);
void OnPluginSelect(wxListEvent& event);
void OnEnabledToggle(wxCommandEvent& event);
@@ -89,6 +89,7 @@ private:
const std::string _userlistPath;
const std::vector<boss::Plugin> _basePlugins;
const boss::Game& _game;
std::vector<boss::Plugin> _editedPlugins;
std::vector<boss::Message> currentMessages;
+2 -2
View File
@@ -936,7 +936,7 @@ void Launcher::OnEditMetadata(wxCommandEvent& event) {
//Create editor window.
BOOST_LOG_TRIVIAL(debug) << "Opening editor window.";
Editor *editor = new Editor(this, translate("BOSS: Metadata Editor"), _game.UserlistPath().string(), installed, ulist_plugins, lang);
Editor *editor = new Editor(this, translate("BOSS: Metadata Editor"), _game.UserlistPath().string(), installed, ulist_plugins, lang, _game);
progDia->Destroy();
@@ -1023,7 +1023,7 @@ void Launcher::OnOpenSettings(wxCommandEvent& event) {
BOOST_LOG_TRIVIAL(debug) << "Opening settings window...";
SettingsFrame *settings = new SettingsFrame(this, translate("BOSS: Settings"), _settings, _games);
settings->ShowModal();
BOOST_LOG_TRIVIAL(debug) << "Editor window opened.";
BOOST_LOG_TRIVIAL(debug) << "Settings window opened.";
}
void Launcher::OnGameChange(wxCommandEvent& event) {