Skip to content

Commit

Permalink
Update following gamebryo updates for myGamesPath() in game feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
Holt59 committed Jun 14, 2024
1 parent 5dd84a5 commit be2773d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
8 changes: 2 additions & 6 deletions src/fallout3dataarchives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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;
Expand All @@ -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);
}
4 changes: 1 addition & 3 deletions src/fallout3dataarchives.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/game_fallout3_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
7 changes: 3 additions & 4 deletions src/gamefallout3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit be2773d

Please sign in to comment.