diff --git a/src/fallout4dataarchives.cpp b/src/fallout4dataarchives.cpp index e5908ac..3cad8c9 100644 --- a/src/fallout4dataarchives.cpp +++ b/src/fallout4dataarchives.cpp @@ -3,8 +3,9 @@ #include "iprofile.h" #include -#include - +Fallout4DataArchives::Fallout4DataArchives(const QDir &myGamesDir) : + GamebryoDataArchives(myGamesDir) +{} QStringList Fallout4DataArchives::vanillaArchives() const { @@ -34,7 +35,7 @@ QStringList Fallout4DataArchives::archives(const MOBase::IProfile *profile) cons { QStringList result; - QString iniFile = QDir(profile->absolutePath()).absoluteFilePath("fallout4.ini"); + QString iniFile = profile->localSettingsEnabled() ? QDir(profile->absolutePath()).absoluteFilePath("fallout4.ini") : m_LocalGameDir.absoluteFilePath("fallout4.ini"); result.append(getArchivesFromKey(iniFile, "SResourceArchiveList")); result.append(getArchivesFromKey(iniFile, "SResourceArchiveList2")); @@ -45,7 +46,7 @@ void Fallout4DataArchives::writeArchiveList(MOBase::IProfile *profile, const QSt { QString list = before.join(", "); - QString iniFile = QDir(profile->absolutePath()).absoluteFilePath("fallout4.ini"); + QString iniFile = profile->localSettingsEnabled() ? QDir(profile->absolutePath()).absoluteFilePath("fallout4.ini") : m_LocalGameDir.absoluteFilePath("fallout4.ini"); if (list.length() > 255) { int splitIdx = list.lastIndexOf(",", 256); setArchivesToKey(iniFile, "SResourceArchiveList", list.mid(0, splitIdx)); diff --git a/src/fallout4dataarchives.h b/src/fallout4dataarchives.h index a23eb10..b6abd17 100644 --- a/src/fallout4dataarchives.h +++ b/src/fallout4dataarchives.h @@ -6,10 +6,15 @@ namespace MOBase { class IProfile; } #include +#include class Fallout4DataArchives : public GamebryoDataArchives { +public: + + Fallout4DataArchives(const QDir &myGamesDir); + public: virtual QStringList vanillaArchives() const override; diff --git a/src/gamefallout4.cpp b/src/gamefallout4.cpp index c0ec9a7..85b69b5 100644 --- a/src/gamefallout4.cpp +++ b/src/gamefallout4.cpp @@ -41,7 +41,7 @@ bool GameFallout4::init(IOrganizer *moInfo) } registerFeature(new Fallout4ScriptExtender(this)); - registerFeature(new Fallout4DataArchives()); + registerFeature(new Fallout4DataArchives(myGamesPath())); registerFeature(new GamebryoLocalSavegames(myGamesPath(), "Fallout4.ini")); registerFeature(new Fallout4SaveGameInfo(this)); registerFeature(new Fallout4GamePlugins(moInfo));