Update following gamebryo updates for myGamesPath() in game feature. (#24)

This commit is contained in:
Mikaël Capelle
2024-06-22 08:29:24 +02:00
committed by GitHub
parent 5dd84a5000
commit 825995cbb7
4 changed files with 8 additions and 15 deletions
+2 -6
View File
@@ -3,10 +3,6 @@
#include "iprofile.h"
#include <utility.h>
Fallout3DataArchives::Fallout3DataArchives(const QDir& myGamesDir)
: GamebryoDataArchives(myGamesDir)
{}
QStringList Fallout3DataArchives::vanillaArchives() const
{
return {"Fallout - Textures.bsa", "Fallout - Meshes.bsa", "Fallout - Voices.bsa",
@@ -19,7 +15,7 @@ QStringList Fallout3DataArchives::archives(const MOBase::IProfile* profile) cons
QString iniFile = profile->localSettingsEnabled()
? QDir(profile->absolutePath()).absoluteFilePath("fallout.ini")
: m_LocalGameDir.absoluteFilePath("fallout.ini");
: localGameDirectory().absoluteFilePath("fallout.ini");
result.append(getArchivesFromKey(iniFile, "SArchiveList"));
return result;
@@ -32,6 +28,6 @@ void Fallout3DataArchives::writeArchiveList(MOBase::IProfile* profile,
QString iniFile = profile->localSettingsEnabled()
? QDir(profile->absolutePath()).absoluteFilePath("fallout.ini")
: m_LocalGameDir.absoluteFilePath("fallout.ini");
: localGameDirectory().absoluteFilePath("fallout.ini");
setArchivesToKey(iniFile, "SArchiveList", list);
}
+1 -3
View File
@@ -6,11 +6,9 @@
class Fallout3DataArchives : public GamebryoDataArchives
{
public:
Fallout3DataArchives(const QDir& myGamesDir);
using GamebryoDataArchives::GamebryoDataArchives;
public:
virtual QStringList vanillaArchives() const override;
virtual QStringList archives(const MOBase::IProfile* profile) const override;
+2 -2
View File
@@ -4,12 +4,12 @@
<context>
<name>GameFallout3</name>
<message>
<location filename="gamefallout3.cpp" line="107"/>
<location filename="gamefallout3.cpp" line="109"/>
<source>Fallout 3 Support Plugin</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamefallout3.cpp" line="117"/>
<location filename="gamefallout3.cpp" line="119"/>
<source>Adds support for the game Fallout 3.</source>
<translation type="unfinished"></translation>
</message>
+3 -4
View File
@@ -35,13 +35,12 @@ bool GameFallout3::init(IOrganizer* moInfo)
return false;
}
auto dataArchives = std::make_shared<Fallout3DataArchives>(myGamesPath());
auto dataArchives = std::make_shared<Fallout3DataArchives>(this);
registerFeature(std::make_shared<Fallout3ScriptExtender>(this));
registerFeature(dataArchives);
registerFeature(std::make_shared<Fallout3BSAInvalidation>(dataArchives.get(), this));
registerFeature(std::make_shared<GamebryoSaveGameInfo>(this));
registerFeature(
std::make_shared<GamebryoLocalSavegames>(myGamesPath(), "fallout.ini"));
registerFeature(std::make_shared<GamebryoLocalSavegames>(this, "fallout.ini"));
registerFeature(std::make_shared<Fallout3ModDataChecker>(this));
registerFeature(
std::make_shared<Fallout3ModDataContent>(m_Organizer->gameFeatures()));
@@ -139,7 +138,7 @@ void GameFallout3::initializeProfile(const QDir& path, ProfileSettings settings)
if (settings.testFlag(IPluginGame::CONFIGURATION)) {
if (settings.testFlag(IPluginGame::PREFER_DEFAULTS) ||
!QFileInfo(myGamesPath() + "/fallout.ini").exists()) {
!QFileInfo(myGamesPath(), "fallout.ini").exists()) {
copyToProfile(gameDirectory().absolutePath(), path, "fallout_default.ini",
"fallout.ini");
} else {