Fix profile problems with archive invalidation

This commit is contained in:
Jeremy Rimpo
2017-12-13 12:30:30 -06:00
parent 3a818dcfae
commit 8090d65a35
3 changed files with 11 additions and 5 deletions
+5 -4
View File
@@ -3,8 +3,9 @@
#include "iprofile.h"
#include <utility.h>
#include <QDir>
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));
+5
View File
@@ -6,10 +6,15 @@
namespace MOBase { class IProfile; }
#include <QStringList>
#include <QDir>
class Fallout4DataArchives : public GamebryoDataArchives
{
public:
Fallout4DataArchives(const QDir &myGamesDir);
public:
virtual QStringList vanillaArchives() const override;
+1 -1
View File
@@ -41,7 +41,7 @@ bool GameFallout4::init(IOrganizer *moInfo)
}
registerFeature<ScriptExtender>(new Fallout4ScriptExtender(this));
registerFeature<DataArchives>(new Fallout4DataArchives());
registerFeature<DataArchives>(new Fallout4DataArchives(myGamesPath()));
registerFeature<LocalSavegames>(new GamebryoLocalSavegames(myGamesPath(), "Fallout4.ini"));
registerFeature<SaveGameInfo>(new Fallout4SaveGameInfo(this));
registerFeature<GamePlugins>(new Fallout4GamePlugins(moInfo));