Get plugin dummy status from its header.

Until its full content is read. Closes #369.
This commit is contained in:
Oliver Hamlet
2014-12-28 20:21:59 +00:00
parent 698d8ae101
commit a0cf512c4f
5 changed files with 20 additions and 4 deletions
+1
View File
@@ -236,6 +236,7 @@
var firstRun = document.getElementById('firstRun');
firstRun.heading = l10n.translate("First-Time Tips").fetch();
firstRun.querySelector('li:nth-child(2)').textContent = l10n.translate("CRCs are only displayed after plugins have been loaded, either by conflict filtering, or by sorting.").fetch();
firstRun.querySelector('li:nth-child(4)').textContent = l10n.translate("Multiple metadata editors can be opened at once, and many options in the header bar are disabled while any editors are open.").fetch();
firstRun.querySelector('li:last-child').textContent = l10n.translate("Many interface elements have tooltips. If you don't know what something is, try hovering your mouse over it to find out.").fetch();
+1 -1
View File
@@ -295,7 +295,7 @@ along with LOOT. If not, see <http://www.gnu.org/licenses/>.
<p>This appears to be the first time you have run LOOT v<span id="firstTimeLootVersion"></span>. Here are some tips to help you get started with the interface.</p>
<ul>
<li>As well as messages, LOOT displays plugin <span class="version">version numbers</span>, <span class="crc">CRCs</span> and Bash Tag suggestions for <span class="tag add">addition</span> and <span class="tag remove">removal</span>.</li>
<li>CRCs and dummy plugin icons <core-icon icon="visibility-off"></core-icon> are only displayed after plugins have been loaded, either by conflict filtering, or by sorting.</li>
<li>CRCs are only displayed after plugins have been loaded, either by conflict filtering, or by sorting.</li>
<li>Each plugin has a menu that can be used to access extra features, including the plugin's metadata editor and conflict filter. Click the plugin's <core-icon icon="more-vert"></core-icon> icon to reveal it.</li>
<li>Multiple metadata editors can be opened at once, and many options in the header bar are disabled while any editors are open.</li>
<li>Plugins can be drag and dropped from the sidebar into editors' <q>load after</q>, <q>requirements</q> and <q>incompatibility</q> tables.</li>
+13
View File
@@ -407,6 +407,15 @@ namespace loot {
++numOverrideRecords;
}
BOOST_LOG_TRIVIAL(trace) << name << ": " << "Checking if plugin is a dummy.";
if (headerOnly) {
// Check the header records count.
_isDummy = file->getNumRecords() == 0;
}
else {
_isDummy = formIDs.empty();
}
//Also read Bash Tags applied and version string in description.
BOOST_LOG_TRIVIAL(trace) << name << ": " << "Reading the description.";
string text = boost::locale::conv::to_utf<char>(file->getDescription(), "Windows-1252", boost::locale::conv::stop);
@@ -827,6 +836,10 @@ namespace loot {
return isMaster;
}
bool Plugin::IsDummy() const {
return _isDummy;
}
std::string Plugin::Version() const {
return version;
}
+2
View File
@@ -210,6 +210,7 @@ namespace loot {
const std::set<FormID>& FormIDs() const;
std::vector<std::string> Masters() const;
bool IsMaster() const; //Checks master bit flag.
bool IsDummy() const;
std::string Version() const;
uint32_t Crc() const;
@@ -249,6 +250,7 @@ namespace loot {
std::string name;
bool enabled; //Default to true.
bool _isPriorityExplicit; //If false and priority is 0, then priority was not explicitly set as such.
bool _isDummy; // Does the plugin contain any records other than the TES4 header?
int priority; //Default to 0 : >0 is lower down in load order, <0 is higher up.
std::set<File> loadAfter;
std::set<File> requirements;
+3 -3
View File
@@ -354,7 +354,7 @@ namespace loot {
YAML::Node pluginNode;
pluginNode["crc"] = pluginPair.second.Crc();
pluginNode["isDummy"] = pluginPair.second.FormIDs().size() == 0;
pluginNode["isDummy"] = pluginPair.second.IsDummy();
if (pluginIt != g_app_state.CurrentGame().plugins.end() && pluginIt->second.DoFormIDsOverlap(pluginPair.second)) {
BOOST_LOG_TRIVIAL(debug) << "Found conflicting plugin: " << pluginPair.second.Name();
pluginNode["conflicts"] = true;
@@ -669,7 +669,7 @@ namespace loot {
pluginNode["__type"] = "Plugin"; // For conversion back into a JS typed object.
pluginNode["name"] = plugin.Name();
pluginNode["isActive"] = g_app_state.CurrentGame().IsActive(plugin.Name());
pluginNode["isDummy"] = false; // Set to false for now because we just don't know yet.
pluginNode["isDummy"] = plugin.IsDummy();
pluginNode["loadsBSA"] = plugin.LoadsBSA(g_app_state.CurrentGame());
pluginNode["crc"] = IntToHexString(plugin.Crc());
pluginNode["version"] = plugin.Version();
@@ -919,7 +919,7 @@ namespace loot {
pluginNode["name"] = plugin.Name();
pluginNode["crc"] = plugin.Crc();
pluginNode["isDummy"] = plugin.FormIDs().size() == 0;
pluginNode["isDummy"] = plugin.IsDummy();
// Sorting may have produced a plugin loading error message, so rederive displayed data.
YAML::Node derivedNode = GenerateDerivedMetadata(plugin.Name());