mirror of
https://github.com/ModOrganizer2/modorganizer-game_fallout76.git
synced 2026-07-27 14:08:28 -07:00
Fix profile problems with archive invalidation
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user