Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading