diff options
| author | Tannin <devnull@localhost> | 2015-07-07 20:52:46 +0200 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2015-07-07 20:52:46 +0200 |
| commit | 9a5965afa73077e541c4d8bdc49f0729b42c482d (patch) | |
| tree | dbe26b486c2cb9c3e3694dfd4fb9fdb26313037e /src | |
| parent | 7853ba5f9a246b56e4dd0abfcb55a7e81e99ad9f (diff) | |
bugfix: invalidation bsa wasn't created when switching to a profile that needed it
invalidation bsa is now always placed as the first bsa
Diffstat (limited to 'src')
| -rw-r--r-- | src/mainwindow.cpp | 11 | ||||
| -rw-r--r-- | src/organizercore.cpp | 6 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 4ffa044b..466fb1c0 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -67,6 +67,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. #include <utility.h>
#include <ipluginproxy.h>
#include <dataarchives.h>
+#include <bsainvalidation.h>
#include <questionboxmemory.h>
#include <taskprogressmanager.h>
#include <util.h>
@@ -1312,15 +1313,23 @@ void MainWindow::updateBSAList(const QStringList &defaultArchives, const QString std::vector<std::pair<UINT32, QTreeWidgetItem*>> items;
+ IPluginGame *gamePlugin = qApp->property("managed_game").value<IPluginGame*>();
+
+ BSAInvalidation *invalidation = gamePlugin->feature<BSAInvalidation>();
+
for (FileEntry::Ptr current : m_OrganizerCore.directoryStructure()->getFiles()) {
QFileInfo fileInfo(ToQString(current->getName().c_str()));
if (fileInfo.suffix().toLower() == "bsa") {
- int index = activeArchives.indexOf(fileInfo.fileName());
+ int index = activeArchives.indexOf(fileInfo.fileName()) + 2;
if (index == -1) {
index = 0xFFFF;
}
+ if ((invalidation != nullptr) && invalidation->isInvalidationBSA(fileInfo.fileName())) {
+ index = 1;
+ }
+
QString basename = fileInfo.baseName();
int originId = current->getOrigin();
FilesOrigin &origin = m_OrganizerCore.directoryStructure()->getOriginByID(originId);
diff --git a/src/organizercore.cpp b/src/organizercore.cpp index fa1f372c..8b2a755d 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -529,6 +529,12 @@ void OrganizerCore::setCurrentProfile(const QString &profileName) m_CurrentProfile = newProfile;
m_ModList.setProfile(newProfile);
+ if (m_CurrentProfile->invalidationActive(nullptr)) {
+ m_CurrentProfile->activateInvalidation();
+ } else {
+ m_CurrentProfile->deactivateInvalidation();
+ }
+
connect(m_CurrentProfile, SIGNAL(modStatusChanged(uint)), this, SLOT(modStatusChanged(uint)));
refreshDirectoryStructure();
}
|
