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 b3ba731 commit 6cae291
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 21 deletions.
8 changes: 2 additions & 6 deletions src/falloutttwdataarchives.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#include "falloutttwdataarchives.h"
#include <utility.h>

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

QStringList FalloutTTWDataArchives::vanillaArchives() const
{
return {"Fallout - Textures.bsa", "Fallout - Textures2.bsa", "Fallout - Meshes.bsa",
Expand All @@ -17,7 +13,7 @@ QStringList FalloutTTWDataArchives::archives(const MOBase::IProfile* profile) co

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 @@ -30,6 +26,6 @@ void FalloutTTWDataArchives::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);
}
3 changes: 1 addition & 2 deletions src/falloutttwdataarchives.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
class FalloutTTWDataArchives : public GamebryoDataArchives
{
public:
FalloutTTWDataArchives(const QDir& myGamesDir);
using GamebryoDataArchives::GamebryoDataArchives;

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

Expand Down
6 changes: 3 additions & 3 deletions src/game_ttw_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
<context>
<name>GameFalloutTTW</name>
<message>
<location filename="gamefalloutttw.cpp" line="193"/>
<location filename="gamefalloutttw.cpp" line="185"/>
<source>Fallout TTW Support Plugin</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamefalloutttw.cpp" line="203"/>
<location filename="gamefalloutttw.cpp" line="195"/>
<source>Adds support for the game Fallout TTW</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamefalloutttw.cpp" line="215"/>
<location filename="gamefalloutttw.cpp" line="207"/>
<source>While not recommended by the TTW modding community, enables LOOT sorting</source>
<translation type="unfinished"></translation>
</message>
Expand Down
12 changes: 2 additions & 10 deletions src/gamefalloutttw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,13 @@ bool GameFalloutTTW::init(IOrganizer* moInfo)
return false;
}

auto dataArchives = std::make_shared<FalloutTTWDataArchives>(myGamesPath());
auto dataArchives = std::make_shared<FalloutTTWDataArchives>(this);
registerFeature(std::make_shared<FalloutTTWScriptExtender>(this));
registerFeature(dataArchives);
registerFeature(
std::make_shared<FalloutTTWBSAInvalidation>(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<FalloutTTWModDataChecker>(this));
registerFeature(
std::make_shared<FalloutTTWModDataContent>(m_Organizer->gameFeatures()));
Expand Down Expand Up @@ -107,13 +106,6 @@ void GameFalloutTTW::setGamePath(const QString& path)
m_GamePath = path;
checkVariants();
m_MyGamesPath = determineMyGamesPath(gameDirectoryName());

auto dataArchives = std::make_shared<FalloutTTWDataArchives>(myGamesPath());
registerFeature(dataArchives);
registerFeature(
std::make_shared<FalloutTTWBSAInvalidation>(dataArchives.get(), this));
registerFeature(
std::make_shared<GamebryoLocalSavegames>(myGamesPath(), "fallout.ini"));
}

QDir GameFalloutTTW::savesDirectory() const
Expand Down

0 comments on commit 6cae291

Please sign in to comment.