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

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

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

QString iniFile = profile->localSettingsEnabled()
? QDir(profile->absolutePath()).absoluteFilePath("fallout.ini")
: m_LocalGameDir.absoluteFilePath("fallout.ini");
: localGameDirectory().absoluteFilePath("fallout.ini");
result.append(getArchivesFromKey(iniFile, "SArchiveList",
8192)); // NVAC expands the maximum string limit

Expand All @@ -31,6 +27,6 @@ void FalloutNVDataArchives::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/falloutnvdataarchives.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
class FalloutNVDataArchives : public GamebryoDataArchives
{
public:
FalloutNVDataArchives(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_falloutNV_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
<context>
<name>GameFalloutNV</name>
<message>
<location filename="gamefalloutnv.cpp" line="185"/>
<location filename="gamefalloutnv.cpp" line="181"/>
<source>Fallout NV Support Plugin</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamefalloutnv.cpp" line="195"/>
<location filename="gamefalloutnv.cpp" line="191"/>
<source>Adds support for the game Fallout New Vegas</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamefalloutnv.cpp" line="207"/>
<location filename="gamefalloutnv.cpp" line="203"/>
<source>While not recommended by the FNV modding community, enables LOOT sorting</source>
<translation type="unfinished"></translation>
</message>
Expand Down
11 changes: 2 additions & 9 deletions src/gamefalloutnv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,12 @@ bool GameFalloutNV::init(IOrganizer* moInfo)
return false;
}

auto dataArchives = std::make_shared<FalloutNVDataArchives>(myGamesPath());
auto dataArchives = std::make_shared<FalloutNVDataArchives>(this);
registerFeature(std::make_shared<FalloutNVScriptExtender>(this));
registerFeature(dataArchives);
registerFeature(std::make_shared<FalloutNVBSAInvalidation>(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<FalloutNVModDataChecker>(this));
registerFeature(
std::make_shared<FalloutNVModDataContent>(m_Organizer->gameFeatures()));
Expand Down Expand Up @@ -104,12 +103,6 @@ void GameFalloutNV::setGamePath(const QString& path)
m_GamePath = path;
checkVariants();
m_MyGamesPath = determineMyGamesPath(gameDirectoryName());

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

QDir GameFalloutNV::savesDirectory() const
Expand Down

0 comments on commit 52ea004

Please sign in to comment.