From 978b4b234b6ca60224e62c461d76ccc0c32009c4 Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Mon, 4 Sep 2023 19:40:09 -0500 Subject: [PATCH 1/4] Parse secondary data directories into the directory structure --- src/directoryrefresher.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/directoryrefresher.cpp b/src/directoryrefresher.cpp index 90bfad3b2..e6d5524f9 100644 --- a/src/directoryrefresher.cpp +++ b/src/directoryrefresher.cpp @@ -489,6 +489,11 @@ void DirectoryRefresher::refresh() m_Root->addFromOrigin(L"data", dataDirectory, 0, dummy); } + for (auto directory : game->secondaryDataDirectories().toStdMap()) { + DirectoryStats dummy; + m_Root->addFromOrigin(directory.first.toStdWString(), QDir::toNativeSeparators(directory.second.absolutePath()).toStdWString(), 0, dummy); + } + std::sort(m_Mods.begin(), m_Mods.end(), [](auto lhs, auto rhs) { return lhs.priority < rhs.priority; }); From 69e73933b9ed7254d8260b0901ee0b2be79253f3 Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Mon, 4 Sep 2023 19:43:07 -0500 Subject: [PATCH 2/4] Version bump --- src/version.rc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/version.rc b/src/version.rc index 804a276d0..1ae0aca3f 100644 --- a/src/version.rc +++ b/src/version.rc @@ -4,7 +4,7 @@ // Otherwise, if letters are used in VER_FILEVERSION_STR, uses the full MOBase::VersionInfo parser // Otherwise, uses the numbers from VER_FILEVERSION and sets the release type as pre-alpha #define VER_FILEVERSION 2,5,0 -#define VER_FILEVERSION_STR "2.5.0-alpha3\0" +#define VER_FILEVERSION_STR "2.5.0-beta1\0" VS_VERSION_INFO VERSIONINFO FILEVERSION VER_FILEVERSION @@ -24,7 +24,7 @@ BEGIN VALUE "FileDescription", "Mod Organizer 2 GUI\0" VALUE "OriginalFilename", "ModOrganizer.exe\0" VALUE "InternalName", "ModOrganizer2\0" - VALUE "LegalCopyright", "Copyright 2011-2016 Sebastian Herbord\r\nCopyright 2016-2022 Mod Organizer 2 contributors\0" + VALUE "LegalCopyright", "Copyright 2011-2016 Sebastian Herbord\r\nCopyright 2016-2023 Mod Organizer 2 contributors\0" VALUE "ProductName", "Mod Organizer 2\0" VALUE "ProductVersion", VER_FILEVERSION_STR END From 3f33571a181a4e00a1169ef9eb85f37399aa4152 Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Mon, 4 Sep 2023 20:08:21 -0500 Subject: [PATCH 3/4] Add VDF reader to licenses and update openssl --- src/aboutdialog.cpp | 2 ++ src/aboutdialog.h | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/aboutdialog.cpp b/src/aboutdialog.cpp index 98743e051..781848735 100644 --- a/src/aboutdialog.cpp +++ b/src/aboutdialog.cpp @@ -56,6 +56,7 @@ AboutDialog::AboutDialog(const QString &version, QWidget *parent) m_LicenseFiles[LICENSE_CASTLE] = "Castle.txt"; m_LicenseFiles[LICENSE_ANTLR] = "AntlrBuildTask.txt"; m_LicenseFiles[LICENSE_DXTEX] = "DXTex.txt"; + m_LicenseFiles[LICENSE_VDF] = "ValveFileVDF.txt"; addLicense("Qt", LICENSE_LGPL3); addLicense("Qt Json", LICENSE_GPL3); @@ -76,6 +77,7 @@ AboutDialog::AboutDialog(const QString &version, QWidget *parent) addLicense("{fmt}", LICENSE_FMT); addLicense("SIP", LICENSE_SIP); addLicense("DXTex Headers", LICENSE_DXTEX); + addLicense("Valve File VDF Reader", LICENSE_VDF); ui->nameLabel->setText(QString("%1 %2").arg(ui->nameLabel->text()).arg(version)); #if defined(HGID) diff --git a/src/aboutdialog.h b/src/aboutdialog.h index 02d840ec1..ec1bb9d59 100644 --- a/src/aboutdialog.h +++ b/src/aboutdialog.h @@ -61,7 +61,8 @@ class AboutDialog : public QDialog LICENSE_SIP, LICENSE_CASTLE, LICENSE_ANTLR, - LICENSE_DXTEX + LICENSE_DXTEX, + LICENSE_VDF, }; private: From fdc4ebd18ce3c988f85abdc894e1e2d736f4ff65 Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Mon, 4 Sep 2023 22:20:25 -0500 Subject: [PATCH 4/4] Map multiple data directories to USVFS --- src/organizercore.cpp | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 3a959cb38..f75a8717d 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -1984,8 +1984,12 @@ std::vector OrganizerCore::fileMapping(const QString &profileName, MappingType result; - QString dataPath - = QDir::toNativeSeparators(game->dataDirectory().absolutePath()); + QStringList dataPaths; + dataPaths.append(QDir::toNativeSeparators(game->dataDirectory().absolutePath())); + + for (auto directory : game->secondaryDataDirectories()) { + dataPaths.append(directory.absolutePath()); + } bool overwriteActive = false; @@ -2002,8 +2006,10 @@ std::vector OrganizerCore::fileMapping(const QString &profileName, overwriteActive |= createTarget; if (modPtr->isRegular()) { - result.insert(result.end(), {QDir::toNativeSeparators(std::get<1>(mod)), - dataPath, true, createTarget}); + for (auto dataPath : dataPaths) { + result.insert(result.end(), { QDir::toNativeSeparators(std::get<1>(mod)), + dataPath, true, createTarget }); + } } } @@ -2024,12 +2030,14 @@ std::vector OrganizerCore::fileMapping(const QString &profileName, } } - result.insert(result.end(), { - QDir::toNativeSeparators(m_Settings.paths().overwrite()), - dataPath, - true, - customOverwrite.isEmpty() - }); + for (auto dataPath : dataPaths) { + result.insert(result.end(), { + QDir::toNativeSeparators(m_Settings.paths().overwrite()), + dataPath, + true, + customOverwrite.isEmpty() + }); + } for (MOBase::IPluginFileMapper *mapper : m_PluginContainer->plugins()) {