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 authored Jun 22, 2024
1 parent 10a6432 commit 1e13717
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
8 changes: 2 additions & 6 deletions src/fallout4dataarchives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
#include "iprofile.h"
#include <utility.h>

Fallout4DataArchives::Fallout4DataArchives(const QDir& myGamesDir)
: GamebryoDataArchives(myGamesDir)
{}

QStringList Fallout4DataArchives::vanillaArchives() const
{
return {"Fallout4 - Textures1.ba2", "Fallout4 - Textures2.ba2",
Expand All @@ -27,7 +23,7 @@ QStringList Fallout4DataArchives::archives(const MOBase::IProfile* profile) cons

QString iniFile = profile->localSettingsEnabled()
? QDir(profile->absolutePath()).absoluteFilePath("fallout4.ini")
: m_LocalGameDir.absoluteFilePath("fallout4.ini");
: localGameDirectory().absoluteFilePath("fallout4.ini");
result.append(getArchivesFromKey(iniFile, "SResourceArchiveList"));
result.append(getArchivesFromKey(iniFile, "SResourceArchiveList2"));

Expand All @@ -41,7 +37,7 @@ void Fallout4DataArchives::writeArchiveList(MOBase::IProfile* profile,

QString iniFile = profile->localSettingsEnabled()
? QDir(profile->absolutePath()).absoluteFilePath("fallout4.ini")
: m_LocalGameDir.absoluteFilePath("fallout4.ini");
: localGameDirectory().absoluteFilePath("fallout4.ini");
if (list.length() > 255) {
int splitIdx = list.lastIndexOf(",", 256);
setArchivesToKey(iniFile, "SResourceArchiveList", list.mid(0, splitIdx));
Expand Down
4 changes: 1 addition & 3 deletions src/fallout4dataarchives.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ class IProfile;

class Fallout4DataArchives : public GamebryoDataArchives
{

public:
Fallout4DataArchives(const QDir& myGamesDir);
using GamebryoDataArchives::GamebryoDataArchives;

public:
virtual QStringList vanillaArchives() const override;
virtual QStringList archives(const MOBase::IProfile* profile) const override;

Expand Down
8 changes: 4 additions & 4 deletions src/game_fallout4_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
<context>
<name>GameFallout4</name>
<message>
<location filename="gamefallout4.cpp" line="91"/>
<location filename="gamefallout4.cpp" line="94"/>
<source>Fallout 4 Support Plugin</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamefallout4.cpp" line="102"/>
<location filename="gamefallout4.cpp" line="104"/>
<source>Adds support for the game Fallout 4.
Splash by %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamefallout4.cpp" line="309"/>
<location filename="gamefallout4.cpp" line="321"/>
<source>sTestFile entries are present</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamefallout4.cpp" line="316"/>
<location filename="gamefallout4.cpp" line="329"/>
<source>&lt;p&gt;You have sTestFile settings in your Fallout4Custom.ini. These must be removed or the game will not read the plugins.txt file. Management is disabled.&lt;/p&gt;</source>
<translation type="unfinished"></translation>
</message>
Expand Down
5 changes: 2 additions & 3 deletions src/gamefallout4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,11 @@ bool GameFallout4::init(IOrganizer* moInfo)
return false;
}

auto dataArchives = std::make_shared<Fallout4DataArchives>(myGamesPath());
auto dataArchives = std::make_shared<Fallout4DataArchives>(this);

registerFeature(std::make_shared<Fallout4ScriptExtender>(this));
registerFeature(dataArchives);
registerFeature(
std::make_shared<GamebryoLocalSavegames>(myGamesPath(), "fallout4custom.ini"));
registerFeature(std::make_shared<GamebryoLocalSavegames>(this, "fallout4custom.ini"));
registerFeature(std::make_shared<Fallout4ModDataChecker>(this));
registerFeature(
std::make_shared<Fallout4ModDataContent>(m_Organizer->gameFeatures()));
Expand Down

0 comments on commit 1e13717

Please sign in to comment.