From 68f01ae3495e62cbb793b1a6468d8ed96e65b29f Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Fri, 11 Dec 2015 17:27:30 +0000 Subject: [PATCH] BSA -> Archive Replace BSA with Archive everywhere apart from where BSAs are used to refer to a specific game that uses actual BSAs for its archives. --- docs/LOOT Readme.html | 4 ++-- src/backend/plugin/plugin.cpp | 12 ++++++------ src/backend/plugin/plugin.h | 4 ++-- src/backend/plugin_sorter.cpp | 12 +++++------- src/gui/handler.cpp | 2 +- src/gui/html/elements/loot-plugin-card.html | 6 +++--- src/gui/html/elements/loot-plugin-editor.html | 4 ++-- src/gui/html/index.html | 2 +- src/gui/html/js/events.js | 4 ++-- src/gui/html/js/l10n.js | 4 ++-- src/gui/html/js/plugin.js | 2 +- src/tests/backend/plugin/test_plugin.h | 8 ++++---- 12 files changed, 31 insertions(+), 33 deletions(-) diff --git a/docs/LOOT Readme.html b/docs/LOOT Readme.html index c1350c50..c5dd9996 100644 --- a/docs/LOOT Readme.html +++ b/docs/LOOT Readme.html @@ -306,7 +306,7 @@ var {
Examples of plugin cards.
-

Each plugin is displayed on its own card, which displays all the information LOOT has for that plugin, and provides access to plugin-specific functionality, including its metadata editor. Each plugin also has an item in the sidebar's Plugins tab. The sidebar item contains the plugin's name and icons for plugins that load BSAs or have user metadata. Clicking on a plugin's sidebar item will jump to its card, while double-clicking will jump to its card and open its metadata editor. +

Each plugin is displayed on its own card, which displays all the information LOOT has for that plugin, and provides access to plugin-specific functionality, including its metadata editor. Each plugin also has an item in the sidebar's Plugins tab. The sidebar item contains the plugin's name and icons for plugins that load archives or have user metadata. Clicking on a plugin's sidebar item will jump to its card, while double-clicking will jump to its card and open its metadata editor.

The plugin card's header holds the following information, some of which is only displayed if applicable:

    @@ -349,7 +349,7 @@ var {
  1. Bash Tag suggestions
  2. Messages -
  3. A conflict filter that can be accessed through each plugin's menu. This filters the plugin cards displayed so that only plugins which conflict with this plugin will be visible. If this plugin loads a BSA, other plugins that load BSAs which may contain conflicting resources are also displayed.

    +
  4. A conflict filter that can be accessed through each plugin's menu. This filters the plugin cards displayed so that only plugins which conflict with this plugin will be visible. If this plugin loads an archive, other plugins that load archives which may contain conflicting resources are also displayed.

    Only one plugin's conflict filter can be active at any one time, so activating a second conflict filter will deactivate the first. The plugin for which the filter is currently active has its card highlighted. Sorting with a conflict filter active will first deactivate it. diff --git a/src/backend/plugin/plugin.cpp b/src/backend/plugin/plugin.cpp index aad6cee4..790709db 100644 --- a/src/backend/plugin/plugin.cpp +++ b/src/backend/plugin/plugin.cpp @@ -42,7 +42,7 @@ namespace loot { libespm::Plugin(game.LibespmId()), _isEmpty(true), _isActive(false), - _loadsBsa(false), + _loadsArchive(false), crc(0), numOverrideRecords(0) { try { @@ -91,17 +91,17 @@ namespace loot { // Get whether the plugin is active or not. _isActive = game.IsPluginActive(Name()); - // Get whether the plugin loads a BSA or not. + // Get whether the plugin loads an archive (BSA/BA2) or not. if (game.Id() == Game::tes5) { // Skyrim plugins only load BSAs that exactly match their basename. - _loadsBsa = boost::filesystem::exists(game.DataPath() / (Name().substr(0, Name().length() - 3) + "bsa")); + _loadsArchive = boost::filesystem::exists(game.DataPath() / (Name().substr(0, Name().length() - 3) + "bsa")); } else if (game.Id() != Game::tes4 || boost::iends_with(Name(), ".esp")) { //Oblivion .esp files and FO3, FNV plugins can load BSAs which begin with the plugin basename. string basename = Name().substr(0, Name().length() - 4); for (boost::filesystem::directory_iterator it(game.DataPath()); it != boost::filesystem::directory_iterator(); ++it) { if (it->path().extension().string() == ".bsa" && boost::istarts_with(it->path().filename().string(), basename)) { - _loadsBsa = true; + _loadsArchive = true; break; } } @@ -238,7 +238,7 @@ namespace loot { return !DirtyInfo().empty(); } - bool Plugin::LoadsBSA() const { - return _loadsBsa; + bool Plugin::LoadsArchive() const { + return _loadsArchive; } } diff --git a/src/backend/plugin/plugin.h b/src/backend/plugin/plugin.h index 7de75fd3..f140fc76 100644 --- a/src/backend/plugin/plugin.h +++ b/src/backend/plugin/plugin.h @@ -52,7 +52,7 @@ namespace loot { uint32_t Crc() const; size_t NumOverrideFormIDs() const; - bool LoadsBSA() const; + bool LoadsArchive() const; bool IsActive() const; //Load ordering functions. @@ -67,7 +67,7 @@ namespace loot { private: bool _isEmpty; // Does the plugin contain any records other than the TES4 header? bool _isActive; - bool _loadsBsa; + bool _loadsArchive; std::string version; //Obtained from description field. uint32_t crc; diff --git a/src/backend/plugin_sorter.cpp b/src/backend/plugin_sorter.cpp index 12a76f4e..a0eaa484 100644 --- a/src/backend/plugin_sorter.cpp +++ b/src/backend/plugin_sorter.cpp @@ -380,14 +380,12 @@ namespace loot { loot::vertex_it vit, vitend; for (boost::tie(vit, vitend) = boost::vertices(graph); vit != vitend; ++vit) { BOOST_LOG_TRIVIAL(trace) << "Adding priority difference edges to vertex for \"" << graph[*vit].Name() << "\"."; - //Priority differences should only be taken account between plugins that conflict. - //However, an exception is made for plugins that contain only a header record, - //as they are for loading BSAs, and in Skyrim that means the resources they load can - //be affected by load order. - // If the plugin does not have a global priority and doesn't load - // an archive and has no override records, skip it. - if (!graph[*vit].IsPriorityGlobal() && graph[*vit].NumOverrideFormIDs() == 0 && !graph[*vit].LoadsBSA()) + // an archive and has no override records, skip it. Plugins without + // override records can only conflict with plugins that override + // the records they add, so any edge necessary will be added when + // evaluating that plugin. + if (!graph[*vit].IsPriorityGlobal() && graph[*vit].NumOverrideFormIDs() == 0 && !graph[*vit].LoadsArchive()) continue; loot::vertex_it vit2, vitend2; diff --git a/src/gui/handler.cpp b/src/gui/handler.cpp index 0b4c7e53..8e592da0 100644 --- a/src/gui/handler.cpp +++ b/src/gui/handler.cpp @@ -734,7 +734,7 @@ namespace loot { pluginNode["isActive"] = plugin.IsActive(); pluginNode["isEmpty"] = plugin.IsEmpty(); pluginNode["isMaster"] = plugin.isMasterFile(); - pluginNode["loadsBSA"] = plugin.LoadsBSA(); + pluginNode["loadsArchive"] = plugin.LoadsArchive(); pluginNode["crc"] = IntToHexString(plugin.Crc()); pluginNode["version"] = Version(plugin.getDescription()).AsString(); diff --git a/src/gui/html/elements/loot-plugin-card.html b/src/gui/html/elements/loot-plugin-card.html index b17b8e7a..eadc58d2 100644 --- a/src/gui/html/elements/loot-plugin-card.html +++ b/src/gui/html/elements/loot-plugin-card.html @@ -54,7 +54,7 @@ loot-clear-metadata :host([data-active=false]) #activeTick { visibility: hidden; } - :host([data-bsa=false]) #loadsBSA, + :host([data-archive=false]) #loadsArchive, :host([data-empty=false]) #emptyPlugin, :host([data-master=false]) #isMaster, :host(:not([data-edits])) #hasUserEdits { @@ -174,7 +174,7 @@ loot-clear-metadata - + @@ -332,7 +332,7 @@ loot-clear-metadata this.shadowRoot.getElementById('activeTick').setPosition(); this.shadowRoot.getElementById('emptyPlugin').setPosition(); this.shadowRoot.getElementById('hasUserEdits').setPosition(); - this.shadowRoot.getElementById('loadsBSA').setPosition(); + this.shadowRoot.getElementById('loadsArchive').setPosition(); /* Also re-calculate editor tooltip positions. */ this.shadowRoot.getElementById('editor').updatePolymerElements(); diff --git a/src/gui/html/elements/loot-plugin-editor.html b/src/gui/html/elements/loot-plugin-editor.html index d3f1e85b..fba03d6e 100644 --- a/src/gui/html/elements/loot-plugin-editor.html +++ b/src/gui/html/elements/loot-plugin-editor.html @@ -34,7 +34,7 @@ loot-editor-close :host-context(loot-plugin-card[data-active=false]) #activeTick { visibility: hidden; } - :host-context(loot-plugin-card[data-bsa=false]) #loadsBSA, + :host-context(loot-plugin-card[data-archive=false]) #loadsArchive, :host-context(loot-plugin-card[data-empty=false]) #emptyPlugin, :host-context(loot-plugin-card[data-master=false]) #isMaster { display: none; @@ -134,7 +134,7 @@ loot-editor-close - + diff --git a/src/gui/html/index.html b/src/gui/html/index.html index 1bec269e..65928919 100644 --- a/src/gui/html/index.html +++ b/src/gui/html/index.html @@ -211,7 +211,7 @@