From 6cae291a4693fd206c456a2fad1d3808f2e87dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Sat, 22 Jun 2024 08:29:56 +0200 Subject: [PATCH] Update following gamebryo updates for myGamesPath() in game feature. (#40) --- src/falloutttwdataarchives.cpp | 8 ++------ src/falloutttwdataarchives.h | 3 +-- src/game_ttw_en.ts | 6 +++--- src/gamefalloutttw.cpp | 12 ++---------- 4 files changed, 8 insertions(+), 21 deletions(-) diff --git a/src/falloutttwdataarchives.cpp b/src/falloutttwdataarchives.cpp index 1008630..3ffb076 100644 --- a/src/falloutttwdataarchives.cpp +++ b/src/falloutttwdataarchives.cpp @@ -1,10 +1,6 @@ #include "falloutttwdataarchives.h" #include -FalloutTTWDataArchives::FalloutTTWDataArchives(const QDir& myGamesDir) - : GamebryoDataArchives(myGamesDir) -{} - QStringList FalloutTTWDataArchives::vanillaArchives() const { return {"Fallout - Textures.bsa", "Fallout - Textures2.bsa", "Fallout - Meshes.bsa", @@ -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; @@ -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); } diff --git a/src/falloutttwdataarchives.h b/src/falloutttwdataarchives.h index 8cb8233..eb9d7c7 100644 --- a/src/falloutttwdataarchives.h +++ b/src/falloutttwdataarchives.h @@ -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; diff --git a/src/game_ttw_en.ts b/src/game_ttw_en.ts index 53e2efb..9d967f9 100644 --- a/src/game_ttw_en.ts +++ b/src/game_ttw_en.ts @@ -4,17 +4,17 @@ GameFalloutTTW - + Fallout TTW Support Plugin - + Adds support for the game Fallout TTW - + While not recommended by the TTW modding community, enables LOOT sorting diff --git a/src/gamefalloutttw.cpp b/src/gamefalloutttw.cpp index c2ca3ba..0cf2dcd 100644 --- a/src/gamefalloutttw.cpp +++ b/src/gamefalloutttw.cpp @@ -35,14 +35,13 @@ bool GameFalloutTTW::init(IOrganizer* moInfo) return false; } - auto dataArchives = std::make_shared(myGamesPath()); + auto dataArchives = std::make_shared(this); registerFeature(std::make_shared(this)); registerFeature(dataArchives); registerFeature( std::make_shared(dataArchives.get(), this)); registerFeature(std::make_shared(this)); - registerFeature( - std::make_shared(myGamesPath(), "fallout.ini")); + registerFeature(std::make_shared(this, "fallout.ini")); registerFeature(std::make_shared(this)); registerFeature( std::make_shared(m_Organizer->gameFeatures())); @@ -107,13 +106,6 @@ void GameFalloutTTW::setGamePath(const QString& path) m_GamePath = path; checkVariants(); m_MyGamesPath = determineMyGamesPath(gameDirectoryName()); - - auto dataArchives = std::make_shared(myGamesPath()); - registerFeature(dataArchives); - registerFeature( - std::make_shared(dataArchives.get(), this)); - registerFeature( - std::make_shared(myGamesPath(), "fallout.ini")); } QDir GameFalloutTTW::savesDirectory() const