Skip to content

Commit 6cae291

Browse files
authored
Update following gamebryo updates for myGamesPath() in game feature. (#40)
1 parent b3ba731 commit 6cae291

File tree

4 files changed

+8
-21
lines changed

4 files changed

+8
-21
lines changed

src/falloutttwdataarchives.cpp

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
#include "falloutttwdataarchives.h"
22
#include <utility.h>
33

4-
FalloutTTWDataArchives::FalloutTTWDataArchives(const QDir& myGamesDir)
5-
: GamebryoDataArchives(myGamesDir)
6-
{}
7-
84
QStringList FalloutTTWDataArchives::vanillaArchives() const
95
{
106
return {"Fallout - Textures.bsa", "Fallout - Textures2.bsa", "Fallout - Meshes.bsa",
@@ -17,7 +13,7 @@ QStringList FalloutTTWDataArchives::archives(const MOBase::IProfile* profile) co
1713

1814
QString iniFile = profile->localSettingsEnabled()
1915
? QDir(profile->absolutePath()).absoluteFilePath("fallout.ini")
20-
: m_LocalGameDir.absoluteFilePath("fallout.ini");
16+
: localGameDirectory().absoluteFilePath("fallout.ini");
2117
result.append(getArchivesFromKey(iniFile, "SArchiveList"));
2218

2319
return result;
@@ -30,6 +26,6 @@ void FalloutTTWDataArchives::writeArchiveList(MOBase::IProfile* profile,
3026

3127
QString iniFile = profile->localSettingsEnabled()
3228
? QDir(profile->absolutePath()).absoluteFilePath("fallout.ini")
33-
: m_LocalGameDir.absoluteFilePath("fallout.ini");
29+
: localGameDirectory().absoluteFilePath("fallout.ini");
3430
setArchivesToKey(iniFile, "SArchiveList", list);
3531
}

src/falloutttwdataarchives.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010
class FalloutTTWDataArchives : public GamebryoDataArchives
1111
{
1212
public:
13-
FalloutTTWDataArchives(const QDir& myGamesDir);
13+
using GamebryoDataArchives::GamebryoDataArchives;
1414

15-
public:
1615
virtual QStringList vanillaArchives() const override;
1716
virtual QStringList archives(const MOBase::IProfile* profile) const override;
1817

src/game_ttw_en.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
<context>
55
<name>GameFalloutTTW</name>
66
<message>
7-
<location filename="gamefalloutttw.cpp" line="193"/>
7+
<location filename="gamefalloutttw.cpp" line="185"/>
88
<source>Fallout TTW Support Plugin</source>
99
<translation type="unfinished"></translation>
1010
</message>
1111
<message>
12-
<location filename="gamefalloutttw.cpp" line="203"/>
12+
<location filename="gamefalloutttw.cpp" line="195"/>
1313
<source>Adds support for the game Fallout TTW</source>
1414
<translation type="unfinished"></translation>
1515
</message>
1616
<message>
17-
<location filename="gamefalloutttw.cpp" line="215"/>
17+
<location filename="gamefalloutttw.cpp" line="207"/>
1818
<source>While not recommended by the TTW modding community, enables LOOT sorting</source>
1919
<translation type="unfinished"></translation>
2020
</message>

src/gamefalloutttw.cpp

+2-10
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,13 @@ bool GameFalloutTTW::init(IOrganizer* moInfo)
3535
return false;
3636
}
3737

38-
auto dataArchives = std::make_shared<FalloutTTWDataArchives>(myGamesPath());
38+
auto dataArchives = std::make_shared<FalloutTTWDataArchives>(this);
3939
registerFeature(std::make_shared<FalloutTTWScriptExtender>(this));
4040
registerFeature(dataArchives);
4141
registerFeature(
4242
std::make_shared<FalloutTTWBSAInvalidation>(dataArchives.get(), this));
4343
registerFeature(std::make_shared<GamebryoSaveGameInfo>(this));
44-
registerFeature(
45-
std::make_shared<GamebryoLocalSavegames>(myGamesPath(), "fallout.ini"));
44+
registerFeature(std::make_shared<GamebryoLocalSavegames>(this, "fallout.ini"));
4645
registerFeature(std::make_shared<FalloutTTWModDataChecker>(this));
4746
registerFeature(
4847
std::make_shared<FalloutTTWModDataContent>(m_Organizer->gameFeatures()));
@@ -107,13 +106,6 @@ void GameFalloutTTW::setGamePath(const QString& path)
107106
m_GamePath = path;
108107
checkVariants();
109108
m_MyGamesPath = determineMyGamesPath(gameDirectoryName());
110-
111-
auto dataArchives = std::make_shared<FalloutTTWDataArchives>(myGamesPath());
112-
registerFeature(dataArchives);
113-
registerFeature(
114-
std::make_shared<FalloutTTWBSAInvalidation>(dataArchives.get(), this));
115-
registerFeature(
116-
std::make_shared<GamebryoLocalSavegames>(myGamesPath(), "fallout.ini"));
117109
}
118110

119111
QDir GameFalloutTTW::savesDirectory() const

0 commit comments

Comments
 (0)