From be2773de4adc38be4d7e7014dae0bc0c5a00dd38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Fri, 14 Jun 2024 18:00:03 +0200 Subject: [PATCH] Update following gamebryo updates for myGamesPath() in game feature. --- src/fallout3dataarchives.cpp | 8 ++------ src/fallout3dataarchives.h | 4 +--- src/game_fallout3_en.ts | 4 ++-- src/gamefallout3.cpp | 7 +++---- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/fallout3dataarchives.cpp b/src/fallout3dataarchives.cpp index 623b566..ed6627b 100644 --- a/src/fallout3dataarchives.cpp +++ b/src/fallout3dataarchives.cpp @@ -3,10 +3,6 @@ #include "iprofile.h" #include -Fallout3DataArchives::Fallout3DataArchives(const QDir& myGamesDir) - : GamebryoDataArchives(myGamesDir) -{} - QStringList Fallout3DataArchives::vanillaArchives() const { return {"Fallout - Textures.bsa", "Fallout - Meshes.bsa", "Fallout - Voices.bsa", @@ -19,7 +15,7 @@ QStringList Fallout3DataArchives::archives(const MOBase::IProfile* profile) cons 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; @@ -32,6 +28,6 @@ void Fallout3DataArchives::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/fallout3dataarchives.h b/src/fallout3dataarchives.h index 5522e08..8ba4561 100644 --- a/src/fallout3dataarchives.h +++ b/src/fallout3dataarchives.h @@ -6,11 +6,9 @@ class Fallout3DataArchives : public GamebryoDataArchives { - public: - Fallout3DataArchives(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_fallout3_en.ts b/src/game_fallout3_en.ts index c404839..e191286 100644 --- a/src/game_fallout3_en.ts +++ b/src/game_fallout3_en.ts @@ -4,12 +4,12 @@ GameFallout3 - + Fallout 3 Support Plugin - + Adds support for the game Fallout 3. diff --git a/src/gamefallout3.cpp b/src/gamefallout3.cpp index 6de76cd..3bd553b 100644 --- a/src/gamefallout3.cpp +++ b/src/gamefallout3.cpp @@ -35,13 +35,12 @@ bool GameFallout3::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())); @@ -139,7 +138,7 @@ void GameFallout3::initializeProfile(const QDir& path, ProfileSettings settings) if (settings.testFlag(IPluginGame::CONFIGURATION)) { if (settings.testFlag(IPluginGame::PREFER_DEFAULTS) || - !QFileInfo(myGamesPath() + "/fallout.ini").exists()) { + !QFileInfo(myGamesPath(), "fallout.ini").exists()) { copyToProfile(gameDirectory().absolutePath(), path, "fallout_default.ini", "fallout.ini"); } else {