diff --git a/resources/script.js b/resources/script.js index c1a0a9b0..4c37c1a8 100755 --- a/resources/script.js +++ b/resources/script.js @@ -143,7 +143,7 @@ function togglePlugins(evt) { var hiddenNo = parseInt(document.getElementById('hiddenPluginNo').textContent); while (i > -1) { if (plugins[i].nodeType == Node.ELEMENT_NODE) { - var isMessageless = true, isInactive = true; + var isMessageless = true; var messages = plugins[i].getElementsByTagName('li'); var j = messages.length - 1; while (j > -1) { @@ -153,10 +153,7 @@ function togglePlugins(evt) { } j--; } - if (plugins[i].getElementsByClassName('active').length != 0) { - isInactive = false; - } - if ((document.getElementById('hideMessagelessPlugins').checked && isMessageless) || (document.getElementById('hideInactivePlugins').checked && isInactive)) { + if (document.getElementById('hideMessagelessPlugins').checked && isMessageless) { if (plugins[i].className.indexOf('hidden') == -1) { hiddenNo++; hideElement(plugins[i]); @@ -189,13 +186,10 @@ function setupEventHandlers() { i--; } document.getElementById('hideVersionNumbers').addEventListener('click', toggleDisplayCSS, false); - document.getElementById('hideActiveLabel').addEventListener('click', toggleDisplayCSS, false); - document.getElementById('hideChecksums').addEventListener('click', toggleDisplayCSS, false); document.getElementById('hideNotes').addEventListener('click', toggleMessages, false); document.getElementById('hideBashTags').addEventListener('click', toggleMessages, false); document.getElementById('hideDoNotCleanMessages').addEventListener('click', toggleMessages, false); document.getElementById('hideAllPluginMessages').addEventListener('click', toggleMessages, false); - document.getElementById('hideInactivePlugins').addEventListener('click', togglePlugins, false); document.getElementById('hideMessagelessPlugins').addEventListener('click', togglePlugins, false); } function init() { diff --git a/resources/style.css b/resources/style.css index bec221ff..f9492c69 100755 --- a/resources/style.css +++ b/resources/style.css @@ -121,10 +121,6 @@ li {margin:0.75em 0;} /* Old BOSS Log CSS */ -h1{font-size:3em;margin:0;} - -h2{font-size:2em;margin-top:0;} - ul{list-style:none;padding-left:0;} ul li{margin-left:0;margin-bottom:1em;} @@ -139,16 +135,6 @@ li.success{background:#90ff90;display:table;padding:0.3em 0.5em;border-radius:0. .version{color:#6394F8;margin-right:1em;} -.crc{color:#BC8923;margin-right:1em;} - -.active{color:green;margin-right:1em;} - -.tagPrefix{color:#CD5555;} - -.dirty{color:#960;} - -.message{color:gray;} - .mod{margin-right:1em;} tr.good td {background: #90ff90;} diff --git a/src/generators.h b/src/generators.h index 90f23c09..6dd2cae2 100644 --- a/src/generators.h +++ b/src/generators.h @@ -296,20 +296,6 @@ namespace boss { node.text().set(("Version: " + it->Version()).c_str()); } - if (it->Crc() > 0) { - node = plugin.append_child(); - node.set_name("span"); - node.append_attribute("class").set_value("crc"); - node.text().set(("CRC: " + IntToHexString(it->Crc())).c_str()); - } - - if (it->IsActive()) { - node = plugin.append_child(); - node.set_name("span"); - node.append_attribute("class").set_value("active"); - node.text().set("Active"); - } - std::list messages = it->Messages(); std::set tags = it->Tags(); @@ -382,24 +368,6 @@ namespace boss { input.append_attribute("data-class").set_value("version"); input.text().set("Hide Version Numbers"); - label = filters.append_child(); - label.set_name("label"); - input = label.append_child(); - input.set_name("input"); - input.append_attribute("type").set_value("checkbox"); - input.append_attribute("id").set_value("hideActiveLabel"); - input.append_attribute("data-class").set_value("active"); - input.text().set("Hide 'Active' Label"); - - label = filters.append_child(); - label.set_name("label"); - input = label.append_child(); - input.set_name("input"); - input.append_attribute("type").set_value("checkbox"); - input.append_attribute("id").set_value("hideChecksums"); - input.append_attribute("data-class").set_value("crc"); - input.text().set("Hide Checksums"); - label = filters.append_child(); label.set_name("label"); input = label.append_child(); @@ -432,14 +400,6 @@ namespace boss { input.append_attribute("id").set_value("hideAllPluginMessages"); input.text().set("Hide All Plugin Messages"); - label = filters.append_child(); - label.set_name("label"); - input = label.append_child(); - input.set_name("input"); - input.append_attribute("type").set_value("checkbox"); - input.append_attribute("id").set_value("hideInactivePlugins"); - input.text().set("Hide Inactive Plugins"); - label = filters.append_child(); label.set_name("label"); input = label.append_child(); diff --git a/src/gui/main.cpp b/src/gui/main.cpp index ca75a2b8..fe6c2fc7 100644 --- a/src/gui/main.cpp +++ b/src/gui/main.cpp @@ -176,7 +176,16 @@ bool BossGUI::OnInit() { _game = _detectedGames[0]; //Now that game is selected, initialise it. - _game.Init(); + try { + _game.Init(); + } catch (boss::error& e) { + wxMessageBox( + FromUTF8(format(loc::translate("Error: Game-specific settings could not be initialised. %1%")) % e.what()), + translate("BOSS: Error"), + wxOK | wxICON_ERROR, + NULL); + return false; + } //Create launcher window. Launcher * launcher = new Launcher(wxT("BOSS"), _settings, _game, _detectedGames, _undetectedGames); @@ -373,7 +382,7 @@ void Launcher::OnSortPlugins(wxCommandEvent& event) { progDia->Pulse(); if (fs::exists(_game.MasterlistPath()) || fs::exists(_game.UserlistPath())) { - out << "Merging plugin lists..." << endl; + out << "Merging plugin lists, evaluating conditions and and checking for install validity..." << endl; //Merge all global message lists. messages = mlist_messages; @@ -392,69 +401,75 @@ void Launcher::OnSortPlugins(wxCommandEvent& event) { if (pos != ulist_plugins.end()) it->Merge(*pos); - + progDia->Pulse(); + + //Now that items are merged, evaluate any conditions they have. + try { + it->EvalAllConditions(_game, _settings["Language"].as()); + } catch (boss::error& e) { + //LOG_ERROR("Error: %s", e.what()); + wxMessageBox( + FromUTF8(format(loc::translate("Error: Condition evaluation failed. %1%")) % e.what()), + translate("BOSS: Error"), + wxOK | wxICON_ERROR, + this); + return; + } + + progDia->Pulse(); + + //Also check install validity. + map issues = it->CheckInstallValidity(_game); + list messages = it->Messages(); + for (map::const_iterator jt=issues.begin(), endJt=issues.end(); jt != endJt; ++jt) { + if (jt->second) + messages.push_back(boss::Message("error", "\"" + jt->first + "\" is incompatible with \"" + it->Name() + "\" and is present.")); + else + messages.push_back(boss::Message("error", "\"" + jt->first + "\" is required by \"" + it->Name() + "\" but is missing.")); + } + if (!issues.empty()) + it->Messages(messages); progDia->Pulse(); } end = time(NULL); - out << "Time taken to merge lists: " << (end - start) << " seconds." << endl; + out << "Time taken to merge lists, evaluate conditions and check for install validity: " << (end - start) << " seconds." << endl; start = time(NULL); } - progDia->Pulse(); - - out << "Evaluating any conditions in plugin list..." << endl; - - for (list::iterator it=plugins.begin(), endIt=plugins.end(); it != endIt; ++it) { - try { - it->EvalAllConditions(_game, _settings["Language"].as()); - } catch (boss::error& e) { - //LOG_ERROR("Error: %s", e.what()); - wxMessageBox( - FromUTF8(format(loc::translate("Error: Condition evaluation failed. %1%")) % e.what()), - translate("BOSS: Error"), - wxOK | wxICON_ERROR, - this); - return; - } - - progDia->Pulse(); - } - - end = time(NULL); - out << "Time taken to evaluate plugin list: " << (end - start) << " seconds." << endl; - start = time(NULL); - - progDia->Pulse(); - - out << "Checking install validity..." << endl; - - for (list::iterator it=plugins.begin(), endIt = plugins.end(); it != endIt; ++it) { - map issues = it->CheckInstallValidity(_game); - list messages = it->Messages(); - for (map::const_iterator jt=issues.begin(), endJt=issues.end(); jt != endJt; ++jt) { - if (jt->second) - messages.push_back(boss::Message("error", "\"" + jt->first + "\" is incompatible with \"" + it->Name() + "\" and is present.")); - else - messages.push_back(boss::Message("error", "\"" + jt->first + "\" is required by \"" + it->Name() + "\" but is missing.")); - } - if (!issues.empty()) - it->Messages(messages); - - progDia->Pulse(); - } - - - end = time(NULL); - out << "Time taken to check install validity: " << (end - start) << " seconds." << endl; - start = time(NULL); - progDia->Pulse(); out << "Sorting plugins..." << endl; - plugins.sort(); + //Iterate through the container. For each element, compare it against all those following it and insert those that are < it before it. After each insert, step back to the inserted element and compare for that. + list::iterator it=plugins.begin(); + while (it != plugins.end()) { + list::iterator jt=it; + ++jt; + + out << "Sorting for: " << it->Name() << endl; + + list moved; + while (jt != plugins.end()) { + if (*jt < *it) { + moved.push_back(*jt); + jt = plugins.erase(jt); + } else + ++jt; + + progDia->Pulse(); + } + if (!moved.empty()) { + plugins.insert(it, moved.begin(), moved.end()); + advance(it, -1*(int)moved.size()); + } else + ++it; + + progDia->Pulse(); + } + + plugins.sort(boss::flex_sort); end = time(NULL); out << "Time taken to sort plugins: " << (end - start) << " seconds." << endl; @@ -475,7 +490,7 @@ void Launcher::OnSortPlugins(wxCommandEvent& event) { out << '\t' << "Conflicts with:" << endl; for (list::iterator jt=plugins.begin(), endJt = plugins.end(); jt != endJt; ++jt) { - if (*jt != *it && !jt->MustLoadAfter(*it)) { + if (*jt != *it && !it->MustLoadAfter(*jt) && !jt->MustLoadAfter(*it)) { size_t overlap = jt->OverlapFormIDs(*it).size(); if (overlap > 0) out << '\t' << '\t' << jt->Name() << " (" << overlap << " records)" << endl; @@ -640,7 +655,15 @@ void Launcher::OnOpenSettings(wxCommandEvent& event) { void Launcher::OnGameChange(wxCommandEvent& event) { _game = _detectedGames[event.GetId() - MENU_LowestDynamicGameID]; - _game.Init(); //In case it hasn't already been done. + try { + _game.Init(); //In case it hasn't already been done. + } catch (boss::error& e) { + wxMessageBox( + FromUTF8(format(loc::translate("Error: Game-specific settings could not be initialised. %1%")) % e.what()), + translate("BOSS: Error"), + wxOK | wxICON_ERROR, + NULL); + } SetTitle(FromUTF8("BOSS - " + _game.Name())); }